[FFmpeg-user] Extract chapter names to a text file?

Laine llee040 at sbcglobal.net
Mon Dec 5 23:36:11 EET 2022

> This might include the information you want in its output file, but you may need to otherwise process the output to format it as you described.
> (Use “-y” if you don’t mind overwriting “chapters.txt”.)
> ffmpeg -y -loglevel error -i input -f ffmetadata chapters.txt
> L. Lee

If you are able to generate “chapters.txt” but observe an overabundance of information in that file, you might try the options that I used to get just the video title and a list of the chapters.

Download match.pl (it appears in text on the page, just copy it using your browser) from
http://noahdavids.org/self_published/match.html <http://noahdavids.org/self_published/match.html>
and make it executable on your system.

Then run this command:
perl match.pl -match title -file chapters.txt | perl -pe 's/title=//s’

I’m sure there are perl savvy subscribers to this list who know how to yield the same results while bypassing match.pl, but match.pl seemed useful to me.

L. Lee

More information about the ffmpeg-user mailing list