#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,370

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

Board footer

Powered by FluxBB