Author Topic: Rename video files with vertical resolution  (Read 145 times)

jason404

  • Newbie
  • *
  • Posts: 2
Rename video files with vertical resolution
« on: March 14, 2019, 08:23:47 AM »
I have a load of video files which I want to rename with the vertical resolution at the end.

eg.  VideoFileExample1.mp4 renamed to VideoFileExample1.1080.mp4

How would I do this?  I was going to write a Windows batch or bash file using the FOR command, but it seems that ExifTool can do batch operations itself.

Thanks.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: Rename video files with vertical resolution
« Reply #1 on: March 14, 2019, 08:31:54 AM »
Hi Jason,

Try this:

exiftool "-testname<%f.$imagewidth.%e" DIR

If this does what you want, then replace "testname" with "filename" to actually rename the files.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2365
Re: Rename video files with vertical resolution
« Reply #2 on: March 14, 2019, 11:20:52 AM »
I think ImageHeight would be the appropriate tag.

Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: Rename video files with vertical resolution
« Reply #3 on: March 14, 2019, 11:25:11 AM »
Right, thanks:

exiftool "-testname<%f.$imageheight.%e" DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

jason404

  • Newbie
  • *
  • Posts: 2
Re: Rename video files with vertical resolution
« Reply #4 on: March 22, 2019, 07:06:22 AM »
Brilliant, that worked.  Thanks Phil and StarGeek.

I only just realised that I had replies, as the forum settings don't seem to automatically set notifications for your own posts.