Setting "Track 2 Name" tag in MP4 file (ie. tag with spaes)

Started by wsherman, November 05, 2020, 02:44:19 PM

Previous topic - Next topic

wsherman

Hello,

I am trying to use "exiftool" to modify a tag in an MP4 video file.

The tag in question ("Track 2 Name") has spaces in it, so I wonder if that may be
the root of my problem.

So I have a video file that has multiple audio tracks, two of which are just named "Mono".
I'd like to indicated that one is "Mono (AAC)" and the other is "Mono (AC3)".  So I'm
trying to use "exiftool" to correct those.

Here are the two ways I've tried to make the alteration:
    % exiftool "-Track  3 Name"="Mono (AAC)" testvideo.m4v
    % exiftool -Track\ 3\ Name="Mono (AAC)" testvideo.m4v

I've tested with both exiftool version 11.88 & 12.09.

The result is that a new tag is created that is just "Track", and that has the newly
assigned value of "Mono (AAC)", and the original "Track 3 Name" tag is unchanged.

Another side effect is that the two tags (or metadata) for "Media Data Size" and
"Media Data Offset" are moved toward the bottom of the metadata output from
an "exiftool" metadata dump, following the new "Track" tag, and preceeding
the four trailing metadata info of "Image Size", "Megapixels", "Avg Bitrate", and
"Rotation".

I do find that if I try to just get the value of the "Track 3 Name" tag, then it reports
an "Invalid TAG name".  But if I search for "-Track*" tags, then it finds it and
reports it.

I'm not sure whether I'm doing something wrong; this isn't possible; or it's a bug
of exiftool.

    Thanks,
    Bill

StarGeek

Quote from: wsherman on November 05, 2020, 02:44:19 PM
The tag in question ("Track 2 Name") has spaces in it, so I wonder if that may be
the root of my problem.

That's not a tag name, that's a tag description.  See FAQ #2.

I think I know what tag you're looking for, but I'll be damned if I can find one of my files that has it.  I think it's the Language entry displayed by FFmpeg.  If if so, then it's not something exiftool can change.

What is the output of
exiftool -g1 -a -s -Track* file.mp4
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

StarGeek

Finally found some files deep within my Steam library.

The Track#Name tags are not editable by exiftool.  It may not be editable at all, as I'm looking at the files with FFProbe and getting conflicting results.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

wsherman

Hi StarGeek:

Well, maybe this information is moot, but to answer your first question:

% exiftool "-Track*" testkane3.m4v
Track Header Version            : 0
Track Create Date               : 2020:11:05 04:56:45
Track Modify Date               : 2020:11:05 04:56:45
Track ID                        : 1
Track Duration                  : 1:59:27
Track Layer                     : 0
Track Volume                    : 0.00%
Track 2 Name                    : Mono
Track 3 Name                    : Mono
Track 4 Name                    : Commentary with Peter Bogdonovish
Track 5 Name                    : Commentary with Roger Ebert
Track 6 Name                    : Closed Caption
Track                           : Mono (AAC)


As you can see, this is after I unintentionally added the "Track" tag.
   Thanks,
   Bill

wsherman

Hello again,

Sorry, I realized that I didn't use all the requested options:

% exiftool -g1 -a -s "-Track*" testkane3.m4v
---- Track1 ----
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:11:05 04:56:45
TrackModifyDate                 : 2020:11:05 04:56:45
TrackID                         : 1
TrackDuration                   : 1:59:27
TrackLayer                      : 0
TrackVolume                     : 0.00%
---- Track2 ----
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:11:05 04:56:45
TrackModifyDate                 : 2020:11:05 04:56:45
TrackID                         : 2
TrackDuration                   : 1:59:26
TrackLayer                      : 0
TrackVolume                     : 100.00%
Track2Name                      : Mono
---- Track3 ----
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:11:05 04:56:45
TrackModifyDate                 : 2020:11:05 04:56:45
TrackID                         : 3
TrackDuration                   : 1:59:26
TrackLayer                      : 0
TrackVolume                     : 100.00%
Track3Name                      : Mono
---- Track4 ----
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:11:05 04:56:45
TrackModifyDate                 : 2020:11:05 04:56:45
TrackID                         : 4
TrackDuration                   : 1:59:28
TrackLayer                      : 0
TrackVolume                     : 100.00%
Track4Name                      : Commentary with Peter Bogdonovish
---- Track5 ----
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:11:05 04:56:45
TrackModifyDate                 : 2020:11:05 04:56:45
TrackID                         : 5
TrackDuration                   : 1:59:27
TrackLayer                      : 0
TrackVolume                     : 100.00%
Track5Name                      : Commentary with Roger Ebert
---- Track6 ----
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:11:05 04:56:45
TrackModifyDate                 : 2020:11:05 04:56:45
TrackID                         : 6
TrackDuration                   : 1:59:08
TrackLayer                      : 0
TrackVolume                     : 0.00%
Track6Name                      : Closed Caption
---- Track7 ----
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:11:05 04:56:45
TrackModifyDate                 : 2020:11:05 04:56:45
TrackID                         : 7
TrackDuration                   : 1:59:27
TrackLayer                      : 0
TrackVolume                     : 0.00%
---- ItemList ----
Track                           : Mono (AAC)


Hmmm, so it does look like the new "Track" thing is under "ItemList".

I would still wonder though: I'm trying to set a tag "Track 3 Name" (or "Track 2 Name"
as I now realize I titled my post), which has spaces in it, and maybe that's not allows
in tags, though I was thinking that "Track 3 Name" was a tag name.

    Thanks again,
    Bill


StarGeek

You forgot to include the options I listed.  But as you say, it's a moot point, as exiftool can't edit these tags.

But I tried again and looked at my file (which has track names "Stereo" and "Surround") with MediaInfo and it listed those values under "Title" for each track.  Some more digging and I found this SuperUser answer to use FFmpeg to change the values. 

So your best bet is to look at that SuperUser answer and try FFmpeg to edit the data.

Quote from: wsherman on November 05, 2020, 07:21:54 PMI would still wonder though: I'm trying to set a tag "Track 3 Name" (or "Track 2 Name" as I now realize I titled my post), which has spaces in it, and maybe that's not allows
in tags, though I was thinking that "Track 3 Name" was a tag name.

See the FAQ I posted above.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

wsherman

Hello again,

Yes, I guess my corrected posting came after you were already responding!

Anyway, thanks for the info and the pointers, I'll check out SuperUser.  I've used
ffprobe to extract chapter names and other meta data in the past, so I have it
handy.

Quote from: StarGeek on November 05, 2020, 07:34:34 PM
You forgot to include the options I listed.  But as you say, it's a moot point, as exiftool can't edit these tags.

But I tried again and looked at my file (which has track names "Stereo" and "Surround") with MediaInfo and it listed those values under "Title" for each track.  Some more digging and I found this SuperUser answer to use FFmpeg to change the values. 

So your best bet is to look at that SuperUser answer and try FFmpeg to edit the data.

Quote from: wsherman on November 05, 2020, 07:21:54 PMI would still wonder though: I'm trying to set a tag "Track 3 Name" (or "Track 2 Name" as I now realize I titled my post), which has spaces in it, and maybe that's not allows
in tags, though I was thinking that "Track 3 Name" was a tag name.

See the FAQ I posted above.

   Thank you once again for the help/info/advice,
   Bill