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.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th June 2016, 06:04   #1  |  Link
unknownsoldierX
Registered User
 
Join Date: Jun 2005
Posts: 236
Command line tool to remove MP4 tags without rewriting the whole file?

I have a batch file that runs TheRenamer to add files to my media library. I have a bunch of DLNA devices in the house and they will read the tags from a file and display the title instead of the file name. The tags are always unsuitable for my library, and I don't actually want or need tags, so I remove them all to simplify things.

FFMPEG makes it easy to remove the tags, but it has to rewrite the file. It takes too much time, and I don't like having so many extra writes to my HDD.

For now I have been keeping an eye out for tagged files and removing the tags using Windows Explorer, which removes the tags instantly without writing the whole file.

If I have a bunch of files, I'll use MP3tag, but it's slow, so I think it rewrites files at least some of the time.

Is there a command line tool that can scan all files in a folder and quickly remove tags, without rewriting the files? I'd like to get this process of removing tags automated.
unknownsoldierX is offline   Reply With Quote
Old 12th June 2016, 07:45   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
See here:- https://www.google.com/?gfe_rd=cr&ei...+remover+batch

If Mp3Tag is sometimes not rewriting entire file, and sometimes is, then there is probably a reason for the 'sometimes is'.

EDIT: Of perhaps better list:- https://www.google.com/?gfe_rd=cr&ei...ip+batch+-HTML
__________________
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; 12th June 2016 at 08:15.
StainlessS is offline   Reply With Quote
Old 13th June 2016, 01:16   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
Where'd your thread at VideoHelp go? I'm sure I didn't dream writing a fairly lengthy reply yesterday, and I'm sure at that stage you said you had Mp3Tag, but hadn't worked out how to use it to batch remove tags from MP4s. It's easily done.

I tested a 1.3GB MP4 with Mp3Tag. It had no tags. The first time I added a tag it took around 25 seconds, so it was obviously optimising the MP4 in the process (re-writing it). After it was done, deleting the tag and creating a new one was very fast, so I guess Mp3Tag only re-writes when necessary, but there appears not to be an option to prevent it from doing so. As best as I can tell Mp3Tag does also automatically optimise an MP4 when deleting tags if it's not already optimised.

I asked Google what optimising an MP4 does. I found this:
http://linux.die.net/man/3/mp4optimize
MP4Optimize reads an existing mp4 file and writes a new version of the file with the two important changes:
First, the mp4 control information is moved to the beginning of the file. (Frequently it is at the end of the file due to it being constantly modified as track samples are added to an mp4 file.) This optimisation is useful in that in allows the mp4 file to be HTTP streamed.
Second, the track samples are interleaved so that the samples for a particular instant in time are colocated within the file. This eliminates disk seeks during playback of the file which results in better performance.


Anyone know if Mp3Tag performs the "interleaving" part of MP4 file optimising, given it's primarily designed for tagging audio files?

I'm pretty sure foobar2000 automatically optimises MP4s and the QAAC encoder requires --no-optimize in the command line to prevent it optimising them after encoding, so I suspect it's not a bad idea. There's a few other bulk tagging programs out there that'll tag MP4s. One of them may not automatically optimise but I've not used anything other than Mp3Tag in a long time myself.

I wonder if that's why ffmpeg re-writes MP4s or of it's just re-writing them to create a tag-free version?
(Edit: As a test I remuxed two MP4s with ffmpeg. One known to be optimised and another known not to be. When I opened each of the output files with Mp3Tag, it felt obliged to optimise both)

Last edited by hello_hello; 13th June 2016 at 01:46.
hello_hello is offline   Reply With Quote
Old 13th June 2016, 01:45   #4  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Quote:
Originally Posted by hello_hello View Post
(Edit: As a test I remuxed two MP4s with ffmpeg. One known to be optimised and another known not to be. When I opened each of the output files with Mp3Tag, it felt obliged to optimise both)
Have you tried -movflags faststart (it's supposed to work for MOV and MP4)
raffriff42 is offline   Reply With Quote
Old 13th June 2016, 03:30   #5  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
Quote:
Originally Posted by raffriff42 View Post
Have you tried -movflags faststart (it's supposed to work for MOV and MP4)
I'll gave your suggestion a try, adding -report to the command-line too. No complaints in the ffmpeg log file and I used an MP4 with existing tags for testing. Going with the assumption that worked as expected.....

I opened the output MP4 with Mp3Tag and deleted the tag. Mp3Tag deleted it very quickly. However when I right clicked and used the "optimise MP4" option, Mp3Tag spent a bit of time re-writing the MP4. This leads me to tentatively conclude that if the tags are at the beginning of the file, MP3Tag will delete them without any further optimising. If they're not, it'll optimise when it deletes them. It was still willing to optimise the MP4 ffmpeg created after deleting the tags though, so I suspect Mp3Tag must also apply the "interleaving" optimisation when it optimises. Once I'd deleted the tags and optimised, it wouldn't optimise again.

Anyone know how to determine of an MP4 is interleaved?

Last edited by hello_hello; 13th June 2016 at 03:33.
hello_hello is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.