#11231: alphamerge complex filter delays video several seconds
-------------------------------------+-------------------------------------
             Reporter:  degradox     |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug: using complex filter with alphamerge caused audio-
 video desync.

 How to reproduce:
 When converting normally, the output has audio and video synced, like the
 input:
 {{{
 % ffmpeg -y -i input_good.mp4 -map 0:v -map 0:a -c:v libx264 -profile:v
 high -level:v 4.2 -pix_fmt yuv420p \
   -r 60 -b:v 600k -preset fast -c:a aac -b:a 80k -ar 48000 -ac 2 -fps_mode
 cfr -nostdin output_good.mp4
 }}}

 Using filter advances somehow the video. The first minutes it's about 7
 seconds. At the end the video ends about 13 seconds earlier than audio, so
 there's the last frame stuck for that time:
 {{{
 % ffmpeg -y \
   -i input_good.mp4 \
   -filter_complex "\
     [0:v]scale=1920:1080:force_original_aspect_ratio=decrease,setpts=PTS-
 STARTPTS [scaled_main]; \
     color=c=black@0:s=1280x720:d=10000 [blank_overlay]; \
     [blank_overlay]format=gray [mask_trim]; \
     [blank_overlay][mask_trim]alphamerge [overlay_stream]; \
     [scaled_main][overlay_stream]overlay=x=main_w-overlay_w-0:y=main_h-
 overlay_h-0:eof_action=pass:shortest=0 [outv]" \
   -map "[outv]" -map 0:a -c:v libx264 -profile:v high -level:v 4.2
 -pix_fmt yuv420p -r 60 -b:v 600k -preset fast \
   -c:a aac -b:a 80k -ar 48000 -ac 2 -fps_mode cfr -nostdin
 output_desynced.mp4
 }}}

 Both outputs have the same duration as the input, 51 minutes 54 seconds.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11231>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to