Rename Video files by EXIF data

English support forum

Moderators: Hacker, petermad, Stefan2, white

BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Rename Video files by EXIF data

Post by *BullFrog »

Hello,

I'm using exif to rename pictures for years but never worked on video files (Exif.DateOriginal is blank space).
Do you guys know a plugin what I can use in batch rename for 3GP, MOV, MP4,MKV files too?

The written and creation date don't work properly because there are 10-14 year old files and moving from server to server sadly compromited most of them. Also it usually shows the date I saved from the SD card not the date when it was created on the SD card.

I've tried Exif and ImageMetaData for JPG comment, Exif, IPTC and XMP metadata 2.4.0.0

In batch rename these are blank:
[=exif.DateOriginal.Y-M-D ][=exif.TimeOriginal. h-m-s]
[=exif.GPS Datestamp]
[=jpg-comment.XMPDateCreated]
[=jpg-comment.ModifyDate]
[=jpg-comment.CreateDate.Y-M-D h-m-s]
[=jpg-comment.XMPExifImageHeight]
[=jpg-comment.XMPMetadataDate]
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Rename Video files by EXIF data

Post by *ghisler(Author) »

Video files normally don't contain EXIF data. Some video formats contain their own form of metadata not currently supported by my EXIF plugin.
Author of Total Commander
https://www.ghisler.com
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Re: Rename Video files by EXIF data

Post by *BullFrog »

Are there any alternatives maybe? The file contains media creation date/time, I just have no idea how to get it out.
Image: https://i.imgur.com/GHcWnxp.png
User avatar
Gral
Power Member
Power Member
Posts: 1600
Joined: 2005-01-26, 15:12 UTC

Re: Rename Video files by EXIF data

Post by *Gral »

ExifTool - https://exiftool.org/ especially look at filename - https://exiftool.org/#filename, such a command change names to creation dates

Code: Select all

exiftool "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR
where DIR is your real directory containing videos.
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Re: Rename Video files by EXIF data

Post by *BullFrog »

Sadly I have way too much directories (16 years each 250-300 folders), usually search them in and use TC to batch rename, can it work somehow in there?
User avatar
Dalai
Power Member
Power Member
Posts: 9966
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Rename Video files by EXIF data

Post by *Dalai »

EXIF is a specific kind of metadata used for photos/images. Video files can contain metadata, too, but it's a different kind. I suggest to use one of the three MediaInfo based plugins: MediaInfo, MediaInfoWDX and TCMediaInfo. This should work for most, if not all, file types you mentioned.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Re: Rename Video files by EXIF data

Post by *BullFrog »

Tried them now but they give blank results too. :(

1) https://totalcmd.net/plugring/mediainfo64.html
[=mediainfo.recorded date][=mediainfo.encoded date][=mediainfo.recorded date.Y-M-D h-m-s]

2) https://totalcmd.net/plugring/MediaInfoWDX.html
[=mediainfowdx.Recorded_Date_General][=mediainfowdx.Encoded_Date_Video][=mediainfowdx.Encoded_Date_General]

3) https://totalcmd.net/plugring/tcmediainfo.html
[=tcmediainfo.Released Date][=tcmediainfo.Released Date][=tcmediainfo.Recorded Date]

Here is a 11 year old 3mb video file where I can see 3 dates in windows:
1) Origin media create date
2) Date of first copy from SD card (a week after create date)
3) The latest copy (today)
https://drive.google.com/file/d/13JQ32KvmudTffobaDM38fqGtUOij5pio/view?usp=share_link
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6975
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Rename Video files by EXIF data

Post by *Horst.Epp »

Tcmediainfo works if the files contain such information.
For example [=tcmediainfo.Encoded Date] shows the Encoded date for Mkv, Mov, Wmv files.
There is no Recorded Date in my example files.
I check what infos are stored using the Mediainfo explorer context menu extension.
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
User avatar
Dalai
Power Member
Power Member
Posts: 9966
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Rename Video files by EXIF data

Post by *Dalai »

Well, you need to consult MediaInfo (GUI) or WdxGuide (32-bit only) or the newer WDX Guide 2.x (32/4-bit) to see which tag fields are available for each file. AVI files can contain tags as well, but since AVI is a different container than MP4 and MKV, they're different from each other.

In the case of the AVI you linked to it would be "Mastered date" which is provided by none of the MediaInfo plugins (by default). TCMediaInfo can be configured to show custom fields; see allprops.txt and TCMediaInfo.xml in the plugin directory. However, you should bring some scripting and/or coding skills.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Re: Rename Video files by EXIF data

Post by *BullFrog »

Never thought this would be this hard :( sadly my coding/scripting skills are far from enough to make it happen, but thanks for the clarification.
User avatar
Dalai
Power Member
Power Member
Posts: 9966
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Rename Video files by EXIF data

Post by *Dalai »

Look through your video files, write down the fields you need and post the compiled list here. I'm pretty sure someone can help you with the modification of TCMediaInfo.xml. I've done modifications to it years ago, so I'd need to recall how to do it (which is doable).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
beb
Power Member
Power Member
Posts: 580
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Rename Video files by EXIF data

Post by *beb »

MediaInfo app returns date/time in question as:
Mastered date: 2012-04-22 11:04:30
MediaInfo app output...

Code: Select all

General
Complete name                            : E:\Downloads\OneDrive\TEST\EXIF\AVI\MVI_6735.AVI
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 2.97 MiB
Duration                                 : 4 s 800 ms
Overall bit rate                         : 5 182 kb/s
Mastered date                            : 2012-04-22 11:04:30
Writing application                      : CanonMVI01

Video
ID                                       : 0
Format                                   : JPEG
Codec ID                                 : MJPG
Duration                                 : 4 s 800 ms
Bit rate                                 : 5 089 kb/s
Width                                    : 640 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 10.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 1.656
Stream size                              : 2.91 MiB (98%)

Audio
ID                                       : 1
Format                                   : PCM
Format settings                          : Unsigned
Codec ID                                 : 1
Duration                                 : 4 s 800 ms
Bit rate mode                            : Constant
Bit rate                                 : 88.2 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 11.024 kHz
Bit depth                                : 8 bits
Stream size                              : 51.7 KiB (2%)
Alignment                                : Aligned on interleaves
Interleave, duration                     : 960  ms (9.60 video frames)
Interleave, preload duration             : 1000  ms
Exiftool app returns one as (depending on how I make a query):
DateTimeOriginal = Sun Apr 22 11:04:30 2012, Date/Time Original = DateTimeOriginal = [RIFF] Date/Time Original: 2012:04:22 11:04:30
Exiftool app outputs (4)...

Code: Select all

[System]        Directory                       : E:/Downloads/OneDrive/TEST/EXIF/AVI
[System]        File Name                       : MVI_6735.AVI
[System]        File Modification Date/Time     : 2023:01:04 02:04:48+02:00
[System]        File Access Date/Time           : 2023:01:04 02:13:10+02:00
[System]        File Creation Date/Time         : 2023:01:04 02:04:45+02:00
[RIFF]          Date/Time Original              : 2012:04:22 11:04:30
FileModifyDate                  : 2023:01:04 02:04:48+02:00
FileAccessDate                  : 2023:01:04 02:13:30+02:00
FileCreateDate                  : 2023:01:04 02:04:45+02:00
DateTimeOriginal                : 2012:04:22 11:04:30



ExifTool Version Number         : 12.52
File Name                       : MVI_6735.AVI
Directory                       : E:/Downloads/OneDrive/TEST/EXIF/AVI
File Size                       : 3.1 MB
Zone Identifier                 : Exists
File Modification Date/Time     : 2023:01:04 02:04:48+02:00
File Access Date/Time           : 2023:01:04 02:13:32+02:00
File Creation Date/Time         : 2023:01:04 02:04:45+02:00
File Permissions                : -rw-rw-rw-
File Type                       : AVI
File Type Extension             : avi
MIME Type                       : video/x-msvideo
Frame Rate                      : 10
Max Data Rate                   : 1079 kB/s
Frame Count                     : 48
Stream Count                    : 2
Stream Type                     : Video
Video Codec                     : mjpg
Video Frame Rate                : 10
Video Frame Count               : 48
Quality                         : 10000
Sample Size                     : Variable
BMP Version                     : Windows V3
Image Width                     : 640
Image Height                    : 480
Planes                          : 1
Bit Depth                       : 24
Compression                     : MJPG
Image Length                    : 921600
Pixels Per Meter X              : 0
Pixels Per Meter Y              : 0
Num Colors                      : Use BitDepth
Num Important Colors            : All
Audio Codec                     : 
Audio Sample Rate               : 11024
Audio Sample Count              : 52916
Encoding                        : Microsoft PCM
Num Channels                    : 1
Sample Rate                     : 11024
Avg Bytes Per Sec               : 11024
Bits Per Sample                 : 8
Date/Time Original              : 2012:04:22 11:04:30
Software                        : CanonMVI01
Image Size                      : 640x480
Megapixels                      : 0.307
Duration                        : 4.80 s



ExifToolVersion                 : 12.52
FileName                        : MVI_6735.AVI
Directory                       : E:/Downloads/OneDrive/TEST/EXIF/AVI
FileSize                        : 3.1 MB
ZoneIdentifier                  : Exists
FileModifyDate                  : 2023:01:04 02:04:48+02:00
FileAccessDate                  : 2023:01:04 02:13:30+02:00
FileCreateDate                  : 2023:01:04 02:04:45+02:00
FilePermissions                 : -rw-rw-rw-
FileType                        : AVI
FileTypeExtension               : avi
MIMEType                        : video/x-msvideo
FrameRate                       : 10
MaxDataRate                     : 1079 kB/s
FrameCount                      : 48
StreamCount                     : 2
StreamType                      : Video
VideoCodec                      : mjpg
VideoFrameRate                  : 10
VideoFrameCount                 : 48
Quality                         : 10000
SampleSize                      : Variable
BMPVersion                      : Windows V3
ImageWidth                      : 640
ImageHeight                     : 480
Planes                          : 1
BitDepth                        : 24
Compression                     : MJPG
ImageLength                     : 921600
PixelsPerMeterX                 : 0
PixelsPerMeterY                 : 0
NumColors                       : Use BitDepth
NumImportantColors              : All
AudioCodec                      : 
AudioSampleRate                 : 11024
AudioSampleCount                : 52916
Encoding                        : Microsoft PCM
NumChannels                     : 1
SampleRate                      : 11024
AvgBytesPerSec                  : 11024
BitsPerSample                   : 8
DateTimeOriginal                : 2012:04:22 11:04:30
Software                        : CanonMVI01
ImageSize                       : 640x480
Megapixels                      : 0.307
Duration                        : 4.80 s



  ExifToolVersion = 12.52
  FileName = MVI_6735.AVI
  Directory = E:/Downloads/OneDrive/TEST/EXIF/AVI
  FileSize = 3109430
  ZoneIdentifier = Exists
  FileModifyDate = 1672790688.41524
  FileAccessDate = 1672791211.42361
  FileCreateDate = 1672790685.31283
  FilePermissions = 33206
  FileType = AVI
  FileTypeExtension = AVI
  MIMEType = video/x-msvideo
RIFF 'LIST_hdrl' chunk (322 bytes of data):
  Hdrl (SubDirectory) -->
  + [Hdrl directory, 322 bytes]
  | AVIHeader (SubDirectory) -->
  | + [BinaryData directory, 56 bytes]
  | | FrameRate = 100000
  | | MaxDataRate = 1104774
  | | FrameCount = 48
  | | StreamCount = 2
  | | ImageWidth = 640
  | | ImageHeight = 480
  | Stream (SubDirectory) -->
  | + [Stream directory, 112 bytes]
  | | StreamHeader (SubDirectory) -->
  | | + [BinaryData directory, 56 bytes]
  | | | StreamType = vids
  | | | VideoCodec = mjpg
  | | | VideoFrameRate = 0.1
  | | | VideoFrameCount = 48
  | | | Quality = 10000
  | | | SampleSize = 0
  | | VideoFormat (SubDirectory) -->
  | | + [BinaryData directory, 40 bytes]
  | | | BMPVersion = 40
  | | | ImageWidth = 640
  | | | ImageHeight = 480
  | | | Planes = 1
  | | | BitDepth = 24
  | | | Compression = 1196444237
  | | | ImageLength = 921600
  | | | PixelsPerMeterX = 0
  | | | PixelsPerMeterY = 0
  | | | NumColors = 0
  | | | NumImportantColors = 0
  | Stream (SubDirectory) -->
  | + [Stream directory, 88 bytes]
  | | StreamHeader (SubDirectory) -->
  | | + [BinaryData directory, 56 bytes]
  | | | StreamType = auds
  | | | AudioCodec = 
  | | | AudioSampleRate = 9.071117562e-005
  | | | AudioSampleCount = 52916
  | | | Quality = 10000
  | | | SampleSize = 1
  | | AudioFormat (SubDirectory) -->
  | | + [BinaryData directory, 16 bytes]
  | | | Encoding = 1
  | | | NumChannels = 1
  | | | SampleRate = 11024
  | | | AvgBytesPerSec = 11024
  | | | BitsPerSample = 8
  | DateTimeOriginal = Sun Apr 22 11:04:30 2012.
RIFF 'LIST_INFO' chunk (20 bytes of data):
  Info (SubDirectory) -->
  + [Info directory, 20 bytes]
  | Software = CanonMVI01
RIFF 'JUNK' chunk (1662 bytes of data):
  TextJunk = 
RIFF 'LIST_movi' chunk (3106514 bytes of data):
RIFF 'idx1' chunk (848 bytes of data):
None of the TC's relevant plugins that are known to me (including but not limited to: TCMediaInfo.wdx(64), MediaInfoWDX.wdx(64), mediainfo.wdx, jpg-comment.wdx(64), ExifToolWDX.wdx(64), exif.wdx(64)) can by default recognize, process and return this date/time tag for the AVI file.
However, if AVI is renamed to JPG (say, MVI_6735.AVI becomes MVI_6735.jpg) when set up duly ExifToolWDX.wdx(64) would return the value properly as follows
[=exiftoolwdx.DateTimeOriginal]

Edit: That's how it looks like: https://i.imgur.com/FtBwpxe.png

Thus, at least there's an option.
Step one: *.avi -> *.jpg
Step two: *.jpg -> [=exiftoolwdx.DateTimeOriginal.{desired_date/time_format}]_[N].avi


EDIT2:
there's no need for AVI-to-JPG renaming if you follow ZoSTeR's advice below; all you need is to place EXT="AVI" in the ExifToolWDX plugin detect string.
I seemed to check this specifically before posting but somehow messed up the detect strings of two different plugins with similar names in the night, and missed that. Sorry.
Then a single step would be pretty enough within Multi-Rename Tool:
*.avi -> [=exiftoolwdx.DateTimeOriginal.{desired_date/time_format}]_[N].avi
ZoSTeR wrote: 2023-01-04, 15:58 UTC There's no need to rename your files from .AVI to .JPG
Just add the AVI Extension to the ExifToolWDX detection setting:
e.g.

Code: Select all

21=%Commander_Path%\Plugins\wdx\ExifToolWDX\ExifToolWDX.wdx
21_detect="EXT="JPG"|EXT="JPGE"|EXT="TIF"|EXT="TIFF"|EXT="NEF"|EXT="AVI""
Last edited by beb on 2023-01-04, 17:13 UTC, edited 5 times in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Re: Rename Video files by EXIF data

Post by *BullFrog »

Great workaround, Thanks I will do this!
Now I have to find a way to batch search for the Video files that contains this mastered date to rename it foolproof :)
User avatar
beb
Power Member
Power Member
Posts: 580
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Rename Video files by EXIF data

Post by *beb »

BullFrog wrote: 2023-01-04, 10:48 UTC Great workaround, Thanks I will do this!
Now I have to find a way to batch search for the Video files that contains this mastered date to rename it foolproof :)
That's just a piece of cake :)
For instance:
1. make your custom column view with [=exiftoolwdx.DateTimeOriginal] in it (as in my screenshot above) and make it active
2. enter into a root directory under which you are keeping your videos and press Ctrl + B
3. sort files by that specific column and whenever that field is not empty you would see a gathered group of the videos in question
Cheers!
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1050
Joined: 2004-07-29, 11:00 UTC

Re: Rename Video files by EXIF data

Post by *ZoSTeR »

 
There's no need to rename your files from .AVI to .JPG

Just add the AVI Extension to the ExifToolWDX detection setting:

e.g.

Code: Select all

21=%Commander_Path%\Plugins\wdx\ExifToolWDX\ExifToolWDX.wdx
21_detect="EXT="JPG"|EXT="JPGE"|EXT="TIF"|EXT="TIFF"|EXT="NEF"|EXT="AVI""
Post Reply