ExifTool Forum

ExifTool => Newbies => Topic started by: Stramash on February 15, 2024, 10:54:45 AM

Title: Writing the "File Name" into the "Track Name" tag
Post by: Stramash on February 15, 2024, 10:54:45 AM
I have folder with five sub-folders, and each sub-folder contains 10 mkv files. My media player has decided to use the "Track Name" tag from Track 2 of each file for the title displayed in the file browser.

For some reason every one of the files have the value "Surround 5.1" as this "Track Name"

$ exiftool -a Filename\ S02E01.mkv
ExifTool Version Number         : 12.40
File Name                       : Filename S02E01.mkv
Directory                       : .
File Size                       : 1614 MiB
File Modification Date/Time     : 2024:02:15 10:37:10+00:00
File Access Date/Time           : 2024:02:15 14:20:09+00:00
File Inode Change Date/Time     : 2024:02:15 14:20:09+00:00
File Permissions                : -rw-r--r--
File Type                       : MKV
File Type Extension             : mkv
MIME Type                       : video/x-matroska
EBML Version                    : 1
EBML Read Version               : 1
Doc Type                        : matroska
Doc Type Version                : 4
Doc Type Read Version           : 2
Timecode Scale                  : 1 ms
Muxing App                      : libebml v1.4.2 + libmatroska v1.6.4
Writing App                     : mkvmerge v56.1.0 ('My Friend') 64-bit
Duration                        : 0:43:35
Date/Time Original              : 2021:05:19 13:42:53Z
Track Number                    : 1
Track Type                      : Video
Video Codec ID                  : V_MPEGH/ISO/HEVC
Video Frame Rate                : 23.976
Track Language                  : und
Image Width                     : 1920
Image Height                    : 1080
Display Width                   : 1920
Display Height                  : 1080
Track Number                    : 2
Track Type                      : Audio
Audio Codec ID                  : A_EAC3
Default Duration                : 32 ms
Track Name                      : Surround 5.1
Audio Sample Rate               : 48000
Audio Channels                  : 6
Track Number                    : 3
Track Type                      : Subtitle
Track Default                   : No
Codec ID                        : S_HDMV/PGS
Chapter Time Start              : 0 s
Chapter Time End                : 0:01:26
Chapter String                  : Chapter 01
Chapter Time Start              : 0:01:26
Chapter Time End                : 0:07:20
Chapter String                  : Chapter 02
Chapter Time Start              : 0:07:20
Chapter Time End                : 0:15:12
Chapter String                  : Chapter 03
Chapter Time Start              : 0:15:12
Chapter Time End                : 0:22:56
Chapter String                  : Chapter 04
Chapter Time Start              : 0:22:56
Chapter Time End                : 0:32:26
Chapter String                  : Chapter 05
Chapter Time Start              : 0:32:26
Chapter Time End                : 0:39:21
Chapter String                  : Chapter 06
Chapter Time Start              : 0:39:21
Chapter Time End                : 0:42:32
Chapter String                  : Chapter 07
Chapter Time Start              : 0:42:32
Chapter Time End                : 0:43:03
Chapter String                  : Chapter 08
Chapter Time Start              : 0:43:03
Chapter Time End                : 0:43:35
Chapter String                  : Chapter 09
Image Size                      : 1920x1080
Megapixels                      : 2.1

exiftool -G1 -a -s -*track* Filename\ S02E01.mkv
[Track1]        TrackNumber                     : 1
[Track1]        TrackType                       : Video
[Track1]        TrackLanguage                   : und
[Track2]        TrackNumber                     : 2
[Track2]        TrackType                       : Audio
[Track2]        TrackName                       : Surround 5.1
[Track3]        TrackNumber                     : 3
[Track3]        TrackType                       : Subtitle
[Track3]        TrackDefault                    : No

What would the command be to write each filename into the track name tag in one go?
Title: Re: Writing the "File Name" into the "Track Name" tag
Post by: StarGeek on February 15, 2024, 12:48:05 PM
Exiftool cannot edit MKV files.  You'll have to use ffmpeg or MKVToolNix.  I'd suggest the latter, as it has always seemed easier to me. MKVToolNix has a GUI or if you need the command line, you would use its mkvpropedit command.
Title: Re: Writing the "File Name" into the "Track Name" tag
Post by: Stramash on February 15, 2024, 01:39:09 PM
Thank you.