Video Script - Camera Model Suffix

Advanced Renamer forum
#1 : 21/08-19 10:50
Tony Leps
Tony Leps
Posts: 1
I made a little script that adds camera models based on a various EXIF info. Posting it here (as is) in case anyone is looking to do something similar.

This mainly covers Canon 5D2/3, Sony a7iii, iPhones, and Android (sorry, my android videos had no specific metadata to differentiate devices).

If your camera isn't listed, check the video EXIF info to see if there is a field unique to that device. Good luck!

*Disclaimer: There's probably a more elegant way to do this. Feel free to post suggestions if there's a better way!)

=====================================================================
// Add Camera Model Script


// a7III
var exifa7m3 = app.parseTags('<ExifTool:DeviceModelName>');
if (exifa7m3 == "ILCE-7M3") {
var camera = "a7iii";
}


//GH5
var exifGH5 = app.parseTags('<ExifTool:Model>');
if (exifGH5 == "DC-GH5") {
var camera = "GH5";
}

//Canon
var exif5DOld = app.parseTags('<ExifTool:CompressorVersion>');
var exif5D = app.parseTags('<ExifTool:Model>');
var exifPS = app.parseTags('<ExifTool:Software>');

if (exifPS == "CanonMVI01") {
var camera = "CPS1";
} else if (exifPS == "CanonMVI02") {
var camera = "CPS2";
}
if (exif5DOld == "CanonAVC0001") {
var camera = "5D2";
}
if (exif5D == "Canon EOS 5D Mark II") {
var camera = "5D2";
} else if (exif5D == "Canon EOS 5D Mark III") {
var camera = "5D3";
}


// iPhone
var exifFilmic = app.parseTags('<ExifTool:Software>');
var filmic = exifFilmic.indexOf('FiLMiC') !== -1
var exifiPhone = app.parseTags('<ExifTool:Model>');
var iPhone = exifiPhone.indexOf('iPhone') !== -1
var exifApple = app.parseTags('<ExifTool:HandlerVendorID>');

if (filmic == true) {
var camera = "FiLMiC";
} else if (iPhone == true) {
var camera = exifiPhone;
} else if (exifApple == "Apple") {
var camera = "iPhone";
}


// GoPro
var exifGoPro = app.parseTags('<ExifTool:CompressorName>');
var goPro = exifGoPro.indexOf('GoPro') !== -1

if (goPro == true) {
var camera = "GoPro";
}


// Android
var exifAndroid = app.parseTags('<ExifTool:HandlerDescription>');

if (exifAndroid == "SoundHandle") {
var camera = "Android";
} else if (exifAndroid == "VideoHandler") {
var camera = "Android";
}


// MiniDV
var exifMiniDV = app.parseTags('<ExifTool:VideoCodec>');
if (exifMiniDV == "dvsd") {
var camera = "MiniDV";
}

// Add camera model to end of new name.
return item.newBasename + '_' +camera;


21/08-19 10:50