Author Topic: (M)JPEG encoder  (Read 53968 times)

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: (M)JPEG encoder
« Reply #100 on: October 02, 2012, 04:56:12 PM »
Yes, that's exactly what it is
Chucho where did you get the address location from? I'm quite sure the "base pointer" is actually saved in a 0xABCD memory region.

I'll drop the memory locations I've marked as interesting:
int base = 0x5B0C
void* interesting = *(base+0x28)

interesting looks like an array of pointers, size unknown

EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: (M)JPEG encoder
« Reply #101 on: October 02, 2012, 05:17:23 PM »
I think the best way is to re-program the DMA to write the jpegs in your own huge buffer (up to 192 MB if I remember well). This is how I plan to do it to get rid of frame skipping.

For those who didn't see my tests:

http://a1ex.magiclantern.fm/bleeding-edge/crop.avi - mjpeg recorded on 5d2 in crop mode (use mplayer or vlc)
http://a1ex.magiclantern.fm/bleeding-edge/noncrop.mov - normal video (H.264) with the same lens and settings


ilguercio

  • Hero Member
  • *****
  • Posts: 843
Re: (M)JPEG encoder
« Reply #102 on: October 02, 2012, 05:41:25 PM »
I saw it a couple of months ago but you didn't tell me the crop version was an mjpeg :D
Nice job.
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: (M)JPEG encoder
« Reply #103 on: October 02, 2012, 06:20:53 PM »
Reprogramming it will also be necessary to get bigger jpegs. 192mb is a pretty big buffer.  Those clips are very motivating :)

Chucho

  • Developer
  • Freshman
  • *****
  • Posts: 86
Re: (M)JPEG encoder
« Reply #104 on: October 02, 2012, 11:24:41 PM »
What exactly needs to be worked on? Except the enabling LV jpeg buffer in some models.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: (M)JPEG encoder
« Reply #105 on: October 03, 2012, 01:45:29 AM »
Jpegs aren't full size. Get converted to LV size. I thought while recording actual LV size was bigger. Also doesn't work in crop mode for some reason.


Could PTP Jpeg be enabled via a property? I made a log of a PTP session and it keeps doing this:

Code: [Select]
mvrChangeAckCBR : Video - Mode=0, Type=0, Rate=24, GOP=3
ptpPropChangeEvCBR[80000039][14][0]
SendPipeEvent [0][0][9]
SendPipeEvent [0][0][49]
changeCBR PropID(0x80000039)Parameter(0)Size(20)
changeCBR PropID(0x8000003c)Parameter(0)Size(4)
changeCBR PropID(0x80000041)Parameter(0)Size(4)
changeCBR PropID(0x80000005)Parameter(107)Size(4)
->lvcdevProperty ID=0x80000039(0x0)
[GMT] gmtProperty ID=0x80000039(0x0)
[GMT] PROP_MOVIE_PARAM Asp:6
[GMT] PROP_MOVIE_PARAM Mode:0, R(4->4), SC(0->0) SZ(0->0)
[GMT] PROP_MOVIE_PARAM DZ(0->0)
[GMT] Event 19 Result State 6->6 ID 0x80000039(0)
[GMT] gmtProperty ID=0x8000003c(0x0)
[GMT] PROP_MOVIE_REC_AF:(0)
[GMT] Event 19 Result State 6->6 ID 0x8000003C(0)
[GMT] gmtProperty ID=0x80000005(0x6b)
[GMT] Event 19 Result State 6->6 ID 0x80000005(107)
copyDataToStorage eventID(0x80000039)Data(9487752)size(20)
PROP_MOVIE_PARAM [9487752]

The rest:
http://pastebin.com/NGLTs3VB


Also:

NSTUB(0xFF0967C8, str:Develop\FrontDevelopState.c_sdsActivate_Enable)

Uses yuv to jpeg path and there is some sort of debug monitor:

FF096DB4:   e59f12f8    ldr   r1, [pc, #760]   ; pointer to sub_FF096604   ⬁
FF096DB8:   e28f0fbe    add   r0, pc, #760   ; *'EnableDebugMon'

Unsure if its the sub or what happens below.

Chucho

  • Developer
  • Freshman
  • *****
  • Posts: 86
Re: (M)JPEG encoder
« Reply #106 on: October 07, 2012, 05:14:09 AM »
From function 0xff14b1d8 PtpPropMovie R1 = 0x80020009 R0= pointer 5BD4 --> 0x44E002C Off (not connected to EOS Utility), 0x2B6002C On (connected to EOS Utility). How do I test this? Off topic how can I use NSTUB(0xFF010BA4, memMap) and NSTUB(0xFF010C20, objInfo)

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: (M)JPEG encoder
« Reply #107 on: October 09, 2012, 07:17:09 PM »
5BD4 points to 0x49e007a for me whether connected to PTP or not. The contents of that address is FFFFFFF whether connected or not.

0x80020009 is I think the actual property. Have to look at it in property spy, than maybe can change with the property handler?

These properties show up when connected to eos utility:


That 0x80020009 contains address 0x41000000

 [img=http://s3d4.turboimagehost.com/t1/13540055_IMAG0577.jpg] [img=http://s3d4.turboimagehost.com/t1/13540056_IMAG0578.jpg] [img=http://s3d4.turboimagehost.com/t1/13540057_IMAG0579.jpg] [img=http://s3d4.turboimagehost.com/t1/13540059_IMAG0580.jpg]


That property defined as: PROP_ICU_UILOCK         0x80020009

The 2a and 2b properties are 2 and 1 so that looks like some sort of mode... I did not find them in the property.h

Also what is:
PROP_LV_AFFRAME         0x80050007 // called by ptp handler 915a

I see reference to making "AF Frame" in fw in ptp functions.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: (M)JPEG encoder
« Reply #108 on: October 10, 2012, 01:28:16 AM »
Maybe I'm trying too hard...

call("WriteEDmacPackMem");

starts PTP and jpegs are created but they don't show up in ram. Am i missing a parameter?

Code: [Select]
ptpPropChangeEvCBR[80000039][14][0]
SendPipeEvent [0][0][9]
SendPipeEvent [0][0][49]
changeCBR PropID(0x80000039)Parameter(0)Size(20)
changeCBR PropID(0x8000003c)Parameter(0)Size(4)
changeCBR PropID(0x80000041)Parameter(0)Size(4)
changeCBR PropID(0x80000005)Parameter(104)Size(4)
->lvcdevProperty ID=0x80000039(0x0)
[GMT] gmtProperty ID=0x80000039(0x0)
[GMT] PROP_MOVIE_PARAM Asp:6
[GMT] PROP_MOVIE_PARAM Mode:0, R(4->4), SC(0->0) SZ(0->0)
[GMT] PROP_MOVIE_PARAM DZ(0->0)
[GMT] Event 19 Result State 6->6 ID 0x80000039(0)
[GMT] gmtProperty ID=0x8000003c(0x0)
[GMT] PROP_MOVIE_REC_AF:(0)
[GMT] Event 19 Result State 6->6 ID 0x8000003C(0)
[GMT] gmtProperty ID=0x80000005(0x68)
[GMT] Event 19 Result State 6->6 ID 0x80000005(104)
copyDataToStorage eventID(0x80000039)Data(13077236)size(20)
PROP_MOVIE_PARAM [13077236]
copyDataToStorage eventID(0x8000003c)Data(0)size(0)
copyDataToStorage eventID(0x80000041)Data(0)size(0)
copyDataToStorage eventID(0x80000005)Data(104)size(0)

From log are they 0 size?

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: (M)JPEG encoder
« Reply #109 on: October 20, 2012, 12:54:30 AM »
NSTUB(0xFF14B1D8, PtpDpsRmtReleaseEventFlag)

then:

call("WriteEDmacPackMem");
msleep(1000);
call(PtpDpsRmtReleaseEventFlag);

get 160x120 jpeg from 0x0a067c1e to
0x0a06ca3c

Messing with the event flags produces corrupted jpegs sometimes.

Nothing is consistant even though PTP is rolling.

CreateEventFlag('PtpPropMovie', 0x1);
CreateEventFlag('PtpPropUIlock', 0x1);

hjfilmspeed

  • Senior
  • ****
  • Posts: 479
  • 5D III and IV
Re: (M)JPEG encoder
« Reply #110 on: November 02, 2012, 04:23:10 PM »
I have know idea what all this means and if i did i would be developing! all i know is this would be an awsome feature! mjpeg or just a jpeg sequence would be way better the h.264 as far as quality goes! Whats the latest on this beast of a feature?

Chucho

  • Developer
  • Freshman
  • *****
  • Posts: 86
Re: (M)JPEG encoder
« Reply #111 on: November 02, 2012, 08:27:36 PM »
Funny thing, The 350d is the only Canon dslr with a MPEG1 and MPEG2 encoder string, besides the 1DC. The 350d doesn't even have LIveview. There goes my theory about how dslr were never meant to record video, apparently Canon was development video recording early on.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12222
  • Maintenance mode
Re: (M)JPEG encoder
« Reply #112 on: November 02, 2012, 08:29:31 PM »
Or maybe they just reused some code from video camera division or point and shoots?

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: (M)JPEG encoder
« Reply #113 on: November 02, 2012, 08:49:58 PM »
What do those function go to now? There is an AVI player for some reason and as far as I know the DSLRs never recorded AVI.

If we can resize those jpegs from 0 then MJPEG just needs to be saved to file. Did you do anything besides call WriteEdmacPackMem on 60D?

Chucho

  • Developer
  • Freshman
  • *****
  • Posts: 86
Re: (M)JPEG encoder
« Reply #114 on: November 02, 2012, 09:14:25 PM »
Or maybe they just reused some code from video camera division or point and shoots?

It's all about the JPCORE. The 350D has JP52, the newer cameras have JP60 or 61 I can't remember. The 5d3 has the newer JPCORE6' something, it also has the JP57 which it uses for raw pictures? But why did they go back to JP57 wasn't the newer JPCORE good enough?

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: (M)JPEG encoder
« Reply #115 on: November 02, 2012, 09:54:21 PM »
I think JP62 for me.

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: (M)JPEG encoder
« Reply #116 on: November 02, 2012, 10:00:57 PM »
1100D and 600D have JP62
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3143
Re: (M)JPEG encoder
« Reply #117 on: November 02, 2012, 10:43:17 PM »
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: (M)JPEG encoder
« Reply #118 on: November 02, 2012, 10:46:37 PM »
Does 7d produce jpegs without the USB cable?

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3143
Re: (M)JPEG encoder
« Reply #119 on: November 03, 2012, 12:25:40 AM »
do you mean LV JPEG encoding without any reason?

if so: yes ( )
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

ilguercio

  • Hero Member
  • *****
  • Posts: 843
Re: (M)JPEG encoder
« Reply #120 on: November 03, 2012, 12:36:18 AM »
Is the 7D the only one that does 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.

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: (M)JPEG encoder
« Reply #121 on: November 03, 2012, 12:50:01 AM »
Wait, did I miss something? Do the jpeg contain actual LV image data?
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3143
Re: (M)JPEG encoder
« Reply #122 on: November 03, 2012, 12:56:51 AM »
yes, its the LV content JPEG compressed.
1056x704

600D does when USB is connected :(
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

ilguercio

  • Hero Member
  • *****
  • Posts: 843
Re: (M)JPEG encoder
« Reply #123 on: November 03, 2012, 12:58:36 AM »
yes, its the LV content JPEG compressed.
1056x704

600D does when USB is connected :(
What about X0D cameras and 5DII?
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: (M)JPEG encoder
« Reply #124 on: November 03, 2012, 01:28:29 AM »
If it doesn't call that edmac register on don't click me and dump ram. If it is LV does that mean jpeg will be 4:4:4 when in HDMI and switched? Into something that supports 4:4:4 the image wasn't red, only the ML menus. But yuv I think still 4:2:2.

I did some testing:

Jpeg has no overlays. When connected to HDMI YUV size stays at 1056x704 but image is in both screens. 4:4:4 affects HDMI display but not JPEG. Also... silent pics correctly play back on HDMI and LV doesn't die while USB is connected. I wish I could try in crop mode but I don't know if the eos utility is saying "LV doesn't work in crop mode" or if its somethign that can be cache hacked out of the camera. I did not find the strings.