Rename video files by resolution?

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Rename video files by resolution?

Postby Ceetch » Sun May 28, 2017 1:34 am

I'd like to be able to prepend some MP4 and MKV files with their resolution height, but I'm not sure if this is possible...

The result would be something like...
[480] My SD Video.mp4
[720] My HD Video.mp4
[1080] My FHD Video.mkv
[1440] My QHD Video.mkv
and so on.

Is there some method I can use with this utility to find the height in pixels of the video and prepend it to the existing file name?
Ceetch
 
Posts: 3
Joined: Sun May 28, 2017 1:31 am

Re: Rename video files by resolution?

Postby therube » Sun May 28, 2017 12:07 pm

Basic idea would be...

get height
get filename

combine height & filename in a format useful to "Named Pairs"


Some utilities to get height.

Getting video dimension from ffmpeg -i

How can I get the resolution (width and height) for a video file from a linux command line?


{pseudo-code}

Code: Select all
ffprobe.exe  -v error  -show_entries stream=height  -of default=noprint_wrappers=1   "My SD Video.mp4"

That gives you:
Code: Select all
height=360

Then you'd have to parse that to get it in to the format you want.

s/.*=/[/
s/$/] /
Gives you (with a space appended to the ] ):
Code: Select all
[360]

Combine that with the filename:
Code: Select all
[360] My SD Video.mp4


namedpairvideofiles.TXT
Code: Select all
My SD Video.mp4|[360] My SD Video.mp4



That could be automated... but you'd have to work out the details...


(A GUI utility that can display file resolutions, PlayTime.)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to BRU Support