Thursday, January 27, 2011

Burn VIDEO_TS folders as UDF discs via the Terminal


There have been some issues with burning VIDEO_TS folders on a Mac without using something like Popcorn or Toast.

Usually you use DVD Studio Pro to burn a VIDEO_TS folder to discs, but if you find yourself on a computer that doesn't have that installed what can you do? Burning a VIDEO_TS folder via the Finder will result in a Mac OS Extended disc that won't be compatible with some stand-alone DVD players and won't play in DVD Player app. Same goes for Disk Utility. The Finder and Disk Utility will burn a Mac OS Extended rather than a UDF disc which is what many DVD Players (and DVD Player app) expect.

The solution is to use the Terminal. Yup.

00) Pop in a blank DVD.
01) Get your VIDEO_TS folder how you want it.
02) Fire up the Terminal.
03) Paste this:

hdiutil makehybrid -udf -udf-volume-name DVD_NAME -o MY_DVD.iso /path/to/VIDEO_TS/parent/folder

(that's all one line, btw)

Technically you're only going to paste this:

hdiutil makehybrid -udf -udf-volume-name DVD_NAME -o MY_DVD.iso

04) Hit spacebar

05) Drag in the folder that's enclosing the VIDEO_TS folder into the Terminal. You'll see it fill in that folder's path. Read step 5 again, it's important.

It's best to drag folders into the Terminal to get their path's correct as spaces in folder names make things tricky. If you want the path of a folder you can use Get Info or in the Finder hit Shift + Command + G for "Go to Folder..." and drag the folder into the text entry box. Be aware however that spaces will not appear as they should in the Terminal.

A better way to get the exact path (other than dragging the folder into the Terminal after you've pasted in the command) is to drag it into the Terminal before you've pasted in the command and see what the Terminal says. You can even copy/paste from here. Dragging it in after you paste in the command saves time though.

An example:

Lets say we have a folder called "untitled folder 3" we want to put into the command via it's path. Well, that folder has two spaces so in the Terminal, when we drag it there, we'll see:

/Users/HOMEFOLDER/Desktop/untitled\ folder\ 3

HOMEFOLDER will be whatever you've named your home folder in this case.

But, see how "untitled folder 3" is parsed in the Terminal?

untitled\(space)folder\(space)3

A space = \(space) in the Terminal. (space) is a space, like hitting the spacebar key on your keyboard.

So...let's say we have a VIDEO_TS folder inside a folder called "To Be Burned Off" on our Desktop. What would the path be?

/Users/HOMEFOLDER/Desktop/To\ Be\ Burned\ Off/VIDEO_TS

See, it's not that complicated once you understand how spaces work.

The command would then look like this:

hdiutil makehybrid -udf -udf-volume-name DVD_NAME -o MY_DVD.iso /Users/HOMEFOLDER/Desktop/To\ Be\ Burned\ Off 

(again, that's all one line in the Terminal, there is a space between the .iso and /Users)

Ah ha...notice that we DO NOT point it directly to the VIDEO_TS folder. That's important. Point it to the folder ENCLOSING the VIDEO_TS folder.

You can change "DVD_NAME" and "MY_DVD" to whatever you like but make sure you follow proper DVD naming conventions or things will explode. DVD_NAME will be the name of the disc so the client will be able to see it so be careful. MY_DVD will be the name of the .iso and won't be on the burned DVD.

04) Hit return.

You'll find, after a time and a lot of periods in the Terminal, a disc image called MY DVD.iso likely at the root level of your Home Folder. This .iso will be UDF. Yay!

Now you'll need to burn this .iso disc image to a disc with Disk Utility.

05) Launch Disk Utility.
07) Hit Command + B (for "Burn...) or tap the Burn button.
08) Select the .iso you just made and hit the Burn button.

09) TEST THE DISC!

Your milage will vary on this tip mainly due to all the different versions of hdiutil, OS and Terminal that have been floating around.

NOTE: an alternate command if the above fails is this:

hdiutil makehybrid -iso -joliet -udf -udf-version 1.02 \
-default-volume-name "DVD_VIDEO" \
-o "/path/to/my/outputfile.iso" "/path/to/disks/content_folder";

(all one line)

hdiutil is very powerful and has myriad options. I urge you to flip though it's man page here.

You can also use this method to make Hybrid DVDs which hold not only DVD Video but Data Files as well. Place your DVD-ROM folder in the same folder that's enclosing the VIDEO_TS folder and use the Terminal command as is.

Oh, it wouldn't be a bad idea to also include an empty AUDIO_TS folder to help with compatibility of older stand-alone DVD Players.

No comments: