Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 7,439
|
Adding metadata from file into MP4 with ffmpeg
To add metadata from a pre-edited file (or from an export from another file), ffmpeg supports an FFMETADATA file format. This is mainly documented to add chapters to MP4 files.
It should also support adding general, global meta tags, like a file comment and a movie title, despite an existing separate command line parameter. If I am not completely wrong, Code:
-meta comment="This is my movie comment" -meta title="This is the movie title" Code:
-i movie.ffmetadata -map_metadata 1 Code:
;FFMETADATA1 comment=This is my movie comment title=This is the movie title Code:
;FFMETADATA1 [CHAPTER] TIMEBASE=1/1000 START=0 END=10010 title=My first chapter [CHAPTER] TIMEBASE=1/1000 START=10010 END=19186 title=My second chapter Last edited by LigH; 6th July 2025 at 07:30. |
|
|
|
|
|
#2 | Link |
|
Registered User
Join Date: Nov 2022
Location: Aix en Provence, France
Posts: 163
|
Did you try something like that ?
PHP Code:
|
|
|
|
|
|
#3 | Link |
|
Registered User
Join Date: Jul 2015
Posts: 954
|
I think you've already put pressure on the creators. There is some correction, but it doesn't add much.
https://github.com/FFmpeg/FFmpeg/com...038675fd0f5711 You should not use ffmetadata because there are errors. I also don't know what the message in MediaInfo means Error Detection Type : Per level 1 Metadata information in ffmpeg is treated modestly. Each container has different metadata and I don't even know if there are limits to the size of info in comments. What about track title information? There isn't. Each track or metadata can have a separate title without the possibility of opening links. In matroska containers, comment titles can be multilingual. |
|
|
|
|
|
#4 | Link |
|
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 7,439
|
@Kurt.noise: Exactly like this. Just fewer empty lines in between. Chapters were generated by chapterEditor 1.45, general tags added manually.
@Jamaika: I did not mention it to the ffmpeg issue tracker yet. And I need the preparation of a file to be able to use the same call in a batch for different movies. |
|
|
|
|
|
#5 | Link |
|
Registered User
Join Date: Jul 2015
Posts: 954
|
If you're going to add error information, ask why double chapter menus are created for mp4.
ffmpeg_avx2.exe -i 111.hevc -i 111.aac -i 111.txt -map_metadata 1 -c copy 111.mp4 Code:
Menu #1 ID : 3 Codec ID : text Duration : 25 min 5 s Language : English Menu For : 1,2 XX:XX:XX.XXX :xxxx ... Bit rate mode : VBR Menu #2 XX:XX:XX.XXX :xxxx ... Last edited by Jamaika; 6th July 2025 at 07:18. |
|
|
|
|
|
#6 | Link |
|
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 7,439
|
ffmpeg ticket #11660 created.
|
|
|
|
|
|
#7 | Link |
|
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 7,439
|
I will use MP4Box instead; it supports chapters and tags in UTF-8 text files while multiplexing.
MP4Box -add video.m4v -add audio.m4a -chap chapters.ogm.txt -itags tags.ini.txt movie.mp4 Chapters in OGM Chapters format (CHAPTER01=HH:MM:SS.XXX\nCHAPTER01NAME=Name), iTunes compatible tags in name=value pairs (similar to Windows INI) @Jamaika: And it inserts the chapters only once. Last edited by LigH; 12th July 2025 at 20:02. |
|
|
|
|
|
#10 | Link | |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,409
|
any good,
https://superuser.com/questions/9962...ile-to-another More results from SuperUser.com Code:
ffmpeg "-map_metadata" site:superuser.com EDIT: https://ffmpeg.org/ffmpeg.html#Advanced-options About 75% down the page. [EDIT: about 1 or two screens past where above link enters] Quote:
https://stackoverflow.com/questions/...adata-copy-all EDIT: Code:
ffmpeg "-map_metadata" site:stackoverflow.com
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 14th July 2025 at 20:26. |
|
|
|
|
|
|
#11 | Link |
|
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 7,439
|
I did find the chapter in the official ffmpeg documentation. And I see no explanation of the meaning of a "1" or "2" there.
In other articles, which are no official documentation I hoped for, I even read about the existence of a "-1". So, apparently, third-party talks about that topic are the only reliable reference... |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|