Showing posts with label mpeg streamclip. Show all posts
Showing posts with label mpeg streamclip. Show all posts

Friday, August 5, 2011

Converting .MOD files for Final Cut Pro and Multiclip

I've been handed a few SD cards with .MOD files that eventually need to be edited as a multiclip sequence.

Joy.

I've talked about these problematic files before here and here but never really got into the meat of the best way to transcode them for use in Final Cut Pro. Silly me thought I'd never have to deal with them again.

Here's something to keep in mind about .MOD files (from the wiki page):

"Standard definition video can be recorded in 4:3 and 16:9 formats. Some video decoders do not interpret the aspect ratio information in the media file header correctly, so 16:9 video may appear squeezed horizontally when viewed.[4] Software that is shipped with camcorders is capable of processing the aspect ratio information correctly, aided perhaps by the metadata stored in MOI files. There are also third-party tools for modifying the wide-screen aspect ratio information in the media file header so that it satisfies decoders which would otherwise fail to interpret this information correctly in an unmodified MOD file.[5][6][7] Some tools such as MediaInfo can correctly report the aspect ratio of widescreen MOD files, but media players may or may not display them correctly depending on the capabilities of the video decoder that they are utilizing at the time."

Sure are a lot of May, May Not & Somes in those paragraphs; there's even a perhaps!

These are some weird file types.


In order to nail down the workflow for transcoding these things (which, btw are Standard Definition in this particular case) I've been running some tests using MPEG Streamclip to transcode them and here's what I've discovered: (you'll likely need the MPEG-2 Component for Quicktime in addition to MPEG Streamclip)

A: Renaming the .MOD to .MPG or .mpeg and then transcoding with MSC (MPEG Streamclip) doesn't make any difference.

B: The top listing of the two ProRes exports in MSC is a HQ variety. (You may or may not see doubled up listings in your MSC exports listing depending on your setup/system etc…)

I transcoded a sample .MOD file (of about 24 seconds) to various formats, with various settings and then set up a 3 camera multiclip sequence and tested how well it played and if it was the correct aspect ratio.

What I found -after MANY MANY transcodes then importing those into FCP, setting up a multiclip sequence, then exporting and opening with Quicktime Player 7- was that what worked best for me for these files is to transcode them into:

DV25
16:9
De-interlaced

Then setup and edit your Multiclip project and export to Quicktime Movie…

Then open up your export in Quicktime Player 7 and hit Command + J for "Show Movie Properties" and hit the Presentation button and tick "Conform aperture to: Clean". 

See the transcodes from MSC will have this option ticked, but after you export the multiclip from Final Cut Pro this little checkbox will no longer be ticked but will still work. In my tests this checkbox has no effect on .MOD files transcoded to ProRes which would have been nice.

Now with an edited export at the correct aspect ratio you can transcode it to H.264 or whatever you need and it should retain the aspect ratio.

Why DV25? Well the original files are MPG2 in a .MOD wrapper and taking data per pixel, data rates and all that there's not a whole heck of a lot of quality loss (a couple of percentage points?) going to DV25. I suppose DVCPRO25 would work just as well.

Now, keep in mind this is what works for me right now, with .MOD files with this setup that I'm sitting in front of at the moment. The resulting file will be high quality and at the correct aspect ratio.

Monday, March 21, 2011

How To Crop A QuickTime Movie

Cropping a QuickTime Movie is a hassle; but there are some ways to go about it to make it slightly less hassleful. (yes, I just made up that word)

A: Use an image editing program to make a mask.

1. Open the movie file in QuickTime and hit Command + C to Copy it. (You're actually just copying a frame)
2. Launch your image editor and paste in the clipboard's contents (the frame of your video file) into a new document. Make sure the document size is the same size as the image you just pasted.
3. Using the Selection, Paint Bucket, Fill or whatever tools you have available make the part of the video you want solid black. Make the part of the video you want to crop (to go away) solid white.
4. Save out your image as a .jpg or .gif or whatever format you like.
5. Open the movie to be cropped in QuickTime 7 if it's not already, and then hit Command + J for "Show Movie Properties".
6. Click "Video Track" in the top portion of the window.
7. Click "Visual Settings" in the lower portion.
8. Under "Mask" on the left hit the "Choose…" button. (or, even easier, drag your mask image file into the Well here.
9. You'll INSTANTLY see your opened QuickTime movie crop to the mask.
10. Notice that both the Movie Properties and QuickTime Player windows have "unsaved" dots in the close widget. Close the Movie Properties window.
11. Export away.

B: Use MPEG Streamclip.

1. Download and install the FREE program MPEG Streamclip if you don't have it already.
2. Open your QuickTime clip in MPEG Streamclip.
3. Hit Command + E for "Export to Quicktime".
4. At the top of the "Movie Exporter" window that pops up under "Compression" select the codec you want. (yes, you may see ProRes 422 listed twice; no I don't know why. It's likely the bottom one is actually ProRes HQ, but that's just a guess)
5. Monkey with all the rest of the options there if you know what your'e doing. If you don't, don't touch.
6. Near the bottom, above the "Presets…" button Checkmark the "Cropping:" checkbox.
7. At the end of this line you'll see a pulldown. You'll probably want to leave it on "Destination".
8. Now, how the heck do you know what numbers to put into here? Open the SAME QuickTime clip you're cropping in QuickTime 7. Yes, really.
9. Make sure it's full size and then hit this key combo: Command + Shift + 4 which will let you take a screenshot of a portion of the screen. Click-N-Drag out a box that has only what you want the exported QuickTime movie to have. Let go of the mouse. You'll have a screenshot on your desktop.

Note: You can just watch the cursor here to get the numbers right before you let off the mouse but it's up to you.

10. If you didn't memorize the numbers the cursor showed in step 9 before you let off the mouse go and look at the Get Info of the screenshot (on your Desktop) that you just took. Depending on how you have your Finder options set up, you make see the size of the image listed under it or next to it. If you don't, highlight it, tap Command + I for "Get Info" and look for "Dimensions" under "More Info:"

Lets just say it's 604 X 636, for fun.

11. While you have your QuickTime clip opened in QuickTime hit Command + I for "Show Movie Inspector" and jot down the size under the "Format" line. Let's say ours is 830 X 876 to make things interesting.

12. MATH TIME!!!!  Now we can rough in the crop numbers.

For the top to bottom take the actual height and subtract the desired height: 830 - 604 = 226. Now divide (we're distributing it equally) it by 2 and we get 114.

For Top and Bottom in MPEG Streamclip's Cropping line enter 114.

Now for the side to side: 876 - 636 = 240 and divided by 2 that equals 120. Type 120 into both the Left and the Right boxes in MPEG Streamclip.

13. Hit the bottom-left "Preview" button at the bottom.

Is it close? Told you we roughed it in.
Adjust the cropping numbers until you're happy.

In my test my final numbers were:

Top: 114  Left: 120  Bottom: 127  Right 124
instead of:
Top: 114  Left: 120  Bottom: 114  Right 120

Oh, and fee free to monkey with the Center options in this window as well. The Positive Numbers in the first box will move your image to the RIGHTWARDS while Positive Numbers in the second box will move your image DOWNWARDS.

Honestly, I'm not sure why it's off like that but I've used this method to rough it in for a while. I discovered it when I was on a company's Mac that didn't have an image editor at the time and the IT people (Grrr…) REFUSED to allow me to install an image editor to make an image mask with.

Sure there are other ways but they usually involve people mentioning VisualHub which is getting mighty long in the tooth and is totally unsupported now (sniff…) or they're even more convoluted than these two methods. If you have another way you like please pass it along.

QuickTip: Keep a flash drive on in your pocket with Gimp installer (it's FREE) on it but it's not much help if you don't have Admin access to the machine anyway. There are ways around this though.

Thursday, January 20, 2011

Ripping DVDs to ProRes

ProRes is really great but it has some limitations you should know that can trip you up later.

A friend called me tonight saying they were getting an error in Final Cut they'd never seen before which was this:


"Codec not found. You may be using a compression type without the corresponding hardware card."

I knew this wasn't true after talking to them a bit so I asked from step one what they did and discovered a big gotcha when ripping DVD content to ProRes for use in Final Cut Pro.

They'd used MPEG Streamclip to rip video from a client's DVD of old footage. Since my friend wanted to use the footage in Final Cut they set MPEG Streamclip to export (transcode) the .VOB file to ProRes.

(No, I'm not sure why MPEG Streamclip lists ProRes twice in it's export options. They're likely HQ and non-HQ but I'm certain.)

When it was done the file was great, imported into Final Cut and they happily edited away. Until they needed to render something and saw the above error. Any kind of rendering produced that error which we knew wasn't true because they had used ProRes many, many times before. Something else was different.

Dissecting the project I started to jot down all the settings and media types in the project and ran across something not readily apparent unless you know to check.

The resultant ProRes file from MPEG Streamclip wasn't a compliant size for ProRes. It wasn't either:

1920x1080
or
1280x720

If it's neither one of those sizes Final Cut pro runs and cries in a corner. My friend had left MPEG Streamclip to create a file that was 854x480 because next to it, in MPEG Streamclip's options, it reads "(16:9)" which this footage was and their thinking was that since it's a DVD they didn't need to rip it as an HD file.

I suggested they re-rip the bit of video they needed with MPEG Streamclip set to "1280x720 (HDTV 720p)". They did and after substituting the file for the renderless one Final Cut behaved as expected and rendered away.


So if you rip something to ProRes make sure it's a size that ProRes and Final Cut are expecting.

For more info check out this page in the FCP 7 manual.

Sunday, May 24, 2009

VisualHub Can't Convert .flv Anymore?



A client has handed you (meaning you've used Command + Option + A in Safari to open the Activity Window and downloaded that really cool video from YouTube to email your friends) a .flv that they need in some other format for something or other. Opening it in VLC you see that it's h264/mp4a and VisualHub begets you an error like "Cannot allocate temp picture, check pix fmt"

What do you do? Well, you can try altering the Decoding parameter in VisualHub to be QuickTime or ffmpeg or whatever but your luck will vary. It may just work, or need Perian or may never work. flvs are fussy like that.

Even the power of QuickTime alone won't do it; you need 3x the transcoding power.

A) Install Perian
B) Install MPEG Streamclip.
C) Launch MPEG Streamclip and drag your fussy .flv into it.
D) Export it to H.264 (QuickTime) or the codec of your choice.

See, QuickTime + Perian will PLAY the .flv but when you export it it'll likely be MOS (Mit Out Sound). But, opening it with the power of Perian plus exporting it with the power of MPEG Streamclip will result in a transcoded file with audio.

Yup. You didn't even have to restart :) The only downside is that the resultant file will be 60-70% larger than the original .flv but monkey with the settings in MPEG Streamclip and you can bring that down significantly without very much of a loss in quality at all. The first thing to change is the Data Rate with a lower kbits/s. Also, unless you need really high quality audio, try lowering the audio to 22.050 kHz.

Great, thanks, Mr. Not Bruce, but how do I delete these two apps now?

From Perian's site:

How do I remove Perian?
Open the System Preferences. Select the Perian pane and 'Remove.' Now 'Show All' preference panes, control-click the Perian pane and 'Remove "Perian" Preference Pane.


As for MPEG Streamclip...just drag it to the trash.