#1 2022-02-20 06:32

Bingman
Member
Registered: 2021-06-21
Posts: 14

Can someone help? About ReNamer Scripts MediaInfo

I use this script, but it dosen't work
ReNamer:Scripts:MediaInfo
http://www.den4b.com/wiki/ReNamer:Scripts:MediaInfo
I have downloaded and installed MediaInfo CLI
20220220132426.png

Offline

#2 2022-02-20 10:35

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Can someone help? About ReNamer Scripts MediaInfo

Open a command line box (cmd.exe) in the folder with your MP4 and test if they contain any info


MediaInfo.exe --output=General;%Encoded_Date% "here your.mp4"

Possible output:
UTC 2011-05-23 12:51:14


What do you get?


Try MediaInfo.exe  "here your.mp4" to see all media info from your file




 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2022-02-20 11:04

Bingman
Member
Registered: 2021-06-21
Posts: 14

Re: Can someone help? About ReNamer Scripts MediaInfo

Stefan wrote:

Open a command line box (cmd.exe) in the folder with your MP4 and test if they contain any info


MediaInfo.exe --output=General;%Encoded_Date% "here your.mp4"

Possible output:
UTC 2011-05-23 12:51:14


What do you get?


Try MediaInfo.exe  "here your.mp4" to see all media info from your file

It can output mediainfo

D:\>MediaInfo.exe --output=General;%Encoded_Date% VID_20201215_102625.mp4
UTC 2020-12-15 02:26:30

20220220175705.png

Last edited by Bingman (2022-02-20 11:10)

Offline

#4 2022-02-20 11:50

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Can someone help? About ReNamer Scripts MediaInfo

Fine.
For me it works. I get the date extracted. (with included invalid chars, but ok so far)
Which version of ReNamer do you use?
Is the path to MediaInfo.exe correct in your script? 




 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#5 2022-02-20 12:08

Bingman
Member
Registered: 2021-06-21
Posts: 14

Re: Can someone help? About ReNamer Scripts MediaInfo

version 7.3
I only change the path of  MediaInfoCLI executable in this script, other code is completely copied into the script.
QQ20220220190426.png

{ Extract media meta information using MediaInfo CLI }

const
  MediaInfoExe = 'D:\MediaInfoCLI\MediaInfo.exe';
  OutputParameter = 'General;%Encoded_Date%';

var
  Command: WideString;
  Output: String;

begin
  Command :=
    '"' + MediaInfoExe + '"' +
    ' --output="' + OutputParameter + '"' +
    ' "' + FilePath + '"';
  if ExecConsoleApp(Command, Output) = 0 then
    FileName := WideTrim(OemToWide(Output)) + WideExtractFileExt(FilePath);
end.

Offline

#6 2022-02-20 12:14

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Can someone help? About ReNamer Scripts MediaInfo

OK.
There was an underscore in the mediainfo folder name, but now you have sorted that out?



I run out of ideas.
Maybe change OemToWide to OemToAnsi?



 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#7 2022-02-20 14:25

Bingman
Member
Registered: 2021-06-21
Posts: 14

Re: Can someone help? About ReNamer Scripts MediaInfo

I changed the folder name, removed the underscore, it didn't work too.

Ah, I got it. My Video file path contains Chinese characters.

And I have a question, how can i change the UTC time to my time zone?

QQ20220220222000.png

Last edited by Bingman (2022-02-20 15:24)

Offline

#8 2022-02-20 18:54

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Can someone help? About ReNamer Scripts MediaInfo

Bingman wrote:

And I have a question, how can i change the UTC time to my time zone?


I don't know because I don't use that.

Probably with an second rule "ReformatDate" afterwards
https://www.den4b.com/wiki/ReNamer:Rules:ReformatDate

?




 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#9 2022-02-21 03:52

Bingman
Member
Registered: 2021-06-21
Posts: 14

Re: Can someone help? About ReNamer Scripts MediaInfo

Thanks a lot, I'll look into it again.

Also I Want to know how to make MediaInfoCLI recognize Chinese characters, @den4b

Below is a method of adjusting the time zone.

Thank you, Administrator den4b

http://www.den4b.com/forum/viewtopic.ph … 922#p11922

den4b wrote:

You can adjust the date format and add an hour using the Reformat Date rule, as follows:

> Convert to "yyyymmdd_hh-nn-ss" from "yyyy-mm-dd hh:nn:ss", whole words only, skip extension, adjust time by 1 hour.

Then, you'll just need to remove the "UTC" prefix with a separate rule.

Last edited by Bingman (2022-02-21 05:48)

Offline

#10 2022-02-21 16:43

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: Can someone help? About ReNamer Scripts MediaInfo

Bingman wrote:

I Want to know how to make MediaInfoCLI recognize Chinese characters

Extracting Unicode content via the Windows command line interface is problematic, if not impossible in some cases. You can also find a similar statement on the MediaInfo website: https://mediaarea.net/en/MediaInfo/Supp … rt#Unicode

However, MediaInfo has command line options for saving the output to a file, with full Unicode support. I think it should be the "--LogFile" option, but you might want to check all available options via "MediaInfo --Help".

If you can provide a sample file, I can give it a try.

Offline

Board footer

Powered by FluxBB