M HYPE SPLASH
// general

Use FFmpeg to split video into multiple scenes

By Abigail Rogers

I am trying to use FFmpeg for splitting a video into multiple supposedly single-scene sub-videos using the scenecut feature and threshold. I found the following command on SE:

ffmpeg -i myVideo.mp4 -y -c:v libx264 -profile:v high -prese6t:v fast -deinterlace -x264opts min-keyint=15:keyint=1000:scenecut=20 -b:v 2000k -c:a aac -b:a 128k -f segment -segment_format mp4 -segment_format_options movflags=empty_moov+frag_keyframe+default_base_moof+skip_trailer+faststart /home/1/output%%05d.mp4

But the following command doesn't work for me and shows error:

Unrecognized option 'prese6t:v'.
Error splitting the argument list: Option not found

Is there any changes since the last FFmpeg? I'm using the latest version.

1

2 Answers

@K7AAY is on the right track. The option label is preset. The output filename mask should be output%05d

But aside from the syntax errors, there are a couple of fundamental issues as well. Fragmented MP4 options are meant for when the segments are packaged within a single container file. The segment muxer emits multiple files so the MP4 muxer fragmentation can be skipped. Also, segment_time should be specified, and with a very low value, else GOPs of size less than the default value (2s) will be combined in some segments.

Command should be

ffmpeg -y -i myVideo.mp4 -vf yadif \ -c:v libx264 -profile:v high -preset:v fast \ -x264opts min-keyint=15:keyint=1000:scenecut=20 -b:v 2000k \ -c:a aac -b:a 128k \ -f segment -segment_format mp4 -segment_time 0.01 -segment_format_options movflags=faststart \ /home/1/output%05d.mp4
4

After replacing prese6t:v
with preset:v
because there's no "prese6t" option for ffmpeg

replace output%%05d.mp4
with output5d.mp4

as ffmpeg is rejecting output%%05d.mp4 as an invalid file name.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy