Rename title metadata the same as file name for .mp4 in current & sub DIRs

Started by skylinekiller, April 21, 2023, 01:35:47 PM

Previous topic - Next topic

skylinekiller

Hello,
I am new to Exiftool, as I usually use MKV toolnix.  I wanted to know the correct feature within Exiftool and code to Rename all the .mp4 metadata title fields to the actual file name for the current and subdirectories.  I searched the forum, and was surprised I couldn't find anything that matches my request.  Is this not possible?

StarGeek

Assuming you want the base filename and don't want to include the extension in the title, your command would be
exiftool -r "-Title<BaseName" /path/to/files/

The Basename tag requires version 12.22 or greater.  The -r (-recurse) option recurses into subdirectories.

This command creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  If you have mixed files and want to process only the MP4 files, add the -ext (-extension) option with -ext mp4. If you wish to preserve the files system modify date, add the -P (-preserve) option.

If you want to include the extension in the Title change Basename to Filename.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

skylinekiller

StarGeek,
Thank you for the thorough response.  For clarity, if I wanted to
1) keep the base filename
2) Not to include the extension
3) No Backup files created
4) only do .mp4 tensions
5) preserve the files system and modify dates

Would this be my code?

exiftool -r "-Title<BaseName" /path/to/files/-Overwrite_Original -ext -mp4 -P
Additionally, is it common for some m videos to have playback issues after renaming with this app or is it a rare occurrence?

StarGeek

No, you didn't copy the -ext option I listed.  You added a dash in front of mp4.  You also need a space in between files/ and -Overwrite_Original.

exiftool -r "-Title<BaseName" -Overwrite_Original -ext mp4 -P /path/to/files/

The file path can go just about anywhere in the command, but I find it a good habit to put it at the end.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

skylinekiller

Thank you, it worked like a charm, but I did encounter a few errors.  Is there a way to solve the large file errors?  I had them copied, but I deleted the file.  One error was Large file size was disabled.  I had several of those errors, most with files over 4GB, but a few were under.  Oddly enough, some over 4GB were able to edit just fine.  There was one error with a "1 bit missing"  or something of that nature.  I could rename all manually, but I was curious to add a portion to the code to write the large files too.

Not bad overall, Over 2500 files and 25 errors, though I was surprised how slow it was; the MKVtoolnix writes metadata so much quicker.  It took an entire day to go though my library.  If possible, what would my code look like to enable the large files?

StarGeek

Quote from: skylinekiller on April 25, 2023, 08:33:18 PMIs there a way to solve the large file errors?

Add the -api LargeFileSupport option.

QuoteThere was one error with a "1 bit missing"  or something of that nature.

I don't know about that one, never seen it before.  It helps to know the exact error message.

Quotethough I was surprised how slow it was;

Exiftool rewrites the entire file, so editing should be the same speed as copying.  See FAQ #31.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

skylinekiller

Thank you very much.  The additional command worked like a charm.  How do I close this topics as SOLVED?

Phil Harvey

That's good.  Topics don't have a "solved" flag in this forum.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).