Opened 10 years ago

Closed 10 years ago

#3829 closed defect (fixed)

atempo filter cuts off data

Reported by: rmk Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: atempo
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

The following command line with a file containein two click sounds (one in the beginning, the other right before the end) demonstrates the problem:

ffmpeg -i two-clicks.wav -af "atempo=0.5" -acodec pcm_s16le two-clicks-half-speed.wav
ffmpeg version N-65311-g6f3e15a Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug  5 2014 17:28:11 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-gpl --enable-libx264 --enable-libfaac --enable-nonfree --extra-ldflags=-L/usr/local/lib --extra-cflags=-I/usr/local/include
  libavutil      52. 97.100 / 52. 97.100
  libavcodec     55. 72.101 / 55. 72.101
  libavformat    55. 51.101 / 55. 51.101
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'two-clicks.wav':
  Duration: 00:00:01.00, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s
Output #0, wav, to 'two-clicks-half-speed.wav':
  Metadata:
    ISFT            : Lavf55.51.101
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
    Metadata:
      encoder         : Lavc55.72.101 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=     168kB time=00:00:01.95 bitrate= 705.9kbits/s    
video:0kB audio:168kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.045340%

Then checking the output shows the file is 0.05 seconds too short:

ffmpeg -i two-clicks-half-speed.wav 
ffmpeg version N-65311-g6f3e15a Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug  5 2014 17:28:11 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-gpl --enable-libx264 --enable-libfaac --enable-nonfree --extra-ldflags=-L/usr/local/lib --extra-cflags=-I/usr/local/include
  libavutil      52. 97.100 / 52. 97.100
  libavcodec     55. 72.101 / 55. 72.101
  libavformat    55. 51.101 / 55. 51.101
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'two-clicks-half-speed.wav':
  Metadata:
    encoder         : Lavf55.51.101
  Duration: 00:00:01.95, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s
At least one output file must be specified

And looking at the file in a wave editor (and listening to it), you see/hear that the second click was cut off.

Attachments (1)

two-clicks.wav (86.2 KB ) - added by rmk 10 years ago.

Download all attachments as: .zip

Change History (5)

by rmk, 10 years ago

Attachment: two-clicks.wav added

comment:1 by Carl Eugen Hoyos, 10 years ago

Description: modified (diff)
Keywords: atempo added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

comment:2 by Pavel Koshevoy, 10 years ago

I am taking a look at this

comment:4 by Elon Musk, 10 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.