How to segment a video and then concatenate back into original one with ffmpeg

前端 未结 1 1707
一个人的身影
一个人的身影 2020-12-11 07:02

I am surveying on distributed video transcoding with FFmpeg. I have found that there is a good script on https://github.com/nergdron/dve/blob/master/dve.

The script

相关标签:
1条回答
  • 2020-12-11 07:52

    The segment muxer, by default, preserves input timestamps. And the way that the concat demuxer works is that it adds the relative timestamp of incoming files to the net duration processed so far. e.g. If first file is 10 seconds, and second file is 5 seconds but with a start time of 10 seconds. Then the first frame of the 2nd file in the output will have a timestamp of 20 seconds. This, I believe, is leading to the AVI warning.

    Also keeping in mind that the segment muxer can create the concat list for you, use

    ffmpeg -fflags +genpts -i Test.avi -map 0 -c copy -f segment -segment_format avi -segment_list Test.ffcat -reset_timestamps 1 -v error chunk-%03d.seg
    

    and then

    ffmpeg -y -v error -i Test.ffcat -map 0 -c copy output.avi
    
    0 讨论(0)
提交回复
热议问题