#3433(ffmpeg:new): using "shortest" results in mismatched audio and video lengths
#3433: using "shortest" results in mismatched audio and video lengths -----------------------------------+-------------------------------------- Reporter: mjmvisser | Type: defect Status: new | Priority: normal Component: ffmpeg | Version: git-master Keywords: shortest | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -----------------------------------+-------------------------------------- Summary of the bug: "-shortest" does not add trim/atrim filters, so the length of each output stream will be a multiple of sample size. In the given example, the video is exactly 1s, but the resulting output is 1.02s. If "-t 1.000" is passed instead of "-shortest", the resulting output is exactly 1s. The difference is that using "-t" adds trim/atrim filters, so the last frame->nb_samples encoded will be truncated to fit the given duration. How to reproduce: {{{ % ffmpeg -y -probesize 500000 -f image2 -r 25 -i colorbars.%04d.png -i 100Hz_44100Hz_16bit_05sec.wav -shortest -c:v png -c:a pcm_s16le -q:v 1 -2 -f mov colorbars.mov Note that input streams have durations of 5s and 1s. % ffprobe colorbars.mov Note that the output stream has a duration of 1.02s. ffmpeg version N-60960-gf3eef02 built on Feb 28 2014 10:31:20 }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/3433> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3433: using "shortest" results in mismatched audio and video lengths ------------------------------------+---------------------------------- Reporter: mjmvisser | Owner: Type: defect | Status: new Priority: normal | Component: ffmpeg Version: git-master | Resolution: Keywords: shortest | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+---------------------------------- Comment (by mjmvisser): I tried forcing the trim filter to be added if shortest=1, and finding & updating it at the same time of->recording_time is set in close_output_stream. No good, this has no effect because filter initialization is done before close_output_stream is called and libavfilter doesn't allow filters to be re-initialized. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3433#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3433: using "shortest" results in mismatched audio and video lengths ------------------------------------+----------------------------------- Reporter: mjmvisser | Owner: (none) Type: defect | Status: closed Priority: normal | Component: ffmpeg Version: git-master | Resolution: wontfix Keywords: shortest | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Changes (by Elon Musk): * status: new => closed * resolution: => wontfix Comment: -shortest cant add filters because it is working also for stream copy. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3433#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg