Opened 5 months ago

Last modified 5 months 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: duanyao 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 duanyao 5 months ago.
neck5.mp4 (input sample)
ffmpeg-20180706-212532.log (43.4 KB) - added by duanyao 5 months ago.
ffmpeg -i neck5.mp4 -ss 0 -t 1 -c copy neck5-1.mp4
ffmpeg-20180706-212524.log (57.8 KB) - added by duanyao 5 months ago.
ffmpeg -i neck5.mp4 -ss 2.36 -t 1 -c copy neck5-1.mp4
ffmpeg-20180706-212026.log (31.2 KB) - added by duanyao 5 months 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 duanyao 5 months 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)

Changed 5 months ago by duanyao

neck5.mp4 (input sample)

Changed 5 months ago by duanyao

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

Changed 5 months ago by duanyao

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

Changed 5 months ago by duanyao

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

Changed 5 months ago by duanyao

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

comment:1 Changed 5 months ago by duanyao

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 Changed 5 months ago by cehoyos

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.