Help needed - Renaming and sort a huge amount of recovered video files

Started by Biggelogge, September 22, 2018, 09:15:48 AM

Previous topic - Next topic

Biggelogge

Hi all

I have experimented with ExifTool - is is an outstanding program!!

Now to my problems and questions,

Background
We have a BIG Qnap NAS server used for video production, suddenly all files dissipated (long story short - it was really bad - 60000Gb of lost data...)

We sent the unit to iBas Norway, they managed to recover a lot of files - but the original filenames are gone :(
Now I have a long list of files.

The video file types are:
mp4
mov
mxf
asf
mpg
mts

Some videofiles are big - up to 50Gb each.


There are also small amount of image and audio files:
jpg, png, psd, tif
mp3, wav


All of the files above contains EXIF data. How much data varies a lot depending on where the file has been created.


I have made some tests and all mp4 and mov files, the command below extracts original create date and time successfully on all files i have tested on.  (probably others work too). This is good news!

exiftool "-FileName<CreateDate" -d %Y%m%d_%H%M%S%%-c.%%e C:\exif
It renames all files with create date and time - a good start!



Now to my questions...


Question 1:
Is there a limit or recommendation how many files you should process at the same time (in my case around 9000 files in each directory) ?


Question2:
Do you recommend to process all the files at the same time or move them to different folders and process there according to the file formats and file types?

Question3:
In some files (far from all) the original filename is in the EXIF data. Is it possible to use this?
Example:
EXIF: com.arri.camera.CameraClipN : D003C026_170329_R15D.mov

Is it possible to do this automatically:
Create separate date folders
Moves all files to their date folder
If com.arri.camera.CameraClipN is present, rename to original file name
If not rename file to create date and time

Could someone make an example code on this?


Question 4 (Of topic)
There are also other recovered files, dpx, rd3, zip, gzip - if anybody have any ideas to automatically sort this files - all tips are highly appreciated!

Looking forward to your answers :D


Best wishes from Sweden  8)

//Ola Schönbeck

Phil Harvey

Hi Ola,

Quote from: Biggelogge on September 22, 2018, 09:15:48 AM
Question 1:
Is there a limit or recommendation how many files you should process at the same time (in my case around 9000 files in each directory) ?

The more the better, as long as you specify a directory name and not individual file names on the command line.

QuoteQuestion2:
Do you recommend to process all the files at the same time or move them to different folders and process there according to the file formats and file types?

Whatever is easiest for you.  You can use ExifTool to sort them into directories if you want at any time.

QuoteQuestion3:
In some files (far from all) the original filename is in the EXIF data. Is it possible to use this?
Example:
EXIF: com.arri.camera.CameraClipN : D003C026_170329_R15D.mov

Yes, if the name is extracted as an ExifTool tag.  For example, if the tag name is OriginalFileName, then you could do this:

exiftool -d %Y%m%d_%H%M%S%%-c.%%e "-FileName<CreateDate" "-filename<originalfilename" DIR

which would name by OriginalFileName if available, otherwise by CreateDate.

QuoteIs it possible to do this automatically:
Create separate date folders
Moves all files to their date folder
If com.arri.camera.CameraClipN is present, rename to original file name
If not rename file to create date and time

Yes (assuming you want the date folder hierarchy to by YYYY/mm/dd):

exiftool -d %Y/%m/%d "-FileName<$CreateDate/${CreateDate#;DateFmt('%Y%m%d_%H%M%S')}%-c.%e" "-filename<$CreateDate/$originalfilename" DIR

QuoteQuestion 4 (Of topic)
There are also other recovered files, dpx, rd3, zip, gzip - if anybody have any ideas to automatically sort this files - all tips are highly appreciated!

Zip files may be named by the first contained file by adding this to the above command:

"-filename<$zipfilename%-c.%e"

Or by the modification time of the first file (ZipFileTime) in a similar method to CreateDate.

I don't have any ideas about other types.

- Phil
...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 ($).

Biggelogge

Excellent. Thanks!!!
This help a lot.

I ran into a small problem, .MFX files does not work. I see this in "Supported File Types"
The .MFX files has the EXIF tag CreateDate.
It works if I change the file extension to .MOV

I can batch rename to .MOV run Exif tool and then batch change back to .MFX

Is there another way?

//Ola

Phil Harvey

Hi Ola,

Add -ext+ mfx to the command to process MFX files as well as all writable files.  (This is FAQ 16).

Or add -ext mfx to just process MFX files.

- Phil

Edit:  Do you mean MXF instead of MFX?
...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 ($).