Opened 3 months ago

Closed 6 weeks ago

Last modified 6 weeks ago

#6540 closed defect (fixed)

Atempo filter cuts off data at the end

Reported by: asdamos Owned by:
Priority: important Component: avfilter
Version: git-master Keywords: atempo regression
Cc: cus Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

When using atempo filter it cuts off sound data at the end of file.

I was also using atempo filter from C API in similar way to https://www.ffmpeg.org/doxygen/trunk/filter_audio_8c-example.html.

I noticed that, when I pushed frame to filter graph, I had to push few more frames before I could get frame number one from filter graph. So at the end of filtering, I did not get all the frames I pushed to filter graph.

Following command should produce 1 second file but produces 0.97 second file.

./ffmpeg -i one-second-file.wav -filter:a "atempo=1.0" -vn output.wavffmpeg version N-86695-g0a24d7c Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --prefix=/home/user/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --enable-nonfree
  libavutil      55. 67.100 / 55. 67.100
  libavcodec     57.100.103 / 57.100.103
  libavformat    57. 75.100 / 57. 75.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from 'one-second-file.wav':
  Duration: 00:00:01.00, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'output.wav':
  Metadata:
    ISFT            : Lavf57.75.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
    Metadata:
      encoder         : Lavc57.100.103 pcm_s16le
size=      84kB time=00:00:00.97 bitrate= 706.2kbits/s speed=6.55x    
video:0kB audio:84kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.090681%

Following command should produce 2 seconds file but produces 1.92 seconds file.

./ffmpeg -i one-second-file.wav -filter:a "atempo=0.5" -vn output.wav
ffmpeg version N-86695-g0a24d7c Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --prefix=/home/user/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --enable-nonfree
  libavutil      55. 67.100 / 55. 67.100
  libavcodec     57.100.103 / 57.100.103
  libavformat    57. 75.100 / 57. 75.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from 'one-second-file.wav':
  Duration: 00:00:01.00, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'output.wav':
  Metadata:
    ISFT            : Lavf57.75.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
    Metadata:
      encoder         : Lavc57.100.103 pcm_s16le
size=     166kB time=00:00:01.92 bitrate= 705.9kbits/s speed= 282x    
video:0kB audio:166kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.045887%

Attachments (1)

one-second-file.wav (86.2 KB) - added by asdamos 3 months ago.
Sample one second file

Download all attachments as: .zip

Change History (4)

Changed 3 months ago by asdamos

Sample one second file

comment:1 Changed 7 weeks ago by cus

  • Cc cus added
  • Keywords regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

comment:2 Changed 6 weeks ago by cus

  • Resolution set to fixed
  • Status changed from open to closed

comment:3 Changed 6 weeks ago by cehoyos

  • Version changed from 3.2.4 to git-master
Note: See TracTickets for help on using tickets.