Splitting a video file according to black frames

Questions involving a Windows version of FFmpeg.
Post Reply
Posts: 1
Joined: Tue Jul 02, 2019 9:59 am

Splitting a video file according to black frames

Post by GalKol » Tue Jul 02, 2019 10:07 am

So I have a large video file, which consists of many short video clips, with a long black screen break between each clip.
I'd like to use FFMpeg to split this file into multiple individual clips, while discarding the black screen parts.

Is that possible?
I've tried the "black detect" filter but I don't know how to set up the output.
Keep in mind I'm very knew to FFMpeg and don't know much about it.

Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: Splitting a video file according to black frames

Post by pandy » Mon Jul 15, 2019 5:04 pm

I think this is not easy task, you can save list of black frames but still splitting file will not work if split point belongs to non IDR (I) frame, also closed GOP is almost mandatory to nicely cut video at IDR frame.
You may need to navigate to IDR following your cut and cut video at this point and later re-encode last GOP.
Once again ffmpeg seem to be not best tool for such tasks.
On videohelp there is nice thread related to all ffmpeg quirks related to stream cut.
Search for Budman1
https://forum.videohelp.com/threads/393 ... irst-frame
https://forum.videohelp.com/threads/393 ... ost2551249

Post Reply