-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata preservation #1027
Comments
exiftool will also show the track name, which is displayed by many players. Track names would be very useful to be displayed and preserved. There was an issue that was closed, but it was only a workaround for the user. Support for track name metadata would still be nice to have. example mp4 with 3 audio tracks.
ffprobe does not show the track names:
|
track title can be set with ffmpeg. but strangely, I also couldn't find a way to read it with ff tools |
Anyone tried ffmpeg 6 yet? Maybe it's got improvements for this |
I made some research, and as i can tell you ffmpeg does by default set all handler names to To prevent this behaviour you have to tell ffmpeg to use a different sound handler name. The best is to use a empty name, which keeps the default/normal stream names intact So in full: |
+1 for Exiftool. I can confirm that the current process fails to transfer GPS data, and that Exiftool does so successfully. (Specifically, it preserves the If you do use Exiftool you'll probably want to add the |
There have been many requests for preserving metadata, or some metadata getting lost when exporting. In my experience it seems to happen more often in older or more obscure codecs. Some related issues:
Although it seems there is no silver bullet, I will gather and summarise challenges and possible options here.
Default
ffmpeg -i mp4 -c copy out.mp4
This seems to copy only some metadata, like some timestamps (both global and per-track).
ffmpeg
-map_metadata X
Where X is the file input index. Typically
-map_metadata 0
for mapping metadata from the first input to the output.LosslessCut uses this by default when cutting (also for merge, but only if
keep original metadata when merging
is enabled).ffmpeg
-movflags use_metadata_tags
If you enable the
Preserve all MP4/MOV metadata
, it will use this flag. This flag will make ffmpeg copy additional tags (for MOV/MP4 only). However it will copy them into a different location than the source file. Example tag shown inexiftool
:MOV-Movie-UserData-Meta-ItemList:Comment: Test Comment
MOV-Movie-UserData-Meta-Keys:Comment: Test Comment
MOV-Movie-UserData-Meta-ItemList-iTunesInfo:CUSTOM1: Old File Name
MOV-Movie-UserData-Meta-Keys:CUSTOM1: Old File Name
See #853 (comment)
Problems:
Copy tags with
exiftool
See branch https://github.com/mifi/lossless-cut/tree/exiftool-integration
Although not yet implemented in LosslessCut (feb 2022), this command will copy some more useful metadata than
-movflags use_metadata_tags
, for example:MOV-Movie-Track-SphericalVideoXML:ProjectionType: equirectangular
), see Trimming VIRB360 video loses the projection information #169 (comment) works in VLC after copy.MOV-Movie-UserData-Meta-ItemList:Comment: Test Comment
), see Metadata inconsistency and request #853 (comment)However,
exiftool
will also skip some tags thatffmpeg -movflags use_metadata_tags
will copy:MOV-Movie-UserData-Meta-ItemList-iTunesInfo:CUSTOM1: Old File Name
- completely dropped, see Metadata inconsistency and request #853 (comment)Here is the command:
Exiftool can also give other benefits:
See also #2096
The text was updated successfully, but these errors were encountered: