Author Topic: LQ video compression in Canon DSLRs  (Read 10224 times)

cihub

  • New to the forum
  • *
  • Posts: 13
  • 650D with kit lens
LQ video compression in Canon DSLRs
« on: January 08, 2013, 12:18:37 PM »
Hi everyone!

Currently I'm choosing which DSLR camera to buy. After reading some articles I decided that Canon and Nikon suit me best.

Since my main intention is to shoot video, I decided to analyze raw samples (which were downloaded from imaging-resources.com). After watching some of them, I couldn't get reed of a feeling that Canon videos are somewhat washed-out. At that moment I couldn't say what was the cause, but being kinda geekish and knowing some stuff about video processing I used some filters to analyze images further. At the end, it became obvious that Canon uses bad compression algorithms: it simply drops detail and makes little use of temporal relation between consecutive frames.

After finding out that there's such a thing like ML and it can increase bitrate, I thought it may help, but I was wrong: videos with higher bitrate mainly had increased file size rather than image quality. Well, there was also less compression defects, but overall it was practically unnoticeable.

And only yesterday I finally understood what was one of the main causes of bad video compression: Canon DSLRs doesn't use CABAC (google it if you don't know it's impact on video compression; in a few words, w/o it AVC (H.264, MKV, x264) ~= ASP (AVI, XviD)). Apart from that, I also noticed that Canon DSLRs produce twice as large files compared to Nikon, which, in it's own turn spins the wheel and forces you to buy faster, bigger and more expensive memory cards (class 10 @ 30mbps vs. x2 UHS-I @ 90 mbps).

Now, I don't know whether modern Canons worth buying, even if considering that they have ML... Thus my question: is it possible to somehow change compression algorithm? Crazy, I know, but otherwise Canons are too expensive. Also, if one will consider the fact that CABAC requires more processing power, and ATM Canon 650D empties battery faster than Nikon DXXXX (another fine "feature" from Canon: either buy additional battery, or battery with battery grip), it may be 100% not worth it.

P.S. I'm considering Canon *only* because of ML.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: LQ video compression in Canon DSLRs
« Reply #1 on: January 08, 2013, 04:49:44 PM »
I can CABAC on 6D. BR can be controlled. You can set it to use whatever QP and BR you want. If you want big files you get big files, if you want small files you can do that too.

Digic IV is a different story tho. Not as much control, just QP/Deblock/QPc+y offsets. 650D is probably like this, but I haven't looked in. DigicV should have profile 5.1 high/CABAC available regardless of rate control methods but I don't have this camera.

The main problem is stopping from having cards that are too slow to record 100+ Mbps.

cihub

  • New to the forum
  • *
  • Posts: 13
  • 650D with kit lens
Re: LQ video compression in Canon DSLRs
« Reply #2 on: January 09, 2013, 03:15:19 PM »
1%,
Thank you for your reply. I've analyzed only 500--650D video and stupidly decided that all Canons doesn't use CABAC...

BTW, according to this post it is possible to use CABAC. Have you heard that someone used it?

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: LQ video compression in Canon DSLRs
« Reply #3 on: January 09, 2013, 04:12:08 PM »
I used it. Just wish the 4x4 scaling matrixes worked right. DigicV only though. Only 5d3 and 6D figured out right now.

I started messing with the config file based on that post.

Yoshiyuki Blade

  • Member
  • ***
  • Posts: 103
  • 5D2
Re: LQ video compression in Canon DSLRs
« Reply #4 on: January 09, 2013, 05:40:29 PM »
The efficiency of compression shouldn't affect the contrast of the video (looking washed-out, etc). Canon's video clips should look pretty close to the "picture style" chosen for recording. If the samples you downloaded were recorded with, for example, a Neutral "picture style" with -4 contrast, it *should* look pretty washed out lol. People intentionally choose "flat" styles for a easier post processing.

There's also a problem with how videos are encoded (with the 5D2 at least). Normally, images take up the full range (0-255) on the histogram, but in video it's recorded in the YV12 color space using rec.601 coefficients. If you play it back as-is, it'll look wrong for a couple reasons, but biggest one is that the shadows and highlights will be clipped. The YV12 space assumes limited range (aka TV range, 16-235) and will ignore everything else. To be honest, this actually makes the image look *less* washed out, but it's incorrect nonetheless. However, this is also a blessing because the camera didn't just throw away the full range of detail or downscale it carelessly. Some post processing has to be done to properly bring the full range into limited range.

cihub

  • New to the forum
  • *
  • Posts: 13
  • 650D with kit lens
Re: LQ video compression in Canon DSLRs
« Reply #5 on: January 10, 2013, 10:29:09 AM »
1%,
Thanks again.

Yoshiyuki Blade,
I really doubt that clipping to a TV range could do that, but, than again, I'm a relative noob in this kind of stuff... In any case, here's a few screenshots so that you could see what I'm talking about.
Sample: yvid_T3I_1080_30fps_MVI_1175.MOV;
frame: #30;
type: original, difference in luma, shadows +100, light -100, saturation +100, contrast +100

Sample: yvid_D5100_1080_30fps_HiQ_DSC_1188.MOV;
frame: #30;
type: original, difference in luma, shadows +100, light -100, saturation +100, contrast +100

P.S. All images ~3MB.
P.P.S. BTW, flattening of image by choosing wrong settings could be the real cause (esp. considering the fact that Nikon shoots fully automatically (?)), but... well... in this case it's hard to prove.

Yoshiyuki Blade

  • Member
  • ***
  • Posts: 103
  • 5D2
Re: LQ video compression in Canon DSLRs
« Reply #6 on: January 10, 2013, 08:05:54 PM »
Yeah, I grabbed the same video sample and it seems your screenshots were taken at the full range (unclipped). I opened it up in MPC-HC and it clipped the bushes in the shadows completely, but it looks "as intended" when loaded into AVISynth and converted to RGB with the proper matrix. Anyway, the contrast looks like what I'd expect from one of the default picture styles though; there's nothing out of the ordinary with how it looks. If the photographer took a RAW still shot and loaded it into Canon's bundled software (Digital Photo Professional) working in the sRGB space, it'll look very close to that, minus the obvious resolution and quality difference.

It does look rather mushy though, since there's a ton of high frequency detail, high motion and deep DoF at a (relatively) low bitrate, and at 30 fps to boot. If other cameras can handle those conditions with higher AVC profiles/features, then that would be pretty impressive. I'm not sure if CABAC (a 10-15% quality improvement) would make or break the quality in this case though.

cihub

  • New to the forum
  • *
  • Posts: 13
  • 650D with kit lens
Re: LQ video compression in Canon DSLRs
« Reply #7 on: January 10, 2013, 09:43:54 PM »
You're probably right. Also, I've read that Canons just shoot in that way -- washed-out compared to Nikon, so it's probably some sort of a feature and not something related to compression. It's funny, and sad at the same time, that even having raw videos it's hard to tell which camera shoots best (or at least whether they are equal enough)...

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: LQ video compression in Canon DSLRs
« Reply #8 on: January 11, 2013, 01:00:04 AM »
Heh, I guess I'll have to post up samples of the new compression (and broken 4x4 matrix files). No leaves right now tho and the indoor stuff doesn't have enough motion.

Now canon uses rec.709 and when you add the matrixes some crazy pro HD formats.

Yoshiyuki Blade

  • Member
  • ***
  • Posts: 103
  • 5D2
Re: LQ video compression in Canon DSLRs
« Reply #9 on: January 11, 2013, 11:07:50 AM »
So they finally use the appropriate matrix now eh? The rule of thumb I read about a while back was to use rec.601 for SD resolutions and rec.709 for HD. The weirdest thing about these older video modes is that they are recorded with rec.601 and flagged for rec.709 on playback, making the colors look even more off than usual. It's particularly noticeable in the reds, which come out more orange than they should. It's all easily remedied in post though.

Marvin

  • New to the forum
  • *
  • Posts: 31
  • Personality is destiny
Re: LQ video compression in Canon DSLRs
« Reply #10 on: January 12, 2013, 12:23:35 AM »
Heh, I guess I'll have to post up samples of the new compression (and broken 4x4 matrix files). No leaves right now tho and the indoor stuff doesn't have enough motion.

Now canon uses rec.709 and when you add the matrixes some crazy pro HD formats.

Only 5D3, 6D, 1DX and 1DC use Rec.709 space, and the "VideoFullRangeFlag" seems to be off by default in the perimeters.
Film is truth 24 frames per second.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: LQ video compression in Canon DSLRs
« Reply #11 on: January 12, 2013, 02:48:28 AM »
So probably should not turn it on in ivaparam configs?

Marvin

  • New to the forum
  • *
  • Posts: 31
  • Personality is destiny
Re: LQ video compression in Canon DSLRs
« Reply #12 on: January 12, 2013, 05:11:20 PM »
Turn the full range flag on is better i think
Film is truth 24 frames per second.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: LQ video compression in Canon DSLRs
« Reply #13 on: January 12, 2013, 05:15:25 PM »
Seems like some people had trouble getting it to process full range correctly in linux editing apps from what I've read. The guy was stripping the flag off so it wouldn't clip everything in the RGB conversion. On my PC, the videos seem to play back correctly without lifted black level but I'd have to check how one without the flag and one with the flag plays back. AE/vegas/fcp should read this flag correctly, should they not? Same for MPC-HC

Yoshiyuki Blade

  • Member
  • ***
  • Posts: 103
  • 5D2
Re: LQ video compression in Canon DSLRs
« Reply #14 on: January 12, 2013, 09:08:12 PM »
This is a bit of conjecture, but I think with the flag on, it should play back correctly as long as the player accounts for it (no clipping). With it off, the player will assume TV range and clip everything outside the 16-235 range.

I can probably test this with x264 to find out how it works once and for all.

Edit: I have to set --input-range pc and --range tv for proper playback. Everything will be mapped correctly that way, but it'll behave as if the luma range was crushed and stretched, so there's information loss. You can easily see the gaps on the histogram where the range is being stretched.

Edit2: MPC-HC with the Haali renderer can output the full range with no information loss if you specify it manually. The histogram shows a smooth curve. The downside there is that you have to specify it manually.

Quite frankly, outside of editing, it's a good idea to "compress" the levels to TV range at the end since most players assume TV range.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: LQ video compression in Canon DSLRs
« Reply #15 on: January 12, 2013, 11:58:12 PM »
Maybe it was just a problem in the linux workflow then. I always output video levels for final product but the worry was that players and NLEs would do funky stuff in the conversion. Either way you can set it on or off to your liking in the config.

3pointedit

  • Senior
  • ****
  • Posts: 263
  • 550D
Re: LQ video compression in Canon DSLRs
« Reply #16 on: January 13, 2013, 07:23:41 AM »
I am constantly surprised by the need to decrease compression when the image is broken to start with. Under sampling with binning instead of decent scaling kills more detail surely?
But I wonder what the 5DIII does to aleviate the moire? Does the 6D do it too?
550D on ML-roids