Problems with modifying encoder metadata with FFMPEG
Asked Answered
J

1

1

I'm trying to change FFMPEG encoder writing application with FFMPEG -metadata and for whatever reason, it's reading the input but not actually writing anything out.

-map_metadata -metadata:s:v:0 -metadata writing_application, basically every single stack overflow and stack exchange thread, but they all won't write to the file at all.

ffmpeg -i x.mp4 -s 1920x1080 -r 59.94 -c:v h264_nvenc -b:v 6000k -vf yadif=1 -preset fast -fflags +bitexact -flags:v +bitexact -flags:a +bitexact -ac 2 x.mp4
ffmpeg -i x.mp4 -c:v copy -c:a copy -metadata Encoder="TeXT Encoder" -fflags +bitexact -flags:v +bitexact -flags:a +bitexact test.mp4
ffmpeg -i x.mp4 -vcodec copy -acodec copy -map_metadata out.mp4
ffmpeg -i x.mp4 -vcodec copy -acodec copy -metadata encoder="Encoder" -metadata comment="XX" testmeta.mp4
ffmpeg -i x.ts -c:v copy -c:a copy -metadata:s:v:0 h264 ISFT='TeXT' x.mp4
ffmpeg -i x.mp4 -i FFMETADATAFILE -map_metadata 1 -codec copy testcopy.mp4
ffmpeg -i x.ts -f ffmetadata FF

METADATAFILE

I tried to extracting the data and rewrite it back with FFMETADATAFILE but it doesn't show up. Tried forcing ffmpeg to write without any emtadata and write it back but doesn't work. Was wondering if I can write my own encoder that writes the specific encoder name, like how Handbrake/Lavf writes the encoder application into the METADATA of the video file. Or just use FFMPEG and modify the METADATA natively.

Jell answered 8/8, 2019 at 15:16 Comment(0)
B
4

To set the writing application (mediainfo) or encoder (ffmpeg) for MP4s, use

ffmpeg -i input {-encoding parameters} -metadata:g encoding_tool=myapp out.mp4
Breault answered 8/8, 2019 at 17:38 Comment(4)
Oh my gosh, thank you, I was struggling so hard with this for a few days now. Thanks for the help!Jell
For those wanting more info the :g suffix is the metadata_specifier - details for this are in the -map_metadata docsSuffice
Thanks a lot for encoding_tool value!Threshold
Didn't work, ffmpeg version 4.4-6ubuntu5 :-(Rollin

© 2022 - 2024 — McMap. All rights reserved.