Wednesday, 28 November, 2018

Fixing Sony DSLR and other cameras repeating file names

Sony A7 and other cameras create MTS or MP4 clips called C001, C002, C003…. And these names repeat every time the card is formatted. So, in a long project one has multiple clips called C001, multiple clips called C002 and so on. And what makes it worse is that these clips also have repeating timecode.
If the project is finished on the editing system then this is less of a problem. But if the project has to be taken to another system for colour correction or effects work, then relinking the AAF or XML or EDL to the original files is a huge problem. 
One way around this, while shooting, is to not format the card in the camera. Instead, in the camera, delete all clips except the last one. The camera will now begin recording from the next number and not go back to C001. So, if the last clip on a card is C028, then you delete C001 to C027 in the camera and start shooting. The camera will automatically shoot clips from C029 onwards. And so on.
But if that’s always possible. In that case, the only way to prevent conflicts is to rename the original Sony files BEFORE beginning the edit. What I do is to highlight the MP4 clips, (on a Mac) right-click on them, and select ‘Rename … items’. 
The folder containing the clips often have other files. The best way to highlight only mp4 files in that folder (on a Mac) is to see the folder in list view, and then click on the 'Kind' column. So that MP4 files get grouped together. You can now highlight just the MP4 files.
Once you highlight the MP4 files in one folder, right-click them and select 'Rename 62 items...' (where 62 is the number of files you've highlighted)
Then in the window that opens, choose to add text before clip name as date. So you type in the box 20180224 - for clips shot on 24 Feb 2018 (for example).
Now your clips will look like this
20180224-C001.mp4 20180224-C002.mp4 20180224-C003.mp4 20180224-C004.mp4
Clips from the next day will be like this 20180225-C001.mp4 20180225-C002.mp4 20180225-C003.mp4 20180225-C004.mp4 And so on.
Date is set for year-month-day so that they all get sorted neatly by date. If you set it as date-month-year then it goes crazy when sorted.
For example, if you have clips shot on 24 Feb, 28 Mar, 16 Aug, 02 Oct, and you name them as date-month-year, as 24022018, 28032018, 16082018, 02102018, then, on the disk they will appear like this. 02102018 16082018 24022018 28032018 So the order will end up being Oct, Aug, Feb, Mar.
Which is why, you name them as year-month-day, so then your clips will get named 20180224 20180328 20180816 20181002
And in the finder they will appear in the right chronological order as.
20180224 20180328 20180816 20181002
Feb, Mar, Aug, Oct. 
If you have multiple cameras shooting simultaneously, then you will end up with multiple clips called 20180224-C001.mp4 20180224-C002.mp4 20180224-C003.mp4 all on the same day.
In this case, you can also add the camera letter or name. So you rename the clips in two steps.
First, rename C001, C002, C003 etc with the date prefixed and then highlight them and add a letter before the name. So, you will get clips called A-20180224-C001.mp4 A-20180224-C002.mp4 A-20180224-C003.mp4 A-20180224-C004.mp4
for all A camera clips, and B-20180224-C001.mp4 B-20180224-C002.mp4 B-20180224-C003.mp4 B-20180224-C004.mp4 for all B camera clips, and so on for the other cameras.
Further, if there are multiple cards on the same day, you may want to add card numbers to the camera letters. So, for all A camera clips on the 24 Feb 2018 from the first card, you rename them as A01-20180224-C001.mp4 A01-20180224-C002.mp4 A01-20180224-C003.mp4 A01-20180224-C004.mp4
And for all A camera clips on the 24 Feb 2018 from the second card, you rename them as
A02-20180224-C001.mp4 A02-20180224-C002.mp4 A02-20180224-C003.mp4 A02-20180224-C004.mp4 and so on.
The basic idea is to ensure that within a project no two clips have the same name. In this method, it does not matter if timecode is repeated, because whatever you do, every 24 hours of time, timecode is repeated anyway. A timecode repeat along with a file name repeat is disaster when an edit needs to be moved from one system to another.

Friday, 13 July, 2018

Fixing an exFAT drive on a Mac

I have tested this with macOS 10.13.6 on a MacPro cylinder
On a LaCie Quadra 4TB drive which was exFAT and was not mounting on the Mac, but appeared in Disk Utility. First Aid in Disk Utility could not repair this drive.

Quoting from various resources on the net...


Looked like crazy on the net for solutions but couldn't find any. I started to poke around in the terminal and ran this:

fsck_exfat -d disk0s4

The -d flag is the debug flag and it gave me hope. I saw all my files flashing by and after a while I got this question:
Main boot region needs to be updated. Yes/No?

I picked yes and it said that it repaired the drive. It didn't appear on the desktop though. I ran fsck_exfat again and now it said that the disk was ok. I fired up Disk utility and tried to repair the drive there once again and now disk utility could repair it! =))) 

Just wanted to share this lil advice since it seems common that exfat partions gets corrupted in OSX. I have no idea why Disk Utility doesn't call fsck and instead says that the disk can't be repaired. The tools for repairing it is in the OS and apparently and obviosusly it was fixable (...in my case).


sudo fsck_exfat -d disk0s4

where diskos4 is your ExFAT partition.

It then asks:

Main boot region needs to be updated. Yes/No?

to which you reply Yes. You can then run repair in the OSX Disk Utility and the partition should be restored!

From comments at the bottom of the article

Another tip I discovered:

When you run fsck_exfat on your drive and it comes up “Resource Busy” you can use the following commands:

This will give you a list of processes using your disk:
ps -ax | grep disk2 (but your disk)

You will get something like this:
13699 ?? 11:52.83 /System/Library/Filesystems/hfs.fs/Contents/Resources/./fsck_hfs -y /dev/disk2s2

Run this to kill that process
sudo kill 13699


Repeat until it lets you fsck_exfat your drive 

Friday, 8 June, 2018

Back after a long time

Its been a while since I have posted here. In fact, its almost 2 years.

These have been busy 2 years, with lots of travel, new projects, and other distractions. 

I started this blog to post musings which were to be studied writings, not instant posts like Twitter and Facebook posts. So, its not as if I've been away from the action, just that I make smaller posts on my Facebook page. 

Please visit my Facebook page, read up new and old posts, and feel free to ask something. I answer more quickly there. If you like it, please join so you get updates as I post them. 

Link here.
'Neil Sadwelkar's Tech Corner'.