#1 2022-08-22 14:30

Damien
Member
Registered: 2022-08-22
Posts: 2

Append resolution width to mp4 video filename?

Hi is there a way to append the resolution of a mp4 file to the filename eg: 1080p I have a collection of mp4 video file and would like to be able to see there resolution easily.

Thanks.

Offline

#2 2022-08-24 13:21

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

Re: Append resolution width to mp4 video filename?

Damien wrote:

Hi is there a way to append the resolution of a mp4 file to the filename eg: 1080p

I don't know.

But could be a part of the "Meta_Tags" ?


Try that out >>> https://www.den4b.com/wiki/ReNamer:Meta_Tags

together with e.g. >>> https://www.den4b.com/wiki/ReNamer:Rules:Insert





If that doesn't help, try an external tool like MediaInfo or perhaps exiv2.exe
See >>> https://www.den4b.com/forum/viewtopic.p … 526#p11526




HTH?


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-08-26 09:31

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

Re: Append resolution width to mp4 video filename?

You can use the MediaInfo script with slight modifications.

The script below will append the width of the video in pixels to the end of the filename, e.g. "Movie Name 1080p.mp4".

You will need to install the MediaInfo CLI tool, as per instructions, and update the path to it in the script.

const
  MediaInfoExe = 'C:\Tools\MediaInfoCLI\MediaInfo.exe';
  OutputParameter = 'Video;%Width%';

var
  Command: WideString;
  Output: String;

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

Offline

#4 Yesterday 21:32

AndrewRH
Member
Registered: 2012-02-20
Posts: 9

Re: Append resolution width to mp4 video filename?

I'm hoping to rename a video file so it comes out in this kind of format:
"date-time_application [height framerate bitdepth].mp4"

Is there a way to combine into one 'OutputParameter' the info about the encoding date and writing application, along with the video characteristics?

That is, these fields:
General;%Encoded_Date% %Encoded Application%
and
Video;%Height% %FrameRate% %BitDepth%

Thanks.

Offline

#5 Yesterday 23:27

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

Re: Append resolution width to mp4 video filename?

There is a nice post at https://stackoverflow.com/a/57019943 which described how to use templates to access multiple data tags from different sections in a single call.

Give it a go and let us know how that works out.

Offline

Board footer

Powered by FluxBB