Author Topic: 24p JPG image capture  (Read 11707 times)

trip3980

  • New to the forum
  • *
  • Posts: 14
24p JPG image capture
« on: January 05, 2016, 06:44:27 AM »
Hello all.  wanted to introduce my self.  When the magic lantern came out with the canon 60D version I was the second person to test the hack and never looked back.  that said I wanted to bring up a features request to allow the camera to capture crossing fingers but jpg 24p at 4k.  Not sure why we haven't done that but I really don't need all the raw data all the time and to be honest the 60d is really not the best when it comes to raw recording due to the crop factor so its rather impractical.  I did test JPG and noticed that the camera has enough computing power to capture at high speeds continuously so I am crossing my fingers that someone can do a nightly build that allows 24p jpg image capture.  could care less about sound just want to capture 24p jpg. 

With love and solidarity to the Magic lantern community.  :)   

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 7014
Re: 24p JPG image capture
« Reply #1 on: January 05, 2016, 06:53:20 AM »
60D's card interface bandwidth is about 21 MByte/s for write operations.
Therefore at 24 fps each frame is limited to about 900 kByte.

IMHO 4k resolution and 900 kByte for All-I frames doesn't make sense.
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #2 on: January 05, 2016, 07:00:31 AM »
thanks for replying.  Can you explain that in layman's terms.  what I think you said is that the camera can only capture at 20 mbs which is fine but are you saying it is not practical to capture 4k jpg?  if so how many maxim frames do you think the camera can capture in from 1-24 fps at 4k?  and is it more practical to capture 1920x1080 at 24p on jpg?  sorry my knowledge of programming on the camera is limited. 

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 7014
Re: 24p JPG image capture
« Reply #3 on: January 05, 2016, 07:06:40 AM »
Take a RAW photo of a scene with lots of details. Resize to 4 k. Now convert to JPEG with file size up to 900 kByte.
Happy with results?
If not: Not worth thinking about implementing something not worth looking at.
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #4 on: January 05, 2016, 07:09:41 AM »
Ill test it out tomorrow when its daylight and give you my findings or reactions which ever comes first.  :)  thanks 

kgv5

  • Hero Member
  • *****
  • Posts: 643
Re: 24p JPG image capture
« Reply #5 on: January 05, 2016, 08:57:11 AM »
I think this would be worth to try if anybody knows how to implement such thing and if it is technically possible. Could be useful in some situations.

EDIT:
I took the picture in full size (5d3 113) in raw, downscaled it to 4k in irfanview and compressed to about 900kb (quality 70 setting).
I have also took 4k jpeg from camera (1,2MB) and compressed it to 800kb. Both looks more detailed than DNGs.

See for yourself:

original CR2
https://www.dropbox.com/s/kkn5p3l9h2svl7y/KG5D2139.CR2?dl=0

original DNG
https://www.dropbox.com/s/eab41pcd1ni4ywn/M05-0947_000000.dng?dl=0

jpeg
https://www.dropbox.com/s/m5e1d9rzh0wt9cb/KG5D2139%20raw%20down%20to%204k%20saved%20with%20q70%20with%20irfanview.jpg?dl=0
https://www.dropbox.com/s/645qj21ahvdxxhy/KG5D2140%204k%20jpeg%20from%20camera.JPG?dl=0
https://www.dropbox.com/s/iiqmj26onk32urv/KG5D2140%20q70%20from%204k%20jpeg.jpg?dl=0


www.pilotmovies.pl   5D Mark III, 6D, 550D

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12353
  • Emergencies only
Re: 24p JPG image capture
« Reply #6 on: January 05, 2016, 10:12:35 AM »
http://www.magiclantern.fm/forum/index.php?topic=2803.25

All you need to do is to figure out how to call the JPEG encoder with arbitrary resolution, and - if you want more than 1080p - with a raw buffer as input (maybe with intermediate conversion steps).

The processor is way too slow, so you have to figure out how to call Canon's image processing modules.

These might provide useful hints:
http://www.magiclantern.fm/forum/index.php?topic=13163.0
http://www.magiclantern.fm/forum/index.php?topic=13408.0
http://www.magiclantern.fm/forum/index.php?topic=6740.0
http://chdk.setepontos.com/index.php?topic=7067.0

For resolutions higher than what you can already get in RAW on 5x zoom, you can change the resolution by tweaking some registers, but don't forget that sensor readout speed is limited. Relevant threads:
http://www.magiclantern.fm/forum/index.php?topic=10111.msg123909#msg123909
http://www.magiclantern.fm/forum/index.php?topic=12656.0
http://www.magiclantern.fm/forum/index.php?topic=12523.msg121962#msg121962


trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #7 on: January 06, 2016, 01:04:04 AM »
Hello all again I did the tests and they looked really promising.  What I found is that at 1080X720 the raw file does not need to be compressed nearly at all to get a good resolution.  so out of 100 % the file needs to be compressed 96% to stay under the 900k mark.  and judging by the 7d we could have really good results scaling up.  My thinking is with the different crop factors such as 2:35:1 should increase the perceived pixel aspect ratio maybe at 1920 pixel resolution. 

https://drive.google.com/file/d/0B2-o_glqDIxzd0wwVjJMclE5M00/view?usp=sharing

these are the test photos. 

I think all the magic lantern cameras can benefit.  not saying JPG is perfect but it gets rid of the jello and makes the image look a hell of a lot better then them damn scanned lines lol.   

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3366
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Re: 24p JPG image capture
« Reply #8 on: January 06, 2016, 09:22:38 AM »
+1 and great work @trip3980!

This would be an ideal workflow to use for quick Timelapse sessions and all I need to do is drop it off to ingest (no post work needed) which would be a dream come true and a GH4 killer! [emoji1]
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #9 on: January 06, 2016, 06:39:06 PM »
If I am not mistaken I think the current internal firmware can record JPG time-laps at 1920X1280 But I think I get what your saying here adding more photo controls over the crop factor and pixel aspect ratio to match 1920X1080 or 2:35:1.  Is this what you are thinking?   

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 7014
Re: 24p JPG image capture
« Reply #10 on: January 06, 2016, 07:26:31 PM »
Canon's video implementation (H.264 dialect) is not exactly JPG. In short it's:
Use Liveview resolution (horizontal pixel count/3 (cum grano salis)). Use every third pixel/line, skip the rest. Fight aliasing/moire by add some smoothing (not that good for resolution). Now scale it up to 1080p. Add some sharpening. And do not fill every frame with that much information but use one I-frame (full information) every half second followed by 12-15 P-frames (or P- and B-frames). See http://www.canon.com.hk/cpx/en/technical/va_EOS_Movie_Compression_Options_All_I_and_IPB.html
All-I would be easier to edit (less processor time needed).
Only exeption (for cams supported by ML) is 5D3 which is using binning instead of line-skipping. (Binning=grab a pixel's neighbour and merge). And horizontal pixel/3 = 1920 -> No upscaling needed.
And some cams support All-I, of course.


Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #11 on: January 06, 2016, 08:24:53 PM »
Yeah I figured as much with how canon processes their image.  Makes sense because physically aspect ratios are dependent on pixel dimensions hence why the lens crop factor would be large if they only stuck with strict dimensions on the ccd.  The people who developed the digital bolex understood this and the problem is that the physical CCD size determines the pixel aspect ratio.

as you mentioned canon cheated by separating the pixels across the frame in horizontal line segments to give us access to the full size of the CCD.  Hence why shooting raw on the magic lantern is somewhat impractical.

However, the atomos ninja takes the outputted image and down downscale the image to fit what ever pixel aspect ratio is desired.  Which is less processes intensive because its only converting a raw video signal.   

The reality is many people don't understand that film is no different then digital in terms of the natural laws of optical physics.  But I think by using JPG we can use the cameras full potential from a balance standpoint between raw and h.264 in what the camera is capable of in terms of processing power.  Don't get me wrong I think the way canon came out with utilizing the full size of the ccd was smart with the H.264 codec.  But all these camera manufactures are scared to just capture image by image because they know that the true limitations is in the processing power of the camera to take full advantage of the ccd size.  They knew if they did work with the just pixel aspect ratios consumers would complain about the high crop factor and over blown noise from the ISO.

The only way camera manufactures can fix this issue is displaying the images and converting the displayed image separately to take advantage of the full CCD.  At this point the limitations would be relent on the secondary video converter hardware.  which I think we should have done long ago. 

  I was talking to an old timer in hollywood who dealt with film and he said that when shooting in 16mm you have to take in to account that the film grain will be comparable to the higher film grain of 35mm.   So for example shooting kodak 500t iso on the 16mm would be equivalent of shooting at 1600iso on 35mm film stock. 

The only reason why the noise is lower shooting with canons h.264 codec is because the camera is taking advantage of the entire surface of the CCD minus some coping to compensate for the 16x9 aspect ratio.  However I believe the camera can record higher pixel aspect ratios given the with of the ccd and just shoot at different crop factors like 2:35:1 to take advantage of the ccd size with out sacrificing the lens crop factor too much.  at least that's the theory anyways. 

Kharak

  • Hero Member
  • *****
  • Posts: 925
Re: 24p JPG image capture
« Reply #12 on: January 06, 2016, 09:00:32 PM »
I have to correct you, you keep saying CCD. All the Canon cameras use CMOS sensors so no matter what, you are gonna get Jello effect. h264/Jpeg/RAW it doesn't matter, its the way the Sensor captures and stores the Light, Row by Row.



once you go raw you never go back

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #13 on: January 06, 2016, 09:41:44 PM »
Yes I know the camera has a CMOS sensor.  Sorry was being lazy.  As far as Jello I don't get that with DNG.  Or at least I haven't noticed it.  I did some raw test to see if their is jello with raw but I don't get it on my camera as far as I can see. 

PaulHarwood856

  • Senior
  • ****
  • Posts: 292
Re: 24p JPG image capture
« Reply #14 on: January 06, 2016, 10:18:21 PM »
Hey trip2980,

     I really like this idea, quite fascinating actually. The only question I have is: If I get a dead pixel(s) (happens with the 7D with raw video and compressed H.264) in jpeg 4K, is there absolutely no way to remove it? Thanks for implementing this idea!

- Paul Harwood

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: 24p JPG image capture
« Reply #15 on: January 06, 2016, 10:18:40 PM »
The merits of MJPEG are completely obvious. There's no point in having an extended discussion about it. If you really want to help: figure out how to actually implement it.

cmccullum

  • Member
  • ***
  • Posts: 129
Re: 24p JPG image capture
« Reply #16 on: January 07, 2016, 12:57:02 AM »
Not to be a stick in the mud, and I may be wrong here, but isn't this what the 1Dc does, and isn't implementing features other canon models are capable of a "no no" for ML?

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: 24p JPG image capture
« Reply #17 on: January 07, 2016, 02:18:19 AM »
No, it happens all the time. For example: 50D can't record video without ML.

cmccullum

  • Member
  • ***
  • Posts: 129
Re: 24p JPG image capture
« Reply #18 on: January 07, 2016, 02:33:23 AM »
Ah I stand corrected! I thought I read that somewhere in one of the sticky posts though :-\

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #19 on: January 07, 2016, 04:06:52 AM »
@PaulHarwood856

You can clean your camera of dead pixels under manual clean in your canon's firmware.  You can find out how to do it here. 

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #20 on: January 07, 2016, 04:12:57 AM »
@dmilligan

In regards to helping develop the software I am not a software developer just a proud user :)  Believe me I would be helping out but programming is not my thing.  All I can do is offer testing for devices.  If I see anything I usually report them.  when ML first came out alex was using email still thats how far back I go with the testing.  i think the forums came out the same time but I emailed him my results. 

PaulHarwood856

  • Senior
  • ****
  • Posts: 292
Re: 24p JPG image capture
« Reply #21 on: January 07, 2016, 04:28:48 AM »
Hey trip3980,

     I love that video you posted, it has helped me get rid of dead pixels ever since. With raw video, dead pixels increase with high ISO, and even when you go back down in ISO, they're still there. Adobe Camera Raw is able to fix this. I'm not sure if they could be fixed in jpeg, but I'm not even sure if the problem would still exist since it's not raw video. H.264 gets a few pixels here and there, but that's easily manageable through this video. Is there a way to remove it in a jpeg or H.264 video once the dead pixel is in the image?

- Paul Harwood

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #22 on: January 07, 2016, 04:52:01 AM »
@PaulHarwood856

What camera are you using.  I have the canon 60D.  You mentioned the High ISO you might want to look into toning down that noise reduction.  In menu go to the little brown camera icon and select image, noise reduction = on and high iso speed noise reduction to strong.  this helped me with the crazy red and blue noise.  Photographers leave it off cause it decreases camera shutter speed.  Honestly I don't need a high speed shutter. some people do tho. and as far as JPG goes it works for raw and jpg mode.  the camera just ignores the pixels.   

cmccullum

  • Member
  • ***
  • Posts: 129
Re: 24p JPG image capture
« Reply #23 on: January 07, 2016, 10:26:27 PM »
"Features copied from another Canon camera (crop mode recording, clean HDMI out...)
Copying Canon code or functionality may carry legal risk for us. We do respect the Canon company and love their products and we are strict about staying on the right side of the law."

This is what I was referring to, btw. From the features that are not possible thread
 ( http://www.magiclantern.fm/forum/index.php?topic=950.0 )
maybe I'm misinterpreting this though

trip3980

  • New to the forum
  • *
  • Posts: 14
Re: 24p JPG image capture
« Reply #24 on: January 08, 2016, 06:00:40 AM »
@cmccullum
If canon cared they would have went after magic lantern already but its been years and they help canon sales.  I doubt that at this time canon would mess with magic lantern.  Its political suicide if canon brought up any kinda litigation with magic lantern.