Tuesday, 3 September 2019

how to save custom data into header in movie file using ffmpeg?


I was looking for saving custom data into movie file using ffmpeg mainly actual start frame, end frame, and other few information something like key:value pair, so later on I can fetch the details from movie file on the go.


I looked all over but couldn't figure out myself. Is there anyway to do that?



Answer



You don't mention which container format you want this facility for, since some don't allow custom tags.


FFmpeg's Matroska muxer allows random tags, so


ffmpeg -i input -c copy
-metadata key1=value1
-metadata:s:v key2=value2
-metadata:s:a:0 key3=value3
out.mkv

The first metadata options set a global value, the 2nd is applied to all video streams, and the third to the 1st audio stream only.


Mediainfo and ffprobe can show these values.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...