I'm trying to detect scenes and save them as individual files with FFmpeg. I found this long command somewhere, but it fails with a good detection. I change the scenecut value, but I don't see any effects.

ffmpeg -y -i test.mp4 -max_muxing_queue_size 1024 -vf yadif -preset:v fast -x264opts scenecut=20 -f segment -segment_format mp4 -segment_format_options movflags=faststart %05d.mp4

Is there a better command than this? There should be a shorter, more efficient command I guess.


Using the encoder's scenecut to detect scenes is not advisable, since its purpose is efficient GOP splitting taking into account other encoding parameters. It is not a "pure" scene detector. Its propensity to mark a "scene change" increases as it gets closer to the the next forced keyframe target (set by keyint).

Consider using https://github.com/Breakthrough/PySceneDetect instead.

  • Yes I was using that library before. But much slower than ffmpeg. So was looking for a ffmpeg-based solution. – Tina J Oct 2 at 15:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.