[FFmpeg-trac] #9030(ffmpeg:new): -ss with codec copy corrupts output

FFmpeg trac at avcodec.org
Sun Dec 13 18:00:52 EET 2020


#9030: -ss with codec copy corrupts output
-------------------------------------+-------------------------------------
             Reporter:               |                     Type:  defect
  balintlaczko                       |
               Status:  new          |                 Priority:  critical
            Component:  ffmpeg       |                  Version:  git-
             Keywords:  -ss codec    |  master
  copy glitch                        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 The fast -ss tool with -codec copy seems to produce videos with incorrect
 metadata(?). The cuts sometimes cause video players (tested on VLC and
 win10 Movies & TV) to get confused, and start to playback the video from
 the "beginning" (of the input file) with a black screen of just a frozen
 frame (which is the frame at the -ss timepoint). Meanwhile sound plays
 back as if it was not cut at all. What is even more confusing that the
 behavior of this problem is inconsistent, some timepoints (typically the
 ones further from 0:00 in the input) are okay, some produce the incorrect
 black screens/glitches (see an example here: https://github.com/fourMs
 /MGT-python/issues/168). In some cases the metadata doesn't even get
 changed and the output claims to have the same number of frames and length
 as the input. The problem seems to be related to the mp4 container(?). It
 happens all the time with my test mp4 file, but if I first convert it to
 an avi and try to trim that the problem never happens. If I take the
 converted avi video, convert it back to mp4, and try to trim that with -ss
 and -codec copy, the problem reappears.
 How to reproduce:
 {{{
 % ffmpeg -i input.mp4 -ss 5 -t 5 -codec copy output.mp4
 ffmpeg version ffmpeg-2020-12-12-git-5148740e79-full_build
 built on windows
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9030>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list