Lossless h.264 editing and washed out picture (Mac OS X)

Thomahawk

Mu-43 Regular
Joined
Jun 28, 2013
Messages
27
Location
Switzerland
Real Name
Thomas
Hello all. This is my first post and I want to share some of my experience regarding clips editing. I use the Olympus EP-L5 at least as much for video shooting as for photography.

I am used to produce video in Final Cut Pro or FCPX, but I wanted to preserve all the original sharpness and color and not go through reencoding. Originally my plan was to cut the h.264 clips in QuickTime Movie Player or SimpleMoxieX, join several cutted clips and save them lossless without reencoding - to preserve 100% the original quality.

Unfortunately cutting and join the clips resulted often in display problems - flickering, distortions and the like - even when respecting keyframes for the cuts, like it is possible with SimpleMovieX. So, my lossless approach proved to be impossible and I acccepted the fact that I need to reencode.

Unfortunately again, that brought me into another problem. I used Final Cut Pro X and I was very disappointed how washed out the video looked compared to the original clips. All the crispy picture got lost. I went to the older Final Cut Express (which, by the way, was the only app able to safe all the already lossless cut clips I had stored and could not join together without display problems) and Final Cut Pro both gave a better result. The colors did not appear so much washed out anymore when I watched the reencoded videos. BUT... in direct comparation to the original clip, still the original was way better in color accuracy and color depth and also sharpness. To preserve the orginal sharpness, a quality setting was necessary which results in bigger MB clips than the original.

I must say it really disappoints me to see (once again) how sloppy Apple is nowadays. Whatever I tried, after exporting a reencoded .mov file with .h264, it never was so good as the original. Compressor gave me the opportunity to fine-tune contrast and color, but while the result looked okay (not identical but okay) to the original in Movie Player, VLC showed it completely different.

FINALLY I came across this article which solved this problem:
How to Fix the H.264 Gamma Shift Bug in Quicktime, FCP, & iMovie | Byteful Travel

Basically, the problem is how Apples H.264 export handles gamma inaccurately. Thanks to Mochizuki Takahashi, we have a solution now. He created another quickTime export component for h.264, which can be set to use gamma correctly. It is called x264Encoder. Exporting as QuickTime movie, reencoding using x264, the color results in absolute accuracy to the original.

BUT! I thought I could let my original clips from the camera and cut them in Final Cut Pro 6.0. Unfortunately the exported file shows the same flickering and distortions during some of the clips like I had before when cutting the clips in QuickTime. I even tried joining all clips in QT, cutting and instantly exporting with reencoding and got the same problem.

Strangly, Final Cut Express HD can cut and organize the files, even the ones I already cut before in QT Movie Player 7, and export reencode them perfectly without the flickering or distortion, but FCE HD is not able to preserve the original sharpness. Somehow I suppose it goes trough interlace and deinterlace or something like that, because it seems not to possess a 1080p setting, only 1080i.

Final Cut Pro X is the most bad of all regarding the washed out image. Even by exporting using compressor and setting up x264 there, the resulting video is far off the original colors.

So far I have not found a way to cut clips from the Olympus Pen E-PL5 without inacceptable loss of image quality. The most promising attempt was cutting in QuickTime Player 7 or SimpleMovieX and reencode each clip instantly, later join them all together, but the problem then was, each clip gets its own audio track and is not joined into one track, which makes it impossible to play in players like VLC and the like.
 

Thomahawk

Mu-43 Regular
Joined
Jun 28, 2013
Messages
27
Location
Switzerland
Real Name
Thomas
Kevinparis, thanks for your post. Who does not know that about h.264? Try Olympus. But for some reason, they chose h.264, so thats what we have to work with.

That being said, back to the problem: my last try was opening several clips in SimpleMovie X, directly cutting with respecting keyframes and exporting reencoding x264. Resulting files were perfect in color and sharpness. The Audio got into one track... BUT, again flickering and distortion appeared on some of the cuts.

I will continue to investigate solutions to get edited video as close as possible to the original, and will post my experiences here. Well, at least I found a solution to the color problem already. Stay tuned.
 

kevinparis

Cantankerous Scotsman
Joined
Feb 12, 2010
Messages
3,912
Location
Gent, Belgium
Kevinparis, thanks for your post. Who does not know that about h.264? Try Olympus. But for some reason, they chose h.264, so thats what we have to work with.

That being said, back to the problem: my last try was opening several clips in SimpleMovie X, directly cutting with respecting keyframes and exporting reencoding x264. Resulting files were perfect in color and sharpness. The Audio got into one track... BUT, again flickering and distortion appeared on some of the cuts.

I will continue to investigate solutions to get edited video as close as possible to the original, and will post my experiences here. Well, at least I found a solution to the color problem already. Stay tuned.

think you will find all consumer/prosumer cameras and indeed many pro cameras use long GOP formats such as h264 or AVCHD... so don't blame Olympus.

The alternatives produce massive files at the point of capture, which creates a whole new set of issues.

I will try some experiments with my OMD and FCPX later today and see if I can shed any light on your issues

cheers

K
 

Thomahawk

Mu-43 Regular
Joined
Jun 28, 2013
Messages
27
Location
Switzerland
Real Name
Thomas
No blames were made. Like I said, they must have had their reasons. And yes, consumer cameras usually use those codecs, and yes, h.264 is not good for editing - we all know that. Would you please stop stating the obvious just for the sake of making posts. I am making a report here which should help others with the same problem. Filling this topic up with unnecessary comments doesn't help anyone. Thanks!
 

Thomahawk

Mu-43 Regular
Joined
Jun 28, 2013
Messages
27
Location
Switzerland
Real Name
Thomas
Here are two examples. First the color problem caused by the gamma shift bug in QuickTime. You see exported video from Final Cut Pro, Pro X, iMovie 9, on the left, the original on the right side:

mu-43-color.png
Subscribe to see EXIF info for this image (if available)


Now the example showing flickering/distortions like they happen after cutting and join without reencoding (left) and the original (right side):

mu-43-distort.png
Subscribe to see EXIF info for this image (if available)


Now an overview of the applications I tried. This only involves the results export using Takahashis x264Encoder, because like said, standard h.264 QT export always results in washed out colors. I only state the problems, not mentioning the things that work - color, sharpness, distort, audio:

Final Cut Express HD reencoded: Sharpness lost.
Final Cut Pro 6.0 reencoded: Distorted at some cuts
Final Cut Pro X reencoded: Colors washed out
iMovie 09 reencoded: Colors washed out
QuickTime Player 7 lossless cut: Distortions, several audio tracks
QuickTime Player 7 reencoded: several audio tracks, stuttering
SimpleMovieX lossless cut: Distortions, several audio tracks
SimpleMovieX reencoded: several audio tracks
 

Thomahawk

Mu-43 Regular
Joined
Jun 28, 2013
Messages
27
Location
Switzerland
Real Name
Thomas
My advice (best solution at the moment):

1. I open and cut each clip in SimpleMovieX, only cut at keyframes, and export (reencode) QuickTime movie using x264Encoder (no nclc atom, gamma 2.2 off). Audio setting: without any compression.

2. I join the clips in SimpleMovieX (unlike in QuickTime Player 7 where I have to open copy/paste clips by clip. I then can actually just drop a list of clips into SimpleMovieX) to join them - and save movie (not reencode).

3. From QuickTime Player 7, I export audio only, in AAC optimal 256kbit/s and extract the video track.

4. I add the AAC audio track to the extracted video track and save the movie without reencoding.

The resulting movie plays fine in any QT based player or VLC, m-player and the like. Colors, color depth and sharpness are accurate to the original (no difference is visible even in direct frame by frame comparation). No distortions detectable anywhere.

This workaround is complicated of course and cutting/editing a video clip by clip like this is not as comfortable as editing in FCPX, but if you value getting 100% the image quality of the original clips produced by the Olympus PEN E-PL5, you may get used to it. At least I do.
 

kevinparis

Cantankerous Scotsman
Joined
Feb 12, 2010
Messages
3,912
Location
Gent, Belgium
No blames were made. Like I said, they must have had their reasons. And yes, consumer cameras usually use those codecs, and yes, h.264 is not good for editing - we all know that. Would you please stop stating the obvious just for the sake of making posts. I am making a report here which should help others with the same problem. Filling this topic up with unnecessary comments doesn't help anyone. Thanks!

really... you believe "everybody knows that"

I think you will be surprised

K
 

kevinparis

Cantankerous Scotsman
Joined
Feb 12, 2010
Messages
3,912
Location
Gent, Belgium
OK

So I did a quick test... some footage shot with the OMD @ 1080p - should have similar video characteristics to the e-pl5

Imported the footage to FCPX, created a project, did a few edits and shared for Apple device 1080p.

I am seeing no colour shifts, loss of sharpness or any other weirdness at all.

Screen_Shot_2013-06-29_at_18_02_17.png
Subscribe to see EXIF info for this image (if available)


Not sure what you are doing or how you have got to where you are... but you seem to be making a simple problem very difficult.

I am in the process of uploading the test movies to my dropbox for you viewing... it may take a while... not because the files are big... just I am on a slow net connection

folder - Video test

https://www.dropbox.com/sh/f0y1uq31jtfwnzu/CLIWASSOtL

regards

K
 

Thomahawk

Mu-43 Regular
Joined
Jun 28, 2013
Messages
27
Location
Switzerland
Real Name
Thomas
Please. If you do not have this problem, why for heaven’s sake do you post here? This topic is for people who have the same problem and want to solve it.

(By the way, your example only proves that your edited video is not color identical to the original too, but if the result is okay for you, thats great and I am glad for you. So, be happy and let it be. Thank you.)
 

kevinparis

Cantankerous Scotsman
Joined
Feb 12, 2010
Messages
3,912
Location
Gent, Belgium
thomas

You are new here.. perhaps you don't fully understand the culture of this forum. It is not a forum that is big on video.

I happen to be one of the minority who do take an interest in it, and as someone with some experience of video, on the Mac platform and with Final Cut in all its manifestation ( I worked at Apple Europe for 10 years promoting, demonstrating and sometimes supporting Final Cut), I was intrigued with your problem.

However you presented your issue, and your convoluted solution, and all I did was a short experiment, that illustrated that counter to your complex solution, that simply using FCPX as it was intended produced a result that to my eyes did not present any of the issues you were encountering.

Did this offer a solution to you.. perhaps not... but it does present an alternative case for others perhaps reading this topic in the future.

I do hope you find a solution to your problem, but suspect that it wont be on this forum

K
 

Latest threads

Top Bottom