News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Renaming avi files

Started by boredcollie, August 19, 2020, 08:39:32 AM

Previous topic - Next topic

boredcollie

Hi there,
I'm a long time user of exiftool. I managed to organise my whole photo library, and never been so happy.
Now it's time to organise all the video files that I made with my camera.

This is what I normally use for the pictures and works well also for video files:

exiftool -P -d %Y%m%d_%H%M%S '-filename<${DateTimeOriginal}_${ImageSize}_${Model}%+.3c.%le' -r .

but for some reason I'm not able to rename older files. As an example these are the EXIF info for an old avi file that I have and where exiftool doesn't work:


--- Desktop/2005 ยป exiftool 20050107.avi
ExifTool Version Number         : 11.85
File Name                       : 20050107.avi
Directory                       : .
File Size                       : 8.5 MB
File Modification Date/Time     : 2005:01:07 15:43:36+01:00
File Access Date/Time           : 2020:08:19 14:27:31+02:00
File Inode Change Date/Time     : 2020:08:19 14:27:38+02:00
File Permissions                : rw-r--r--
File Type                       : AVI
File Type Extension             : avi
MIME Type                       : video/x-msvideo
Frame Rate                      : 15
Max Data Rate                   : 131.7 kB/s
Frame Count                     : 1324
Stream Count                    : 2
Stream Type                     : Video
Video Codec                     : mjpg
Video Frame Rate                : 15
Video Frame Count               : 1324
Quality                         : 10000
Sample Size                     : Variable
BMP Version                     : Windows V3
Image Width                     : 160
Image Height                    : 120
Planes                          : 1
Bit Depth                       : 24
Compression                     : MJPG
Image Length                    : 57600
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              : 973052
Encoding                        : Microsoft PCM
Num Channels                    : 1
Sample Rate                     : 11024
Avg Bytes Per Sec               : 11024
Bits Per Sample                 : 8
Date/Time Original              : 2005:01:07 15:16:40
Software                        : CanonMVI01
Image Size                      : 160x120
Megapixels                      : 0.019
Duration                        : 0:01:28


Both Date/Time original and Image Size are present but the file is not renamed. Even removing the Model parameter doesn't work.
I don't have any clue why in this case doesn't work :(

I'm on Mac OSX and I've checked file permissions as well if it's  help.

Thanks for any help!

Phil Harvey

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

boredcollie

Thanks!

Was really simple than. It solves my issue!

:)

tooremex

Hi guys,

unfortunately I have the same problem like discribed above. That's why I have to continue this topic. Of course I hope it's possible.

I have also tried the solution here https://exiftool.org/faq.html#Q16, but it doesn't work in my case.

For example:
I have in my directory an AVI file, taken by a wildlife camera. And when I try to rename it whith exiftool, then I get the following error message:


$ exiftool -ext+ AVI -d pics/%Y/%m "-filename<dateTimeOriginal" DSCF0020.AVI
Warning: Encountered empty null chunk. Processing aborted - DSCF0020.AVI
Warning: No writable tags set from DSCF0020.AVI
    0 image files updated
    1 image files unchanged


What can I do to solve my problem?

Thank you for help.

Best regards.

StarGeek

The No writable tags warning tells you that the DateTimeOriginal does not exist in that file. The DateTimeOriginal is not common in AVI files.  You need to pick a different tag to copy the date/time from.

Use this command to see all available date/time tags
exiftool -time:all -G1 -a -s file.avi
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

tooremex

Hello StarGeek,

thank you for your answer.

I get following:


$ exiftool -time:all -G1 -a -s DSCF0020.AVI
[System]        FileModifyDate                  : 2022:05:22 00:58:04+02:00
[System]        FileAccessDate                  : 2022:05:22 08:00:45+02:00
[System]        FileInodeChangeDate             : 2022:05:22 07:57:19+02:00


I think, important for me in this case is 'FileModifyDate'. Is that true?

And, command is '$ exiftool -ext+ AVI -d pics/%Y/%m "-directory<FileModifyDate" file.AVI'?

....oh, yeah, it works - thank you very much!  :)