Skip to main content

How To: Renaming IOS movie files using the Date and Time the movie was taken

hereI am fanatical about storing my photos and home videos on my NAS using the date and time they were taken so that any media renderer will naturally sort them chronologically. It also takes any guesswork out of figuring out when the movie or photo was taken as it's simply the filename i.e. 20110824-100559 being 2011, August 24th @ 10:05:59 AM. See my other post here that shows how I use "Lupas Rename 2000" to automatically do this for hundreds (or even thousands) of photos in seconds.

When I got an iPhone, things got complicated as I could not find anything that would read the EXIF information embedded in the iPhone MOV files and use this to rename the videos. It took weeks to work out a simple solution so I'm posting it here to assist others.

Exiftool Installation for Windows 7
  • Download the excellent ExifTool by Phil Harvey here
  • Extract the program and rename the exe from 'exiftool(-k).exe' to 'exiftool.exe'
  • Move the 'exiftool.exe' program to C:\Windows
  • Further installation instructions here

Now to rename your IOS movie files using the date and time the movie was taken
  • Copy the code below to the clipboard (highlight and use CRTL +C)
  • exiftool "-FileName<CreateDate" -ext MOV -d "%Y%m%d-%H%M%S.%%e" . (don't forget the space and fullstop at the end)
  • Navigate to the folder where you have the movies stored. Don't enter the folder itself as you need to be selecting the folder in the next step
  • Hold down the 'Shift' key and right click the folder containing the movies pegged for renaming
  • Select 'Open command window here'












  • Right click and choose paste to drop in the exiftool code
  • Hit enter
  • After a period of time (see below), the command window will give you a report of the scan process









Your movies are now renamed using the date and time...cool

How much stuff is in the folder dictates the time it takes to scan the folder so try and keep the folder void of everything but the movies that need renaming as the program will scan everything in the folder.

Modifiers
Of course, you can modify the code at the end to create a date and time code of your choosing.

Creating corresponding thumbnails for XBMC (no longer applicable in Frodo)
For those that are interested and that may be using XBMC too, after renaming the MOV files with the date and time the movie was taken, I then use FFMPEG to create thumbnails with a *.tbn extension 5 seconds into each clip.

  • Download ffmpeg and place it in your Windows\System32 folder
  • Copy this code: for %i in (*.mov) do ffmpeg -i "%i" -f mjpeg -t 0.001 -ss 5 -y "%~ni.tbn" (the last speech marks are part of the code)
  • As before, hold down shift and right click to open a command prompt in the right folder location
  • Right click in the command window and paste the ffmpeg code copied above and hit Enter

Thumbnails will now be created for every movie file with the same file name. You can change how far in ffmpeg goes to create the thumbnail by modifying the -ss 5 switch and the (*.mov) switch to whatever extension your movie has. XBMC will be very happy now!

Comments

  1. Thank you for this post. It almost works awesome for me. I have video files from my iPhone and the date that it renames the files to is off by several hours. In one example the date modified is 3/28/2014 6:11 PM and is correct. The renamed date is 3/29/2014 12:10 AM. I can’t even find where this date is coming from, it isn’t the Created, Modified, or Accessed timestamp. Any help would be greatly appreciated.

    Scott

    ReplyDelete
    Replies
    1. Were the photos in question possibly taken in another time zone from your 'home' setting?

      Delete

Post a Comment

Popular posts from this blog

Using ESPEasy with Home Assistant via MQTT

Preface: I've just started playing around with Home Assistant on a Raspberry Pi and exploring the world of MQTT to control devices on the network. Learning curve is a bit steep but worth the effort as MQTT is very fast. The hardware and software tools I'm using are as follows: 2 x Sonoff relay units 2 x NodeMCU Boards ESPEasy firmware (must be version 121 or above as that contains the MQTT 'retain' flag option. Home Assistant software on Raspberry Pi2 MQTT Test Software: PC: MQTT.fx Android: MQTT Dashboard

My Notepad++ tricks when editing YAML files in Home Assistant

To comment out a whole section in one go: Highlight the text you want to comment out and use CTRL + Q. If you do this at the start of a line, it will only comment that line. CTRL + Q is toggle mode (comment on/off). CTRL + K will allow you to add multiple comments one after the other.

How to check what entities are filling up your Home Assistant database

If you use the Home Assistant MariaDB add-on, this tip will show you how to query the database so see what Home Assistant entity states are triggering the most, filling up your database. What were going to do: Install the phMyAdmin add-on for MariaDB. Query the MariaDB database. See what entity state changes have the most action. Paste the code below into the SQL query box:  select entity_id,count( * ) from states group by entity_id order by count ( * ) desc; And if you're using the internal home-assistant_v2.db instead, you can use the SQLite Web add-on to achieve the same thing.