View Single Post
Dorian Gray
Veteran Member
 
Join Date: May 2005
Location: Paris, France
 
2006-02-20, 23:39

Hi there,

Not sure how much you know about video, but here are a couple of tips to help you find a solution. ".m2t" is a file extension for MPEG-2 Transport Streams, and as you've noticed, these files can sometimes be a bit of a hassle to turn into something a bit more usable.

You've started well by using MPEG Streamclip, which is a good tool for this kind of thing. You should approach this in two steps: use MPEG Streamclip to export the video with a lossless (perfect quality) QuickTime codec, and then export that intermediate file from within QuickTime Pro using a suitable delivery codec. The reason I would do the intermediate encode is that it's very difficult to edit video if it's in a delivery format (because the long keyframe interval causes huge seek delays) and it's also very tricky to get accurate bitrate control from within MPEG Streamclip.

Both ".mov" and ".avi" are containers rather than codecs: they are file formats that are capable of holding video and audio encoded with various codecs (among other bits and pieces of information). For subsequent editing (or simply exporting) in QuickTime Pro, you should stick with a ".mov" format, which guarantees compatibility with QuickTime. Depending on the lossless codec you use for the intermediate encode, you will need somewhere between a huge and an obscene amount of free disk space, though this could be an external drive of course.

So, which lossless codec should you use? This depends somewhat on the content you are encoding, and the balance between your computer's processor power and hard disk size/speed. By the way, leave the sound as uncompressed stereo (QuickTime can encode to anything from this) and make sure the Frame Size is identical to your source video: enter it manually if need be.

For animated video use the "Apple Animation" codec (this is only lossless when the quality slider is set to 100%). This codec works in the RGB colour space and is good at compressing solid blocks of colour of the kind typically found in animation. Using it for video will do no harm - it's lossless afterall - but it will result in very poor compression, sometimes even resulting in a file larger than uncompressed video. It is moderately processor intensive and extremely disk intensive.

"Apple Component Video - YUV422" is an uncompressed codec that operates in the YUV colour space, with 4:2:2 chroma subsampling (for practical purposes this means that it's only lossless if your source video is in the YUV colour space, which it won't be in your present case). Useful when importing analogue video. The quality slider in MPEG Streamclip has no effect on this codec. It is very disk intensive but doesn't use much processing time.

You're probably familiar with the PNG lossless compression format for still images. "Apple PNG" simply compresses each frame of video as if it were a still image, using the RGB colour space. The quality slider in MPEG Streamclip has no effect when using the Apple PNG codec. This may be an appropriate codec for your intermediate encode, as it should preserve all the colour information in your original video. It is very processor intensive but gives relatively good compression.

"Apple Motion JPEG A" is lossless if you set the quality slider to 100% (though for practical purposes 85% may be as good as perfect). It uses the YUV colour space (4:2:2 again), so will not preserve all colour information from an RGB source. The "Apple Motion JPEG B" codec is identical except for compatibility differences for old hardware. This codec is much less processor intensive than Apple PNG and provides significantly better compression too, but at the expense of a loss of some colour information (which may be perfectly acceptable in your case).

I tested these codecs with a 10-second ".m2t" video clip of outdoor sports (file size 50 MB, 25 Mbps, 1440 x 1080 pixels, 29.97 fps) and these were the results:

"Apple Animation" at 100% quality: 950 Mbps (nearly 1 Gbps!!!), file size 1.2 GB.
"Apple Component Video - YUV422": 750 Mbps, file size 940 MB.
"Apple PNG": 360 Mbps, file size 450 MB.
"Apple Motion JPEG A": 215 Mbps, file size 270 MB.

My hard disk is only fast enough to play the last option in QuickTime Player, but all of them provide perfect quality video frames (with slightly different colour rendition). Note that my slow hard disk would not prevent QuickTime encoding them to a delivery codec - the encoding would simply take place at a pace slower than real-time, likely limited by processor rather than disk in any case. From the file sizes I got in my test, I would guess you would need 20 GB of free space for an Apple Motion JPEG A encode, 40 GB for an Apple PNG, or 80 GB for an Apple Component Video encode. I suggest you try Apple Motion JPEG A first, as it requires the least disk space and is pretty fast compared to the other options.

Then open the encoded ".mov" file in QuickTime, edit as required, and export to a delivery format of your choice. For near-DVD quality video I would suggest H.264/multi-pass/1500 kbps/100-frame keyframe interval (for video) with AAC/44 kHz/Stereo/128 kbps (for audio). This would result in a final video size of about 610 MB, which you can put in either a .MOV or .MP4 container depending on your preference. If you want a different file size (much smaller or bigger), adjust the bitrate and/or frame size accordingly. Ask if you want some starting points.

Quote:
Tangent: arent most codecs designed to COMPRESS raw video? Why are all these codecs actually INCREASING the size of the file? Its not like their going to eek any more quality out of the video from its raw format.
Not all codecs are designed to compress video. Some are for editing or intermediate encodes (such as the ones I suggested above), and these often sacrifice small size for other qualities, such as lossless compression or good seek times. Delivery codecs such as MPEG-4 are designed to make the final file as small as possible. However, the ".m2t" file you have is already very heavily compressed (with the MPEG-2 codec, as used on commercial DVDs for example). This is why some of the options are making the file a lot larger. Incidentally, by adjusting the quality slider in MPEG Streamclip you could probably make the files a bit smaller, but Apple Pixlet Video, etc. will always result in a vastly larger file than MPEG-2.

Hope this helps.
  quote