(M)JPEG encoder

Started by Chucho, September 11, 2012, 03:40:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nanomad

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

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

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%

Reprogramming it will also be necessary to get bigger jpegs. 192mb is a pretty big buffer.  Those clips are very motivating :)

Chucho

What exactly needs to be worked on? Except the enabling LV jpeg buffer in some models.

1%

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:


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

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%

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%

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?


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%

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

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

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

Or maybe they just reused some code from video camera division or point and shoots?

1%

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

Quote from: a1ex on November 02, 2012, 08:29:31 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%


nanomad

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

Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

Does 7d produce jpegs without the USB cable?

g3gg0

do you mean LV JPEG encoding without any reason?

if so: yes ( http://youtu.be/jQLHkXL-AWU )
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

ilguercio

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

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

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: [email protected]
ONLY donate for things we have done, not for things you expect!

ilguercio

Quote from: g3gg0 on November 03, 2012, 12:56:51 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%

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.