ExifTool Forum

ExifTool => Newbies => Topic started by: boredcollie on August 19, 2020, 08:39:32 AM

Title: Renaming avi files
Post by: boredcollie on August 19, 2020, 08:39:32 AM
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!
Title: Re: Renaming avi files
Post by: Phil Harvey on August 19, 2020, 09:56:06 AM
I think this is FAQ 16 (https://exiftool.org/faq.html#Q16).

- Phil
Title: Re: Renaming avi files
Post by: boredcollie on August 19, 2020, 12:20:29 PM
Thanks!

Was really simple than. It solves my issue!

:)
Title: Re: Renaming avi files
Post by: tooremex on May 22, 2022, 11:10:41 AM
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 (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.
Title: Re: Renaming avi files
Post by: StarGeek on May 22, 2022, 11:43:54 AM
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
Title: Re: Renaming avi files
Post by: tooremex on May 22, 2022, 11:57:21 AM
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!  :)