[FFmpeg-trac] #9269(undetermined:new): ffmpeg produces broken files when cutting mp4s

FFmpeg trac at avcodec.org
Sun Feb 13 13:33:20 EET 2022


#9269: ffmpeg produces broken files when cutting mp4s
-------------------------------------+-------------------------------------
             Reporter:  Artem S.     |                    Owner:  (none)
  Tashkinov                          |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by Bugmenot):

 I can confirm similar behaviour using ffmpeg 4.4.1.

 However, see this extract from https://trac.ffmpeg.org/wiki/Seeking :

   Using `-ss` as input option together with `-c:v copy` might not be
 accurate since `ffmpeg` is forced to only use/split on i-frames. Though it
 will—if possible—adjust the start time of the stream to a negative value
 to compensate for that.  Basically, if you specify "second 157" and there
 is no key frame until second 159, it will include two seconds of audio
 (with no video) at the start, then will start from the first key frame.
 So be careful when splitting and doing codec copy.

 So, I suggest we use a different cutting strategy : cut audio & video at
 the same (innacurate) point, instead of including some seconds of audio
 with no video, because that confuses some players (and people ;)). IMHO,
 this I-frame cut is a limitation which shouldn't lead to a different
 length in audio and video streams, but the same lenght, to keep the audio
 & video coherent (even though the seeking point won't be exactly
 respected). What do you think?

 Would you (ffmpeg developers) agree to modify this strategy?
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9269#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list