Author Topic: Bit rate investigation  (Read 74212 times)

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #50 on: July 25, 2012, 11:16:48 AM »
Can't access ML on your autoexec, trash button doesn't do anything.
I can access it only while in LV mode. Still, the continuous redrawing of the screen doesn't allow me to set things properly.
Send this patch to A1ex and let him compile the whole, maybe?
I can test it right now.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #51 on: July 25, 2012, 11:19:00 AM »
Quote
mvrSetDeblockingFilter
I've tried these, but could not notice any effect, even at CBR 0.1. Maybe my eye is not trained for this.

Those mvr functions set values in mvr_config structure. I prefer to set them manually, rather than calling mvr functions (because you have access to all parameters in a portable way).

They have usually one argument - a pointer to an array (or structure) containing all the parameters they use. They are also registered via the call-by-name (eventproc) mechanism.

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #52 on: July 25, 2012, 11:21:19 AM »
Well, i just shut the camera off with this autoexec while still in LV and the camera generated a strange noise or a series of very fast beeps, i can't understand.
What is this? :S
I can record it if you want.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #53 on: July 25, 2012, 11:27:33 AM »
Beeps?! Like autofocus beeps?

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #54 on: July 25, 2012, 11:31:19 AM »
Nope, and by the way beep is always disabled on my 50D (just double checked it) .
This is the noise. It has never done it with any other build, just with this one from 1%.
https://dl.dropbox.com/u/1087972/ML/strange%20noise.WAV
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #55 on: July 25, 2012, 11:34:10 AM »
Very cool - if I know how to get these from normal ML, we could solve the audio sync part :d

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #56 on: July 25, 2012, 11:37:43 AM »
Lol, it does it only when i turn the camera off while in LV but it is not reproduceable because it doesn't always occur.
Ask 1%, i never experienced such stuff.
What might it be, in your opinion?
I can't understand if it's coming from the little speaker placed in the back cover or it is something related to the screen trying to shut down (and all the electronics related) .
Does the LCD driver have the ability to trigger sounds (ok, that was just a wild guess) .
Anyway, you should probably allow users to fiddle with each available setting related to the encoder.
I can't test with this build, i don't know if it's my 50D that doesn't like it.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #57 on: July 25, 2012, 11:41:49 AM »
If 1% can post a diff of the code, maybe I can figure out what's going on.

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #58 on: July 25, 2012, 11:43:15 AM »
See this, the datasheet of the LCD driver.
https://dl.dropbox.com/u/1087972/ML/hint.jpg
That could be it ;)
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #59 on: July 25, 2012, 11:45:23 AM »
So... we triggered the buzzer by mistake? :D

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #60 on: July 25, 2012, 11:51:05 AM »
Probably, why did it buzz anyway?
It doesn't do it all the time, can you take his code and try to log what happens at shutdown?
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #62 on: July 25, 2012, 05:08:03 PM »
If you're having issues with the menu its because I disabled menu piggyback and menu closing to have access to ML while in the movie player. I guess this is the side effect. I can take it off.. I think we've learned all we need from play mode.

2 audio registers may be switched on other cameras from when I was audio testing with them. Can't really think of anything else.

unity2k

  • Global Moderator
  • New to the forum
  • *****
  • Posts: 23
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #63 on: July 25, 2012, 05:18:06 PM »
I'd like to add a thought, maybe not the smartest, but anyway. What if upon the start of recording video, a sync sound is recorded, both on camera and on an external audio device, at this point the audio is disabled on camera and the CBR is pushed higher, as the recording approaches the end of what is needed to be filmed, a button push lowers the CBR, audio is re-enabled and a second sync sound recorded? Then in post the sound could be synced back to the footage (think PluralEyes).

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #64 on: July 25, 2012, 05:43:01 PM »
But why is the something buzzing?
It is not the usual beep.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #65 on: July 25, 2012, 05:44:58 PM »
Something in audio.c write to those registers on 50D. I only made sure it didn't on 600D.

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #66 on: July 25, 2012, 05:50:53 PM »
But the 50D doesn't have audio so where does it come from?
It could be the LCD driver buzzing but it's just speculating about nothing, really.
Could you generate a beep from the 50D? It has got a tiny speaker for the audio confirmation of the focus and i think that's the only thing it can generate.
What do you think?
Also, what is left about the video compression codec?
Just P and I regulate the amount of data?
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #67 on: July 25, 2012, 06:04:40 PM »
Lots is left about the codec, I looked in the firmware. Can alter the movie recorder to ignore 30 minute and 4gb limit with some effort. that is the only place I see the limit in firmware (so far). Movie recorder is just set to stop on those, nothing in actual file writing stuff.

There are the gop opts to figure out and setting gop length... that deblocking filter.


* look in audio.c and find what is writing to what and then experiment. You'll find your LCD speaker or whatever that makes noise... maybe you have an audio IC thats not used? I don't have 50D. I'll fix the trash button stuff though we have PTP I don't think its needed anymore.

Look through repo/audio.c and see what is writing

https://bitbucket.org/OtherOnePercent/tragic-lantern


*mvrSetD_FULLHD


is this gop length?

The modes:
FULLHD = 1080P?
HD= 720P?
VGA= duh?

5 gop bitrate options for each mode. Good thing is we can now ONLY tweak FULLHD and forget the crazy loops.


50D only:

http://www.qfpost.com/file/d?g=d3NJAuL9W

Does this fix ML menu on 50D?

Chungdha

  • Freshman
  • **
  • Posts: 97
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #68 on: July 25, 2012, 09:11:38 PM »
Any possibility to lower the sound bitrate as its should not be using that much as sound recorder still use standard sd cards with way less bitrate than that, as max sound be just 192kb/s

ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #69 on: July 25, 2012, 09:26:14 PM »
Well, the guys which have initially analyzed the firmware have found references to AK4646 as audio chip but i can't see it on my camera.
I don't know if it is integrated in something else or what, i even asked lensrentals' Roger Cicala about that and he said he couldn't find it even on 5DII and III so that could be a clue and a hope.
Unfortunately i don't know about C and ARM in general, i can just guess and test but i can't surely write any code.
I'm going to try your autoexec and see if it solved the problem with my 50D.
Thanks.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #70 on: July 25, 2012, 09:40:41 PM »
Looking at 50D firmware would probably tell all. Or try writing to power registers of 50D for AK style IC and Lapis style IC.


Quote
Any possibility to lower the sound bitrate as its should not be using that much as sound recorder still use standard sd cards with way less bitrate than that, as max sound be just 192kb/s

You can lower sampling rate. The audio is uncompressed. Its something to investigate for sure.


ilguercio

  • Hero Member
  • *****
  • Posts: 845
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #71 on: July 25, 2012, 09:46:55 PM »
I can't even compile the code, if you know any good manner of getting me started into this i would really appreciate it.
Things started here:
http://chdk.setepontos.com/index.php?topic=6161.75
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #72 on: July 26, 2012, 03:55:38 AM »
Thats a bit of a process... quickest way is to get current ML source and edit the 50D parts. You can compile on linux and mac (yagarto?) not sure on windows. If you don't know anything about C its going to be a tough road.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #73 on: July 26, 2012, 08:45:04 PM »
*Update

Set D1 and D2 values. I get abnormal instant bit rates even over 500 but then MvRecorder seems to reset to regular values without stopping. Maybe there are more hidden things in the other registers?


*Update 2

looking through the fw, gop opts also set the timers? like x67e4;   

D1_30fps;   is never set by canon functions, why?

Register    ; 0x2f is set by BOTH gop opts and D setting functions but I don't see it in the MVR.H

I saw the discussion on google ~(2011) and wow, nobody really looked at this besides alex? Nobody wants higher quality videos to compete with GH1?

Any more hints?

Leon

  • Freshman
  • **
  • Posts: 73
Re: Bit rate investigation - altering ratio between P and I frame sizes
« Reply #74 on: August 01, 2012, 03:19:12 PM »
@ 1% :  How on earth can audio be 40 Mbps?  I just demuxed a video shot with the firmware default, and the audio file is 1.5 Mbps, which is what it should be at 48,000 Hz, 16 bit, stereo:  48000 * 16 * 2 = 125 kB/s = 1.5 Mbps.

The question is why does this 1.5Mbps make such a difference to the max video bitrate allowed?  Does anyone know?

@weldroid :  Thanks for those reduced FPS images.  The difference is obvious.  Even if one may be slightly defocused, there's still a lot more compression artifacts in the more compressed frame, and it would be even more noticeable after editing.