Opened 6 years ago

Last modified 6 years ago

#7306 new defect

Seeking problem: -ss as output parameter at a key frame of a mp4 and -c copy result in droping of video frames

Reported by: Duan Yao Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffmpeg -report -y -i neck5.mp4 -ss 0 -t 1 -c copy neck5-1.mp4

Or

% ffmpeg -report -y -i neck5.mp4 -ss 2.36 -t 1 -c copy neck5-1.mp4

The 2 key frames of neck5.mp4 (5s length, 25fps) locate at 0s, 2.36s, respectively.

Expected result: neck5-1.mp4 contains ~1s audio and video.

Actual result: neck5-1.mp4 contains only audio and no video.

To workaround this problem, I have to minus time of key frame by at least 2*pkt_duration_time, i.e. -0.08s:

% ffmpeg -report -y -i neck5.mp4 -ss -0.08 -t 1 -c copy neck5-1.mp4

Or

% ffmpeg -report -y -i neck5.mp4 -ss 2.28 -t 1 -c copy neck5-1.mp4

Attachments (5)

neck5.mp4 (384.3 KB ) - added by Duan Yao 6 years ago.
neck5.mp4 (input sample)
ffmpeg-20180706-212532.log (43.4 KB ) - added by Duan Yao 6 years ago.
ffmpeg -i neck5.mp4 -ss 0 -t 1 -c copy neck5-1.mp4
ffmpeg-20180706-212524.log (57.8 KB ) - added by Duan Yao 6 years ago.
ffmpeg -i neck5.mp4 -ss 2.36 -t 1 -c copy neck5-1.mp4
ffmpeg-20180706-212026.log (31.2 KB ) - added by Duan Yao 6 years ago.
ffmpeg -report -y -i neck5.mp4 -ss 0 -t 1 -c copy neck5-1.mp4
ffmpeg-20180706-212302.log (58.1 KB ) - added by Duan Yao 6 years ago.
ffmpeg -report -y -i neck5.mp4 -ss 2.36 -t 1 -c copy neck5-1.mp4

Download all attachments as: .zip

Change History (7)

by Duan Yao, 6 years ago

Attachment: neck5.mp4 added

neck5.mp4 (input sample)

by Duan Yao, 6 years ago

Attachment: ffmpeg-20180706-212532.log added

ffmpeg -i neck5.mp4 -ss 0 -t 1 -c copy neck5-1.mp4

by Duan Yao, 6 years ago

Attachment: ffmpeg-20180706-212524.log added

ffmpeg -i neck5.mp4 -ss 2.36 -t 1 -c copy neck5-1.mp4

by Duan Yao, 6 years ago

Attachment: ffmpeg-20180706-212026.log added

ffmpeg -report -y -i neck5.mp4 -ss 0 -t 1 -c copy neck5-1.mp4

by Duan Yao, 6 years ago

Attachment: ffmpeg-20180706-212302.log added

ffmpeg -report -y -i neck5.mp4 -ss 2.36 -t 1 -c copy neck5-1.mp4

comment:1 by Duan Yao, 6 years ago

By the way, -ss as an input parameter doesn't drop frames, but result in much longer duration (3.44s):

ffmpeg -report -y -ss 2.36 -t 1 -i neck5.mp4 -c copy neck5-1.mp4

comment:2 by Carl Eugen Hoyos, 6 years ago

For -ss 2.36, this is not a regression, I wonder if it is related to B-frames.

Note: See TracTickets for help on using tickets.