Opened 12 years ago
Closed 12 years ago
#1725 closed defect (invalid)
filter_complex losing frames
Reported by: | Takis Issaris | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avfilter |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
I'm overlaying transparant PNGs over another video which I'm upscaling. Somehow I seem to be losing frames.
How to reproduce:
% ffmpeg -i big_buck_bunny_1080p_h264.mov -i frame%05d.png -filter_complex "[0:v] scale=3840:2160[bbb];[bbb][1:v] overlay[out]" -map "[out]" test.mp4 ffmpeg version N-44322-g1e9caf9 built on Sep 10 2012 11:35:03 with clang version 3.1 (tags/RELEASE_31/final)
Change History (8)
follow-up: 3 comment:1 by , 12 years ago
comment:2 by , 12 years ago
I noticed that I was losing frames as the numbered%05d.png's contain the framenumber in each frame.
comment:3 by , 12 years ago
Replying to takis:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/srv/files/videos/big_buck_bunny_1080p_h264.mov': Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 9282 kb/s, 24 fps, 24 tbr, 2400 tbn, 4800 tbc Input #1, image2, from 'frame%05d.png': Stream #1:0: Video: png, rgba, 3840x2160, 25 fps, 25 tbr, 25 tbn, 25 tbc
As quoted, your main video is 24 FPS while the overlay video (they are actually images, but ffmpeg sees them as a single video) is 25 FPS: one frame per second of the overlay falls between two frames of the main input and is dropped. That is normal behaviour. If your frames are supposed to match, specify the frame rate for the images.
comment:4 by , 12 years ago
Ah! I should have read FFmpeg's output... I did not know it assumed the image sequence would be a 25 fps video.
Thanks for your fast reply!
comment:5 by , 12 years ago
Here's the updated commandline:
ffmpeg -i big_buck_bunny_1080p_h264.mov -f image2 -r 24 -i frame%05d.png -filter_complex "[0:v] scale=3840:2160[bbb];[bbb][1:v] overlay[out]" -map "[out]" test.mp4
Leaving out the "-f image2" does not work though. Not sure why.
Unfortunately, there's still one frame missing: The second frame always goes missing now.
comment:6 by , 12 years ago
This particular file is missing its "second" frame, i.e., the frame at pts=1/24, just between pts=0/24 and pts=2/24:
$ ffprobe -loglevel quiet -show_frames -of compact /tmp/big_buck_bunny_1080p_h264.mov frame|media_type=video|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=-100|pkt_dts_time=-0.041667|pkt_duration=100|pkt_duration_time=0.041667|pkt_pos=441422|width=1920|height=1080|pix_fmt=yuv420p|sample_aspect_ratio=N/A|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|reference=0 frame|media_type=video|key_frame=0|pkt_pts=200|pkt_pts_time=0.083333|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=100|pkt_duration_time=0.041667|pkt_pos=447743|width=1920|height=1080|pix_fmt=yuv420p|sample_aspect_ratio=N/A|pict_type=P|coded_picture_number=1|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|reference=0 frame|media_type=video|key_frame=0|pkt_pts=300|pkt_pts_time=0.125000|pkt_dts=300|pkt_dts_time=0.125000|pkt_duration=100|pkt_duration_time=0.041667|pkt_pos=592358|width=1920|height=1080|pix_fmt=yuv420p|sample_aspect_ratio=N/A|pict_type=B|coded_picture_number=4|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|reference=0 frame|media_type=video|key_frame=0|pkt_pts=400|pkt_pts_time=0.166667|pkt_dts=400|pkt_dts_time=0.166667|pkt_duration=100|pkt_duration_time=0.041667|pkt_pos=448026|width=1920|height=1080|pix_fmt=yuv420p|sample_aspect_ratio=N/A|pict_type=P|coded_picture_number=3|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|reference=3
You can force it to be duplicated, and therefore available for overlay by inserting the fps=fps=24
near the input (just after the scale, probably).
comment:8 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Full output: