I'm making a 4:4:4/4:2:2 16/14/12/10-bit codec for Canon DSLR's

neuroanatomist

I post too Much on Here!!
CR Pro
Jul 21, 2010
24,785
2,476
unfocused said:
Is it just a coincidence that Harry revealed some of his code at the same time Prograde announced new 1 tb cards?

Of course not, becuase Harry actually INVENTED the new Prograde 1 TB card. He has many PATENTS on it, and he's prepared for an extended COURT BATTLE around his IP.
 

bhf3737

---
CR Pro
Sep 9, 2015
643
1,387
Calgary, Canada
www.flickr.com
HarryFilm said:
---

I ain't no mere beginner in this...Here is how to do SIMPLE AND EFFECTIVE EDGE DETECTION from MY OWN CODE i designed all by myself from scratch which WILL run on ARM, Intel/AMD, MIPS, IBM Power, SuperSPARC and various DSP processors
INCLUDING the Canon DIGIC series:

COPY this code to a Landscape-mode using 10 point narrow font in a word processing document to see the entire RATHER NICELY DOCUMENTED code segment.
THIS BELOW CODE SEGMENT IS FULLY GNU GPL 3.0 OPEN SOURCE LICENCE FOR YOU programmers: Have at it for modification but REMEMBER to keep your work and modifications to this code to the GNU GPL 3.0 licence terms!
[...]

Your posted code is mainly an implementation of convolution kernel.
A simple intro: http://setosa.io/ev/image-kernels/

Convolutional kernel is a fundamental operation for image processing, isn't it? There are thousands of implementation of it in image processing textbooks. But your code implements it in the most primitive form, to the extent I understand.
I appreciate your effort for posting it. But there are a number of issues.

First the filter size:
For a 4x4 filter there will be 16+16 reads (get pixel from input and filter) for every write (to output)
For larger filters such as 16x16, 256+256 reads for every write. You see where I am going?

Second, using your filter: say using a small 4x4 filter to process a 4K UHD image:
A single 3840x2160 image (UHD size) with a 4x4 kernel would need 3840 x 2160 x 4 x 4 = 132,710,400 look-ups! How you are going to manage it with this code?
Can you recommend any optimization mechanism?

And finally memory management:
Could you explain how you are going to manage the available memory bandwidth?
That is quite a challenging task, for small CPU and memory of a camera, isn't it?

I don't want to discourage you, but there will be a lot ahead to catch up first and then try to improve it.
I appreciate your effort, but realistically speaking, the CODEC you promise, is way way way beyond this point.
 

stevelee

FT-QL
CR Pro
Jul 6, 2017
1,982
737
Davidson, NC
lion rock said:
Now, if your add-in could disable the 29 minutes limits that is imposed on dSLR video recording and be able to capture videos longer than this limitation, that in itself would be a great contribution!
-r

I don't think I've ever shot any video that lasted much more than ten minutes in a take, and rarely anywhere near that long. If I were doing the remake of Gone with the Wind or something, I probably wouldn't use a DSLR for it.
 

Jack Douglas

CR for the Humour
Apr 10, 2013
6,768
2,293
Alberta, Canada
stevelee said:
lion rock said:
Now, if your add-in could disable the 29 minutes limits that is imposed on dSLR video recording and be able to capture videos longer than this limitation, that in itself would be a great contribution!
-r

I don't think I've ever shot any video that lasted much more than ten minutes in a take, and rarely anywhere near that long. If I were doing the remake of Gone with the Wind or something, I probably wouldn't use a DSLR for it.

What comes to my mind is my son's piano concert. ;) Mind you, it was still relatively seamless.

Jack
 

privatebydesign

I post too Much on Here!!
CR Pro
Jan 29, 2011
10,000
4,781
lion rock said:
Now, if your add-in could disable the 29 minutes limits that is imposed on dSLR video recording and be able to capture videos longer than this limitation, that in itself would be a great contribution!
-r

There already is, just record the clean HDMI out to an Atomos or something similar and you can set the camera to record indefinitely.

I'm looking to get the new Atomos Ninja V to record better 1080 from the 1DX MkII when it is in 4k internal shooting via HDMI out.
 

Attachments

  • Screen Shot 2018-04-11 at 2.53.11 PM.png
    Screen Shot 2018-04-11 at 2.53.11 PM.png
    34.3 KB · Views: 97

lion rock

EOS 5D Mark IV
Jan 1, 2013
1,920
37
At 29 minutes, it stops recording. You may restart the recording for another 29 minutes, but if the program, for example, if one records Beethoven's 9th symphony at 79 minutes, there would be an obnoxious break.
I was told that it was a European law that made this a law, to protect camcorder business, if that's true.
I also know of the method of attaching an external data recorder, but, never a convenient affair.
-r
 

unfocused

EOS-1D X Mark III
Jul 20, 2010
5,912
3,123
67
Springfield, IL
www.mgordoncommunications.com
stevelee said:
lion rock said:
Now, if your add-in could disable the 29 minutes limits that is imposed on dSLR video recording and be able to capture videos longer than this limitation, that in itself would be a great contribution!
-r

I don't think I've ever shot any video that lasted much more than ten minutes in a take, and rarely anywhere near that long. If I were doing the remake of Gone with the Wind or something, I probably wouldn't use a DSLR for it.

If I were doing the remake of Gone with the Wind or something, I wouldn't have any 29-minute takes.

Actually, I think the 29-minute limitation was put into cameras to prevent parents from inflicting mental and physical cruelty on others by forcing people to sit through an entire, unedited recording of someone's little precious performing at a piano recital.
 

HarryFilm

EOS RP
Jun 6, 2016
705
166
bhf3737 said:
HarryFilm said:
---

I ain't no mere beginner in this...Here is how to do SIMPLE AND EFFECTIVE EDGE DETECTION from MY OWN CODE i designed all by myself from scratch which WILL run on ARM, Intel/AMD, MIPS, IBM Power, SuperSPARC and various DSP processors
INCLUDING the Canon DIGIC series:

COPY this code to a Landscape-mode using 10 point narrow font in a word processing document to see the entire RATHER NICELY DOCUMENTED code segment.
THIS BELOW CODE SEGMENT IS FULLY GNU GPL 3.0 OPEN SOURCE LICENCE FOR YOU programmers: Have at it for modification but REMEMBER to keep your work and modifications to this code to the GNU GPL 3.0 licence terms!
[...]

Your posted code is mainly an implementation of convolution kernel.
A simple intro: http://setosa.io/ev/image-kernels/

Convolutional kernel is a fundamental operation for image processing, isn't it? There are thousands of implementation of it in image processing textbooks. But your code implements it in the most primitive form, to the extent I understand.
I appreciate your effort for posting it. But there are a number of issues.

First the filter size:
For a 4x4 filter there will be 16+16 reads (get pixel from input and filter) for every write (to output)
For larger filters such as 16x16, 256+256 reads for every write. You see where I am going?

Second, using your filter: say using a small 4x4 filter to process a 4K UHD image:
A single 3840x2160 image (UHD size) with a 4x4 kernel would need 3840 x 2160 x 4 x 4 = 132,710,400 look-ups! How you are going to manage it with this code?
Can you recommend any optimization mechanism?

And finally memory management:
Could you explain how you are going to manage the available memory bandwidth?
That is quite a challenging task, for small CPU and memory of a camera, isn't it?

I don't want to discourage you, but there will be a lot ahead to catch up first and then try to improve it.
I appreciate your effort, but realistically speaking, the CODEC you promise, is way way way beyond this point.

===

Don't Worry!!! I will implement the PROPER bitwise Lookup Tables that will bring down the multiplication time to microseconds. In terms of memory management, you pre-allocate the bitmap at the desired output resolution and since the cameras have at least 2 frames to as much as 30 frames of buffer space, I can manage memory VERY well.

I am WELL AWARE of LDS's misgivings of my demo code which is more for YOUR READABILITY and PERUSAL than actual production. The actual code is quite a bit more optimized than that, extensively using pre-multiplication and lookup tables to give us the speedup we need. The Try-Exception block actually takes care of the out-of-resolution-bounds-based memory leak issue LDS is concerned with but I will put in if-then-else resolution bounds checking and pointer reference checking to alleviate his fears. I can also pre-allocate pixel array stacks within the procedure itself to do entire-pixel-line based operations which would save memory AND speedup my code!

P.S. to LDS: the reason why I went X-number of spots past the last array index of the convolution filter box, is that I add and store extra "Hint Data" in the convolution kernels themselves which are resized/reconfigured on the fly and then used in specialty applications.

I will make the filter code MUCH TIGHTER than what you see in the original code
passing ONLY the filter box itself to the on-camera convolution routines/
 

HarryFilm

EOS RP
Jun 6, 2016
705
166
lion rock said:
Now, if your add-in could disable the 29 minutes limits that is imposed on dSLR video recording and be able to capture videos longer than this limitation, that in itself would be a great contribution!
-r

The DSLR recording limit has TWO parts to it. If you record 30 minutes or more on UK and European DSLR's your camera gets taxed at a MUCH HIGHER RATE because it is considered a VIDEO-specific camera then so manufacturers for Euro/UK cameras set this limit on purpose. The OTHER issue is that many SD cards are formatted to a 32-bit file system which has either a signed integer 32 bit file size limit which is 2 147 483 648 bytes (2.1 gigabytes) or a 4 gigabyte file size limit.

If the camera has enough memory, I can store enough frames to allow me the time to create another MOV or AVI container file and continue on recording past the 29 minute limit up to any desired limit.

I am aware of this issue and will see what I can do to alleviate your concern.
 

stevelee

FT-QL
CR Pro
Jul 6, 2017
1,982
737
Davidson, NC
lion rock said:
At 29 minutes, it stops recording. You may restart the recording for another 29 minutes, but if the program, for example, if one records Beethoven's 9th symphony at 79 minutes, there would be an obnoxious break.

The final movement is the longest one, and it is around 25 minutes. If you are quick on the trigger, you will miss only a cough or two from the audience between movements.
 

stevelee

FT-QL
CR Pro
Jul 6, 2017
1,982
737
Davidson, NC
unfocused said:
If I were doing the remake of Gone with the Wind or something, I wouldn't have any 29-minute takes.

I thought about that later after I wrote the above. Just because something is an epic, it doesn't necessarily have massively long takes. Even Hitchcock's Rope, which was supposed to look like one continuous take, was limited to 10 minutes or less per shot. The opening shot in The Player is just eight minutes, though it seems like a tour de force.

So bad example on my part.
 

unfocused

EOS-1D X Mark III
Jul 20, 2010
5,912
3,123
67
Springfield, IL
www.mgordoncommunications.com
stevelee said:
unfocused said:
If I were doing the remake of Gone with the Wind or something, I wouldn't have any 29-minute takes.

I thought about that later after I wrote the above. Just because something is an epic, it doesn't necessarily have massively long takes. Even Hitchcock's Rope, which was supposed to look like one continuous take, was limited to 10 minutes or less per shot. The opening shot in The Player is just eight minutes, though it seems like a tour de force.

So bad example on my part.

No, I thought your point was correct and my comment was really aimed at the idea that people need 29 minutes of solid running. With rare exceptions, time lapse maybe or some sort of art film of a guy sleeping, if someone thinks that they need to keep the camera running for 29 minutes they probably shouldn’t be shooting videos.
 

JBSF

EOS 90D
Dec 19, 2014
122
60
Do y’all remember the 400-pound guy sitting on a bed in his grandmother’s basement who hacked the 2016 elections? I think I found him.
 

LDS

EOS 5D Mark IV
Sep 14, 2012
1,715
248
lion rock said:
At 29 minutes, it stops recording. You may restart the recording for another 29 minutes, but if the program, for example, if one records Beethoven's 9th symphony at 79 minutes, there would be an obnoxious break.

I guess you'll want an external audio recorder for such situation, even a good stereo mic on the camera could be an issue ;-)

Anyway, I hit the limit, for example, while I was recording a cycle of lessons at our company, it was a very simple video setup, fixed camera, Lavalier mic. It was still a nuisance to monitor when the camera stopped recording, and ask the speaker to restart.

lion rock said:
I was told that it was a European law that made this a law, to protect camcorder business, if that's true.

Yes, it's a tariff on imported cameras - even if I don't know what European camera business they protect now. It's not clear, AFAIK, if the recent EU-Japan trade agreement will remove them.

lion rock said:
I also know of the method of attaching an external data recorder, but, never a convenient affair.

There are several good reason to use an external recorder for high quality video, but it adds to the price and complexity, obviously.
 

scyrene

EOS R6
Dec 4, 2013
2,842
989
UK
www.flickr.com
unfocused said:
stevelee said:
lion rock said:
Now, if your add-in could disable the 29 minutes limits that is imposed on dSLR video recording and be able to capture videos longer than this limitation, that in itself would be a great contribution!
-r

I don't think I've ever shot any video that lasted much more than ten minutes in a take, and rarely anywhere near that long. If I were doing the remake of Gone with the Wind or something, I probably wouldn't use a DSLR for it.

If I were doing the remake of Gone with the Wind or something, I wouldn't have any 29-minute takes.

Actually, I think the 29-minute limitation was put into cameras to prevent parents from inflicting mental and physical cruelty on others by forcing people to sit through an entire, unedited recording of someone's little precious performing at a piano recital.

;D
 

Jack Douglas

CR for the Humour
Apr 10, 2013
6,768
2,293
Alberta, Canada
;D ;D

However, there are amateur activities, particularly involving children where not having to have that concern would be nice. BTW my little darling is 23 and doing his Master's in Piano performance ... any time I showed up with a camera I was practically threatened with death. Only recorded one concert from an empty high and distant balcony and this time limit was a mild concern but not as much as not having AF! DPAF; thank you, thank you, Canon. :)

Jack
 

AprilForever

EOS RP
Aug 31, 2010
768
14
aprilforever.com
HarryFilm said:
neuroanatomist said:
What new powers would this all unleash?

It will make your video frame rate faster than a speeding bullet, your video autofocus more powerful than a locomotive, and your lenses able to capture video of tall buildings without boundless keystoning. But you should avoid using Kryptonite brand memory cards, they'll render the codec powerless and vulnerable.

===

Ironically, he is rather CORRECT! The SOBEL edge detection WILL in fact help me to speed up intraframe and interframe video compression AND allow me to do automatic face detection and eye detection for FAST autofocus AND allow me to do realtime video frame distortion to correct for keystoning or correct for framing errors!

SO THANK YOU NEUROANATOMIST for explaining rather well my above code!

MUCHO GRACIAS!

===

SO What does this code do?...Well....you get 4K 24-to-30 fps intraframe AND interfame encoded video out of a Canon M5/M6, 5D mk2/3 and 6D/7D mark 1/2 at 10-bit 4:2:2 colour sampling from the ENTIRE sensor! This means it turns your $1000 to $4000 canon stills camera into a Canon C300 mk2 Cinema EOS camera! It also turns your $3000-to-$10000 Canon C100, C200, C300, C500 cinema EOS cameras into a high end 4K 4:2:2/4:4:4 10/12/14/16 bit colour sampling 24-to-60 fps $30,000+ C700 camera!

Soooooo......Do you want this new codec OR NOT?

Sure! When do we get it?
 
<-- start Taboola -->