Limits be gone.

Started by 1%, July 25, 2012, 06:57:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

g3gg0

well, audio is in 'mdat' atoms.
the pointers to audio/video should be both in 'stco' iirc and these are getting fixed.
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%

I see. File saved successfully on linux. Is this possible to patch into ML or do you have to disable the startup hacks, etrc. I want to add it to my repo.

g3gg0

you want to patch what into ML?
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!

jonas18z

I think there is two kind of patches that would be possible:

1. Patch the record function, so when you press rec the camera start with a new 64-bit .mov file from the beginning.

2. Make a new function in ML, that can patch 32-bit clips after you have recorded then like EOSMovieFixer.exe


I think 1% talks about 2 and you about 1 or?







g3gg0

Quote from: g3gg0 on August 10, 2012, 10:15:21 AM
i could rely on that offset and try to patch the header contents only.
but the main work is reading/parsing/extending header atoms, and thats something i dont want to do in C.
i could do it in C, but that would be either ugly as hell or it would be really a lot of work.
nothing i would do for fun :)
so the solution to patch it later on computer is my favorite, because we can merge split files there too.
(other models without exFAT would require it anyway)

Quote from: g3gg0
as explained above, patching flash routines would be possible but
a) highly model/version dependent
b) a lot of work
c) not clear if it will cause severe side effects

so i chose the "safe" way of fixing the file afterwards.

i see, i already explained why i prefer patching it afterwards and not 1) or 2).

we could do that in camera, but why do we want to do that pain in the ass?
so we can play back the whole file in camera? or that we dont have to prepare that files before we can use them on pc?
i think the small advantage of having that done automatically doesnt justify the effort at all.

my personal estimations in order of "cleanest process first":
- firmware patch so 64 bit movies are written: 4 weeks
- magic lantern feature that rewrites .mov: 2 weeks
- pc program that rewrites/patches/cleans .mov: 1 day (already done)

i would really stop here. we have a movie fixer and now just have to enable the firmware to record >4GiB.
we should save our resources for other things now.
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%

Quoteenable the firmware to record >4GiB

Well I probably wasn't making any sense last night but what I meant is that I want to do this in my own repo so I have move remap, sound, etc and not just a bin that doesn't have these options. Its good the way it, just want to use it. :)

jonas18z

Quote from: g3gg0 on August 10, 2012, 04:15:37 PM

i would really stop here. we have a movie fixer and now just have to enable the firmware to record >4GiB.
we should save our resources for other things now.


Second that




What about seamless recording with fat32 only camera?



g3gg0

Quote from: g3gg0 on August 09, 2012, 10:47:00 AM
task:
allow recordings >4GiB with all cameras

problems:
a) camera limits recording to 4GiB
b) FAT does not support files > 4GiB, some cameras support exFAT, some not
d) camera uses .mov with 32-bit tags only, which woll overflow and for sure cause trouble

solutions:
a) we can patch that "max length" field (success on 600D, others will follow)
b) we can either use exFAT or hook the writer routines to split the huge container into separate files (first works, second not yet)
c) we can patch camera firmware (a lot of work and very model-specific) or build a fixer that corrects the file afterwards (preferred)

highlighted text, todo
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%

Confirmed movies with audio record as they should and the patcher works with them.

*Also no issues with overheating so far on 20 minute movies. Haven't tried > 30 minutes yet.

g3gg0

nice.
thanks for testing.
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

Thanks for the effort. I obviously second the g3gg0's approach for <4gb files.
Can you do enable it for other cameras or should we wait for a1ex?
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%

Tried adding this to bitrate.c and don't click me for good measure.

uint32_t *movRec = *((uint32_t**)0x1E40);
   
    /* set maximum to 0x3FFFFFFFF bytes (16GiB) */
    movRec[80] = 0x00000003;
    movRec[81] = 0xFFFFFFFF;


My movies still stop. I'm probably doing something wrong. At first it says 40 minutes record time then it goes down and down and down. Even if I run the function again while I'm recording (it just blanks for a second).

g3gg0

0x1E44

that was my wrong somewhere some posts ago
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!

g3gg0

btw. some 30 minute limit may still be existent.
didnt check if this is a snapshot mode restriction only.
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%

I'll try it out on 64g card when battery recharges. Still not working... should the function go in a different place. I notice that my bpm prints of the 2 locations disappear when I hit record. Maybe that has something to do with it.

* I got it to work manually but not automatically yet.

g3gg0



uint32_t autodetect_movierecorder()
{
    for(uint32_t addr = 0; addr < 0x01000000; addr += 4)
    {
        uint32_t *ptr = (uint32_t *)addr;
       
        /* first element pointer into flash? */
        if((ptr[0] & 0xFF000000) != 0xFF000000)
        {
            continue;
        }
        /* second element pointer into ram? */
        if((ptr[1] & 0xFF000000) != 0x00000000)
        {
            continue;
        }
        /* third element pointer into ram? */
        if((ptr[2] & 0xFF000000) != 0x00000000)
        {
            continue;
        }
       
        /* is it a pointer to "MovieRecorder" string? */
        if(strcmp("MovieRecorder", (const char *)ptr[0]))
        {
            continue;
        }
       
        /* check for StateObject and TaskClass */
        uint32_t *state_ptr = (uint32_t *)ptr[1];
        uint32_t *task_ptr = (uint32_t *)ptr[2];
       
        /* StateObject: first element pointer into flash? */
        if((state_ptr[0] & 0xFF000000) != 0xFF000000)
        {
            continue;
        }
       
        /* StateObject: is it a pointer to "MovieRecorder" string? */
        if(strcmp("StateObject", (const char *)state_ptr[0]))
        {
            continue;
        }
       
        /* TaskClass: first element pointer into flash? */
        if((task_ptr[0] & 0xFF000000) != 0xFF000000)
        {
            continue;
        }
       
        /* TaskClass: is it a pointer to "MovieRecorder" string? */
        if(strcmp("TaskClass", (const char *)task_ptr[0]))
        {
            continue;
        }
   
        return addr;
    }
   
    return 0;
}

uint32_t autodetect_movierecorder_ptr()
{
    uint32_t obj = autodetect_movierecorder();
   
    if(obj)
    {
        for(uint32_t addr = 0x1000; addr < 0x01000000; addr += 4)
        {
            uint32_t *ptr = (uint32_t *)addr;
           
            if(ptr[0] == obj)
            {
                return addr;
            }
        }
    }
    return 0;
}

uint32_t autodetect_movierecorder_maxsize_pos()
{
    uint32_t *obj = (uint32_t *)autodetect_movierecorder();
   
    if(obj)
    {
        for(uint32_t offset = 0; offset < 100; offset += 2)
        {
            if((obj[offset] == 0xFFFFFFFF) && (obj[offset+1] == 0))
            {
                return offset;
            }
        }
    }
    return 0;
}

void run_test()
{
    uint32_t objPtr = autodetect_movierecorder_ptr();
    uint32_t offsetMax = autodetect_movierecorder_maxsize_pos();
   
    if(objPtr && offsetMax)
    {
        uint32_t *movRec = *((uint32_t**)objPtr);
        uint32_t offsetCur = 74;
       
        /* set maximum to 0x3FFFFFFFF bytes (16GiB) */
        movRec[offsetMax+1] = 0x00000003;
        movRec[offsetMax] = 0xFFFFFFFF;
       
        if(offsetMax != 80)
        {
            offsetCur = 80;
        }
       
        while(1)
        {
            msleep(100);
            bmp_printf(FONT_SMALL, 10,40, "Object: 0x%08X  Ptr: 0x%08X  Off: %d", movRec, objPtr, offsetMax);
            bmp_printf(FONT_SMALL, 10,50, "max: %08X%08X cur:%08X%08X", movRec[offsetMax+1], movRec[offsetMax], movRec[offsetCur+1], movRec[offsetCur]);
        }     
    }
    else
    {
        uint32_t loops = 0;
        while(loops++ < 100)
        {
            msleep(50);
            bmp_printf(FONT_SMALL, 10,10, "Object/MaxPos not found");
        }
    }
    return;
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%

Thanks, I think my problem is running the function when the rec button is pressed. I'm trying to throw it in shoot.c somewhere.

g3gg0

you have to run that function *before* recording!
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%

I did it like this, have to test it out. I keep chewing through batteries for some reason.. I know debug info won't show up but shouldn't it run the function before pressing the rec button or am I being dumb?


Fixed and working in next commit: https://bitbucket.org/OtherOnePercent/tragic-lantern/changeset/af9112f96756facb50a5975dd710e300a01be797


https://bitbucket.org/OtherOnePercent/tragic-lantern/changeset/9fa9fd018aad20f97091b7019dad014afe1c2149

8)


*well... seemingly comes on only in remapped movie mode but that's ok for me.

scrax

how to use the file fixer on osx with mono?
installed mono and then:
mono /Users/scrax/Desktop/EOSMovieFixer.exe
opened an icon like for a new program but no window
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

1%

Do you have everything installed that you need, windows forms, etc? I was missing tons of stuff and at first it didn't open, then things were missing, and now 100% when I run it from the command line. Just open dialog pops up under the main window.

jonas18z

Quote from: scrax on August 10, 2012, 11:14:11 PM
how to use the file fixer on osx with mono?
installed mono and then:
mono /Users/scrax/Desktop/EOSMovieFixer.exe
opened an icon like for a new program but no window

My was very slow on a 6 core macbook pro when I opened file dialog it was to slow. With my home computer with amd turion x2 with with windows 7 it was much faster. Try to wait :-*

scrax

Quote from: jonas18z on August 11, 2012, 04:29:55 AM
My was very slow on a 6 core macbook pro when I opened file dialog it was to slow. With my home computer with amd turion x2 with with windows 7 it was much faster. Try to wait :-*
jonas18z, have installed only the MonoFramework-MRE-2.10.9_11.macos10.xamarin.x86.dmg on Lion with x11? Thanks!
you were right... but so slow is not usable, there is needed more time to open mono than to do all the other stuff...

by the way off course on win it's faster, it's native...

I'm trying to test this workflow but having to install mono just for loading 24KB of converter is not really a good solution, I have no clue how and what but isn't there a more portable/crossplatform framework than .NET for this stuff?
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

Michael Zöller

Is the source to EOSMovieFixer publicly available?
neoluxx.de
EOS 5D Mark II | EOS 600D | EF 24-70mm f/2.8 | Tascam DR-40

g3gg0

not yet, but will be, i think.
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!