View Full Version : Re-wrap from .mov to .mp4 seems to do something


Keith Paisley
December 29th, 2008, 04:58 PM
Hey all,
I've been messing around a bit trying to circumvent the various issues with the 5D Mk II video files.

I seem to have come across a workaround that fixes one of the issues related to the improper handling of the color gamut when opening the .mov files straight out of the camera.

The first thing I tried was the CoreAVC codec. And the results were fabulous, but I was unable to figure out a way to leverage it into Sony Vegas Pro 8 (my preferred editing platform). All along I've been trying to figure out an easy way to extract the h.264 and audio data from the quicktime .mov container and re-wrap it into something else. This way requires no transcoding. I was hoping to find an easy to use tool in the public domain but haven't been able to find anything. So today I begrudgingly broke down and bought the update to quicktime pro. With quicktime pro, you can export the clips to .mp4 files ("Movie to MPEG-4"), and simply rewrap them. In order to do it, you have to set the video format to "Passthrough" in the options dialogue window.

This seems to fix the color space issues - As you can see in the 2nd image, the histogram (from vegas pro 8) for the mp4 wrapped file now shows no gaps.

now the only thing left that bugs me is vegas' miserably poor AVC decoding speed (using windows media player + coreAVC i can play these 1080p clips at ~20-25% CPU load on my machine (q6600)

http://i42.tinypic.com/2nv8278.jpg http://i41.tinypic.com/2ez43eq.jpg

Tyler Franco
December 29th, 2008, 07:11 PM
Does this make a "visible" difference in the video?

Keith Paisley
December 29th, 2008, 07:35 PM
Does this make a "visible" difference in the video?

yes, there is clearly an improvement in the clips that I have tried, but at this point I'm not certain whether or not it's simply Quicktime's cruddy choice of gamma. I need to find a good clip with shadow and highlight detail to really expose whether or not this is pulling out all of the extra detail.

As a follow-on, I've stumbled across a little tool called mp4box which MAY be able to achieve the same results. So far I've managed to successfully re-wrapper the mov files into .mp4 but in my first few attempts I've been unable to get the audio to come along with it. I think with a bit of fooling around i will probably get it and so far I like it better than the Quicktime Pro way.

Keith Paisley
December 29th, 2008, 10:03 PM
I just grabbed this group of samples from Vegas 8 Pro. One thing I noticed is that there seems to be more visible detail in the darker areas if you set the pixel format to 8-bit rather than 32-bit in the project properties. You can even read the Garmin text in the standard "uncorrected" 8-bit MP4 sample (at least on my display I can read it fairly clearly).

These were grabbed from the timeline using Vegas' "copy to clipboard" feature. The project resolution is 1920x1080x30p. I have my preview window set at Best (Half) so i'm copying a 960x540 image to the clipboard and then cropping in GIMP and exporting to JPEG.

http://i41.tinypic.com/24o7os7.jpg http://i40.tinypic.com/1z32h4k.jpg
http://i40.tinypic.com/2merhas.jpghttp://i44.tinypic.com/35krhc1.jpg
http://i40.tinypic.com/2mfdp9e.jpg http://i40.tinypic.com/6zvbpx.jpg
http://i40.tinypic.com/2evg5ro.jpghttp://i39.tinypic.com/t0p7oj.jpg

I dunno, but it looks fairly promising to me.

Jon Fairhurst
December 29th, 2008, 10:16 PM
I tested this on the "market" video available here: Canon EOS 5D Mark II Hands-on Preview: 15. Video Samples: Digital Photography Review (http://www.dpreview.com/previews/canoneos5dmarkII/page15.asp)

The effect is exactly as desired. I re wrapped the video and applied the Vegas color corrector with the Computer to Studio (0-255 -> 16-235) preset. Comparing the rewrapped video to the original, you can now see blue skies with detailed clouds, rather than white mush with a touch of blue. You can see the details in the blacks as well...

Jay Bloomfield
December 29th, 2008, 10:16 PM
Keith, short of buying Cineform NEO HD, I haven't been able to come up with a decent workflow for Vegas and Canon 5D MKII files. Based on recent statements made in the Cineform forum here, I'm speculating that Cineform may drop the price a bit on a new product that is roughly the equivalent of NEO HD (full 1920 x 1080), but we will have to see.

Keith Paisley
December 30th, 2008, 07:01 AM
I tested this on the "market" video available here: Canon EOS 5D Mark II Hands-on Preview: 15. Video Samples: Digital Photography Review (http://www.dpreview.com/previews/canoneos5dmarkII/page15.asp)

The effect is exactly as desired. I re wrapped the video and applied the Vegas color corrector with the Computer to Studio (0-255 -> 16-235) preset. Comparing the rewrapped video to the original, you can now see blue skies with detailed clouds, rather than white mush with a touch of blue. You can see the details in the blacks as well...

just out of curiosity, what do you have set for the Pixel Format in your project properties? The video (in the preview window) seems to look even better if you set it to 8-bit (as opposed to 32-bit floating point, which seems to be the default for most profiles). Without even using the Computer to Studio color correction, you should see many more details in the sky and the shadows on a re-wrapped into mp4 version of that "market" clip. If you had it set to 32-bit, try it at 8-bit and see what you think.

Tom Roper
December 30th, 2008, 08:27 AM
I'm trying to follow this, but there is some confusion:

1.) The Vegas histogram is used to graph the luminance and rgb values, and this graph for the QT file shows the gaps.

2.) But if you unwrap the QT container to mp4 using QT Pro, the Vegas histogram now has the gaps filled in.

But if the QT Pro is just unwrapping the native mp4 without re-encoding it, then the luminance and rgb values would not have changed. Could it be that Vegas histogram just doesn't display the graph properly for QT wrappers?

And if I am to understand, after unwrapping the QT container to mp4, you would then use Vegas Color Corrector to convert 0-255 to 16-235?

Keith Paisley
December 30th, 2008, 09:11 AM
I'm trying to follow this, but there is some confusion:

1.) The Vegas histogram is used to graph the luminance and rgb values, and this graph for the QT file shows the gaps.

2.) But if you unwrap the QT container to mp4 using QT Pro, the Vegas histogram now has the gaps filled in.

But if the QT Pro is just unwrapping the native mp4 without re-encoding it, then the luminance and rgb values would not have changed. Could it be that Vegas histogram just doesn't display the graph properly for QT wrappers?

And if I am to understand, after unwrapping the QT container to mp4, you would then use Vegas Color Corrector to convert 0-255 to 16-235?

no, what's happening is that since the file has been rewrapped within an MP4 container, vegas is now using the mainconcept AVC/h264 plugin to open these clips instead of the quicktime 7 plugin, which apparently doesn't properly handle the colorspace.

I've determined that mediacoder (100% free) can be used to quickly batch through the source files. Basically the audio clip in the source quicktime is uncompressed, so in order to use the source audio it needs to be compressed into AAC. Mediacoder makes this easy but it takes a little bit of configuration to get it going properly. One KEY thing that I determined is that the mp4 has to have a File Brand of mp42, or at least something other than the ISOM file brand that MP4BOX defaults to.

http://mediacoder.sourceforge.net/index.htm

Jay Bloomfield
December 30th, 2008, 06:20 PM
@Kieth,

I tried rewrapping to mp4 and it does work (good histograms), although the preview frame rate in Vegas is pretty slow for the mp4 file.

BTW, when you rewrapped it to mp4, what bit rate did you use?

Keith Paisley
December 31st, 2008, 07:56 AM
@Kieth,

I tried rewrapping to mp4 and it does work (good histograms), although the preview frame rate in Vegas is pretty slow for the mp4 file.

BTW, when you rewrapped it to mp4, what bit rate did you use?

You don't need to set a bitrate for the video since it is a straight bitstream passthrough (there's no change in the bitrate - it's not a transcode of the video, it's a re-mux - the video is essentially untouched). For the audio I just set it to the max bitrate available (the audio has to be transcoded as MP4 containers can't hold the "sowt" codec).

the re-wrap process is basically demuxing the .mov file out into the h.264 video stream and "sowt" audio stream elements, and then transcoding the audio, and then remuxing the transcoded audio with the original h.264 elementary stream into an MP4 file container.

Elizabeth Lowrey
December 31st, 2008, 03:26 PM
You don't need to set a bitrate for the video since it is a straight bitstream passthrough (there's no change in the bitrate - it's not a transcode of the video, it's a re-mux - the video is essentially untouched). For the audio I just set it to the max bitrate available (the audio has to be transcoded as MP4 containers can't hold the "sowt" codec).

the re-wrap process is basically demuxing the .mov file out into the h.264 video stream and "sowt" audio stream elements, and then transcoding the audio, and then remuxing the transcoded audio with the original h.264 elementary stream into an MP4 file container.

Can you elaborate on how to accomplish this within the mediacoder program? I downloaded and installed it, but I don't see a way to simply select a rewrap, and the documentation (such as it is) is horrible. The wizard makes you select all kinds of options that should be irrelevant in this operation and then apparently applies them when you add a file to transcode in the top window. This results not in a pristine rewrap (without touching the video bitstream) but in a re encode using the default settings you entered in the wizard. How do you do to simply perform a mp4 rewrap?

Keith Paisley
January 1st, 2009, 07:04 PM
Can you elaborate on how to accomplish this within the mediacoder program? I downloaded and installed it, but I don't see a way to simply select a rewrap, and the documentation (such as it is) is horrible. The wizard makes you select all kinds of options that should be irrelevant in this operation and then apparently applies them when you add a file to transcode in the top window. This results not in a pristine rewrap (without touching the video bitstream) but in a re encode using the default settings you entered in the wizard. How do you do to simply perform a mp4 rewrap?

when you install mediacoder, skip the wizard and tick the box so it doesn't bug you with that window every time you open mediacoder. I don't have time at the moment to post a full set of instructions, but I did list out what needs to be done over on the other forum. To avoid re-encoding the video, make sure the "copy video" checkbox is ticked in the "Video" settings tab. That will ensure that the video bitstream is simply copied rather than transcoded.