How to split a video using FFMPEG so that each chunk starts with a key frame?

后端 未结 6 483
我寻月下人不归
我寻月下人不归 2020-11-28 02:54

We need to split a large live WMV video feed in small chunks all of the same size. We made a script that works fine doing this, except for one thing: the video chunks don\'t

6条回答
  •  无人及你
    2020-11-28 03:24

    If you are willing to do some scripting and want I frames at a particular interval the one way to do it is

    1. Run ffprobe and collect the locations of the I frames from the output

      ffprobe -show_streams

    2. Run a series of -ss -t commands using the same script to get the chunks you desire.

    You can then have your script decide minimum number of frames [say there are two I pictures within 10 frames of each other, you really don't want to be chunking it there].

    The other way to do it is to use gstreamer's multisfilesink and set the mode to key frame [however that will chunk at every key frame so that may not be ideal]

提交回复
热议问题