1

I would be so glad to have some help with this.

I have video rushes in this form : black > sequence > black > sequence...

I need the start/end timecodes of each sequences (no black) to create segments on another software so I wondering if it's possible with the blackdetect filter of FFmpeg to output only the sequences data in a csv file. No problem with the simple command line to have the blacks but I'm still at this point with unsuccess others test.

The goal is automate this for multiple files by import the csv in a RPA.

Thank you very much.

Soapa Tune
  • 11
  • 1

1 Answers1

0

You cannot do that with ffmpeg by itself, but with a bit of help from a script (i.e., Python) you can decode the frame metadata. The following filtergraph outputs the black detect output to stdout:

ffmpeg -i input -vf blackdetect,metadata=print:file=- -f null dev/null`

Your script shall capture the pipe output, and parse the output to retrieve the pts and detect either black_start and black_end and reformat and output to a csv file.

If your other program is flexible, you can alternately specify output file name file=xxx and do the parsing there.

kesh
  • 4,515
  • 2
  • 12
  • 20