Replace MP4 Meta Tags?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
mrbosco
Posts: 125
Joined: 03 Sep 2011 09:40

Replace MP4 Meta Tags?

Post by mrbosco »

If I have a movie file in mp4 format I can go to properties...details...title and change whatever is there to the filename of the movie.
Is there anyway to automate this with a script?
Thanks.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Replace MP4 Meta Tags?

Post by bdeshi »

select the movie file, paste this code into the addressbar and press ENTER.[code]::$title = property('System.Title', <curitem>); if ($prop) {renameitem($prop, <curitem>, 1);};[/code]I got it the other way around. You want to put the filename as the title.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

mrbosco
Posts: 125
Joined: 03 Sep 2011 09:40

Re: Replace MP4 Meta Tags?

Post by mrbosco »

Exactly.

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Replace MP4 Meta Tags?

Post by admin »

Check out scripting command id3tag().

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Replace MP4 Meta Tags?

Post by highend »

for .mp4 video files?
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Replace MP4 Meta Tags?

Post by admin »

Help:
"Works with all files that support ID3v1 tags, e.g. MP3, MP4, M4A. "

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Replace MP4 Meta Tags?

Post by highend »

But this is not about standard id3 tags

What he wants to change is this title:
properties.png
properties.png (14.69 KiB) Viewed 3360 times
IPropertyStorage is the keyword here
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Replace MP4 Meta Tags?

Post by admin »

Oh, sorry. No, that's not supported.

mrbosco
Posts: 125
Joined: 03 Sep 2011 09:40

Re: Replace MP4 Meta Tags?

Post by mrbosco »

Is it possible to add it to a wish list of future features?

admin
Site Admin
Posts: 60558
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Replace MP4 Meta Tags?

Post by admin »

Hmm, this is really from the dark side of Windows, I would guess the Office people are responsible for it. So, I will probably always find something better to do than torture myself with this horrific interface.

mrbosco
Posts: 125
Joined: 03 Sep 2011 09:40

Re: Replace MP4 Meta Tags?

Post by mrbosco »

OK, thanks anyway.
The reason I'm trying to do this is Plex Media player uses these fields (if present) over the actual filename for its scanner.
So if there's garbage in these fields, Plex screws up. There really should be a way of telling plex to ignore these fields but I can't seem to find one.
Thought if XYPlorer gave me an easy way to populate the fields or blank them out that would solve my problem.

Thanks for your help and the timely responses.
:-)

totmad1
Posts: 131
Joined: 24 Jun 2013 12:37

Re: Replace MP4 Meta Tags?

Post by totmad1 »

You can automate by using ffmpeg.It achieves this by "remuxing" i.e. copying while putting in the metadata.

Code: Select all

     $ffmpeg="%porta%\ffmpeg\bin\ffmpeg.exe";
     $genre="Action";
         $SelectedItems = get("SelectedItemsPathNames","|");
         foreach($Item, $SelectedItems,"|") {
             $base= gpc("$Item", "base");
             $path= gpc("$Item", "path");
             $ext= gpc("$Item", "ext");
             $cmdline = <<<CMD_LINE
cmd /c ""$ffmpeg" -i "$Item" -metadata title="$base" -metadata genre="$genre" -acodec copy -vcodec copy "$path\ $base _NEW.$ext""
CMD_LINE;
             $cmdline = Replace($cmdline, "<crlf>", ' ');
             Run($cmdline, , 0, 0);
             wait 500;
         }
In this case it puts "Action" as Genre.
totmad1 (totally mad one)

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Replace MP4 Meta Tags?

Post by highend »

I just stumbled upon "prop": https://prop.codeplex.com/releases/view/11675

The Vista version still works fine on Windows 10.

To set a title you have to use:
prop.exe set "<full path to file>" System.Title="<base name of your file>"

Only 105 KB large^^

Code: Select all

    $prop = "D:\Tools\@Command Line Tools\prop\Vista\prop.exe";
    foreach($item, <get SelectedItemsPathNames |>, , "e") {
        if (gpc($item, "ext") != "mp4") { continue; }
        $baseName = gpc($item, "base");
        runret("""$prop"" set ""$item"" System.Title=""$baseName""");
        status "Setting base name for '" . gettoken($item, -1, "\") . "'";
    }
One of my scripts helped you out? Please donate via Paypal

Post Reply