Author Topic: Pre-recording for the raw_rec module?  (Read 6329 times)

mk11174

  • Hero Member
  • *****
  • Posts: 766
Pre-recording for the raw_rec module?
« on: April 11, 2016, 03:10:19 PM »
I was trying to film dogs catching Frizbee the other day, and was thinking, I wonder if there's a way to add a buffer record to Raw_Rec module, like have it record to buffer but not to file for the certain amount of frames the user chooses as a buffer, then when the action you want happens, you press the shutter and it records the buffer to video file? Might be a neat option to add to this module for wildlife or sports, especially if it will probably now save the camera settings you use in the video file as well. Or is this to much clutter for the module, maybe a separate module might be needed? I have been away from ML community for awhile and my coding skills are way to rusty to even know if this is possible or not. Thanks
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #1 on: April 11, 2016, 03:43:13 PM »
Pre-recording - indeed, would be a very nice feature. And it would provide a solid backend for your older experiments like the lightning trigger.

Currently, you have something similar in the silent module (the "end trigger" option)
- hold the shutter halfway
- when the action happens, release it
- it records 1-2 seconds of video (MLV/DNG) right before the shutter release

Problem: you are limited by how many frames fit in the memory. I have it updated locally to use both SRM and shoot memory buffers (part of an unrelated experiment), so I'll commit that for a quick workaround if it helps.

In any case, pre-recording shouldn't be very hard to implement in raw_rec. Basically it would be something like this:
- before pressing the button:
   - don't enqueue frames to the writing queue
   - after say half of the available memory gets used, discard the oldest frame and mark that slot as free

- after you press the button:
  - send all the frames to the writing queue (it will start saving frames at full speed)
  - keep recording normally

(I'm even tempted to try it, since I wanted to implement that for a long time)



nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 906
Re: Pre-recording for the raw_rec module?
« Reply #2 on: April 11, 2016, 04:11:58 PM »
Sounds like Panasonic's 4K Photo feature which they btw extended with a so called "post focus" feature:


70D.112 & 100D.101

mk11174

  • Hero Member
  • *****
  • Posts: 766
Re: Pre-recording for the raw_rec module?
« Reply #3 on: April 11, 2016, 05:00:37 PM »
Oh yes, the frames limitation, I remember that, and every camera model would be different from what I remember.

And yeah, might help out with lightning trigger if I had a way to remote trigger, lol, good thing about lightning one, is I can hide in car when big bolts get close and the detection code will do the unsafe triggering for me.  :P

But with all these cell phone apps having these type of features, this addition to the DSLR camera would be great since there quality is way way better then a cell phone sensor.

Hopefully the frame limitation does not keep it from progressing if you decide to try to implement it, but I do understand that part.

And yes, very similar to End Trigger, only bad thing with End Trigger feature is you have to wait it out as each frame writes and goes through the previews and it doesn't include the camera settings in the file if I remember correctly, its been awhile since I was in testing mode, maybe I missed an update?

Thanks for the interest and reply!  :)
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #4 on: April 11, 2016, 05:22:10 PM »
Metadata is saved if you use MLV as file format, and previews aren't any slower than the ones from mlv_play.

Updated the silent picture module with SRM buffers, so it now uses all the available RAM.

mk11174

  • Hero Member
  • *****
  • Posts: 766
Re: Pre-recording for the raw_rec module?
« Reply #5 on: April 11, 2016, 06:04:13 PM »
Cool, sounds interesting, I will check it out and see how it works from how I remember it working or compare to old end trigger before I copy new one over, just need to hope my VBOX still works and I remember how to do all the stuff I use to mess with to compile.  :-[

As for preview, I would prefer no preview at all, just record buffer and wait for next shot, but wondering if it needs time to write anyway before you can record next shot, so maybe the preview is a must to slow the user down?

Am anxious to see if I get more frames with your new update though, Thanks!

Update: On 700D for silent pictures End Trigger, it went from 25 frames in buffer to 41! Nice update!
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #6 on: April 11, 2016, 11:53:46 PM »
Looks I've got the pre-recording mode working as well in raw_rec.

Bonus points: it merges cleanly with mlv_lite as well :D

mk11174

  • Hero Member
  • *****
  • Posts: 766
Re: Pre-recording for the raw_rec module?
« Reply #7 on: April 12, 2016, 02:21:24 AM »
You got to be kidding me!!!! Very cool, will have to try this out for sure! Thanks!  :)

Update: pre-record works nicely, I like how it shows the amount of seconds capable of pre record, so if u pick 10 seconds,  it will show you while recording if its possible,  and if not, it will show how much you can get for the fps and resolution camera is set for.

I see its pre record time amount doubles pretty much with srm on, then if turned off, so that's obviously working good too.

At first I was confused cause when I started recording, I waited a bit, saw up top the pre record amount in seconds,  then I pressed shutter to save, but it started writing, then kept recording until I pressed shutter. I was thinking it was going to stop capturing and save all frames from pre buffer up to where I pressed shutter, eventually I figured out how u set it up and got use to it.

Pretty cool you got it coded so quickly.

I was using 700d for testing by the way.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #8 on: April 12, 2016, 04:06:03 PM »
At first I was confused cause when I started recording, I waited a bit, saw up top the pre record amount in seconds,  then I pressed shutter to save, but it started writing, then kept recording until I pressed shutter. I was thinking it was going to stop capturing and save all frames from pre buffer up to where I pressed shutter, eventually I figured out how u set it up and got use to it.

Yeah, one of the harder steps was finding a help text that would fit in two lines, about 70 chars each. Can you suggest a better one?

mk11174

  • Hero Member
  • *****
  • Posts: 766
Re: Pre-recording for the raw_rec module?
« Reply #9 on: April 12, 2016, 04:24:50 PM »
No, you did fine on help file, I was to anxious to try it, I didn't even know there was help text, lol.  :-[

Yours makes perfect sense though.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free

Lars Steenhoff

  • Member
  • ***
  • Posts: 166
Re: Pre-recording for the raw_rec module?
« Reply #11 on: July 21, 2016, 05:32:00 PM »
so is it possible to use this ?

is it part of a nightly build?

Thanks

Walter Schulz

  • Hero Member
  • *****
  • Posts: 5307
Re: Pre-recording for the raw_rec module?
« Reply #12 on: July 21, 2016, 07:34:44 PM »
As long as a pull request's status is "open" it is not part of "main" branch (-> "unified") and main branch will be compiled to "official" nightly builds.
Therefore: Yes, you can use it if you compile it for yourself and no, it is not part of nightly build.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #13 on: February 11, 2017, 06:31:45 PM »

Lars Steenhoff

  • Member
  • ***
  • Posts: 166
Re: Pre-recording for the raw_rec module?
« Reply #14 on: February 11, 2017, 07:39:50 PM »
Thanks for the update!

I just tested and works well on my canon 5d mk3
Super cool feature to have.

 :)

janvkem

  • New to the forum
  • *
  • Posts: 5
Re: Pre-recording for the raw_rec module?
« Reply #15 on: February 13, 2017, 08:41:26 PM »
Great feature! Excellent for unpredictable action. Am I impolite if I'd ask for a 10-bit capable version?  :)

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Pre-recording for the raw_rec module?
« Reply #16 on: February 15, 2017, 02:22:15 PM »
Oh yea! Yet another magic bullet to add to my arsenal.. I will have to test this soon..
Thanks A1ex mk11174!
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Frank7D

  • Senior
  • ****
  • Posts: 441
Re: Pre-recording for the raw_rec module?
« Reply #17 on: February 17, 2017, 04:43:23 PM »
Tested on 7D.

~ Used 2 sec delay
~ Video was 136 frames (0-135) but was reported as 873 frames by mlv_play (and by MlRawViewer). Is it possible it is counting the time from the first button push?
~ Last frame (135) has a pink band running across the very bottom of the image
~ The two anomalies do not make the feature unusable.

This is a wonderful feature. If it could be added to mlv with 10/12 bit recording it would be even better.

Frank7D

  • Senior
  • ****
  • Posts: 441
Re: Pre-recording for the raw_rec module?
« Reply #18 on: February 18, 2017, 05:43:45 PM »
Here's the 136 frame raw file that is seen as 873 frames:
https://www.dropbox.com/s/rx1gnyd04m3serk/M17-1121.MLV?dl=0

bouncyball

  • Member
  • ***
  • Posts: 147
Re: Pre-recording for the raw_rec module?
« Reply #19 on: February 28, 2017, 04:20:45 PM »
Hehe nice one :). Actually I have lot of MLV files (older/newer ones, recorded by mlv_rec not raw_rec) where real frame number is less than reported from the header(s). Differences like 2-3 frames are common. With multichunk MLVs even more (7-25 that I've seen myself). The files are all normal - no bad/corrupted frames nothing special but frame count is off. So I'm not sure about frame count until I index the MLV. However 737 frames difference is really strange ;).

Little bit OT... I also experienced the behavior when VIDF block size differs by 48 bytes from all other VIDF blocks. This always happening when VIDF is exactly before of after RTCI  (RTCI block exactly 48 bytes long). I guess it's related to EDMAC async transfers.

bb

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #20 on: March 11, 2017, 07:51:39 AM »
~ Video was 136 frames (0-135) but was reported as 873 frames by mlv_play (and by MlRawViewer). Is it possible it is counting the time from the first button push?

Thanks, fixed. The bug was present in the regular mlv_lite as well, but the difference wasn't that big (and went unnoticed since mlv_dump, and probably most other converters, only use the header counter for info purposes).

~ Last frame (135) has a pink band running across the very bottom of the image

Could not see it with mlv_dump; have a screenshot after conversion?

Little bit OT... I also experienced the behavior when VIDF block size differs by 48 bytes from all other VIDF blocks. This always happening when VIDF is exactly before of after RTCI  (RTCI block exactly 48 bytes long). I guess it's related to EDMAC async transfers.

Not sure how to reproduce this one. On the attached example, I checked with:
Code: [Select]
mlv_dump M17-1121.MLV -v | grep VIDF -A 2 | grep Size | uniq
Result:
Code: [Select]
    Size: 3629056

bouncyball

  • Member
  • ***
  • Posts: 147
Re: Pre-recording for the raw_rec module?
« Reply #21 on: March 11, 2017, 11:31:40 AM »
@a1ex

The assumption that size differs only by 48 bytes turned out to be wrong. Difference can vary. Here are the sample logs from various MLVs.

When using crop_rec there are no NULL blocks in MLV at all, Frame size also varies. ML version used to record these crops: magiclantern-crop3x.2017Jan13.5D3113.zip.

This somehow OT here b/c all of them recorded by mlv_rec (audio is on) not raw_rec/mlv_lite (to be inspected yet).

Here is excerpt from ordinary non crop MLV log recorded back in 2014:

Block: VIDF
  Offset: 0x0a628c60
    Size: 3629824
    Time: 2416.261000 ms
   Frame: #0048
    Crop: 152x132
     Pan: 146x133
   Space: 992
Block: RTCI
  Offset: 0x0a99f060
    Size: 48
    Time: 2436.508000 ms
     Date:        05.03.2017
     Time:        11:37:11 (GMT+0)
     Zone:        ''
     Day of week: 0
     Day of year: 63
     Daylight s.: 0
Block: VIDF
  Offset: 0x0a99f090
    Size: 3629264
    Time: 2458.010000 ms
   Frame: #0049
    Crop: 152x132
     Pan: 146x133
   Space: 432
Block: VIDF
  Offset: 0x0ad15260
    Size: 3629312
    Time: 2499.301000 ms
   Frame: #0050
    Crop: 152x132
     Pan: 146x133
   Space: 480
Block: VIDF
  Offset: 0x0b08b460
    Size: 3629824
    Time: 2541.135000 ms
   Frame: #0051
    Crop: 152x132
     Pan: 146x133
   Space: 992

Regards
bb

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #22 on: March 11, 2017, 02:30:38 PM »
Understood, so it's not related to mlv_lite.

Anyway, thanks for testing feedback. I've pushed a fix and now the frame counter from header matches the actual number of frames from the file. Merged into unified as well, since it seems pretty solid to me.

This development opened the door to another interesting feature - recording triggers using half-shutter. See this PR for details:

https://bitbucket.org/hudson/magic-lantern/pull-requests/819/half-shutter-triggers-for-raw-recording/diff

Danne

  • Hero Member
  • *****
  • Posts: 2719
Re: Pre-recording for the raw_rec module?
« Reply #23 on: March 11, 2017, 04:14:39 PM »
Wow. This is a major feature. Just tested and it works really good. There is a bunch of scenarios where this will be a game changer, nature filming for instance. Never miss a moment.
For anybody who wants to play with this put the mlv_lite.mo into your ML folder from the experimental section.
https://builds.magiclantern.fm/jenkins/job/rec-trigger/30/artifact/modules/mlv_lite/mlv_lite.mo

1 - In RAW video select Rec trigger and one of the options. Just tested Half-shut: start/pause and Half-shut: hold and both works. Briefly tested.
2 - Hit rec and then press half shutter either holding it down or simply press and release depending what is selected. When done hit rec again to end recording.

Danne

  • Hero Member
  • *****
  • Posts: 2719
Re: Pre-recording for the raw_rec module?
« Reply #24 on: March 12, 2017, 08:38:35 AM »
I really dig this rec_trigger. Did some more testing and it seems pretty solid already. Lacks 10/12-bit right now. The 1-frame shut is great to work with.
Tested working also with crop_rec module. Ran 1:1 (centred x5 zoom) solid working as well as 3x3 720p (1xwide) all three rec_trigger modes. Also tested with HDR filming enabled. Working.

bouncyball

  • Member
  • ***
  • Posts: 147
Re: Pre-recording for the raw_rec module?
« Reply #25 on: March 12, 2017, 11:54:02 AM »
Haha fantastic!

mlv_lite's getting better and better. Only thing I'm missing there is optional audio recording ;).

Since I always use back button focusing (af-on, not half shutter) on my 5d3, I noticed that pressing af-on also triggers recording. I want to focus by af-on while camera in rec hold mode and start recording only after I push and hold the shutter button. Is that possible?

bb

Danne

  • Hero Member
  • *****
  • Posts: 2719
Re: Pre-recording for the raw_rec module?
« Reply #26 on: March 12, 2017, 03:52:22 PM »
Working nicely on the eos m too :). Of course audio included would be a killer.
Shameless question about possibilities to change settings like iso and shutter while in pause mode. Is it possible?
Exciting times.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #27 on: March 12, 2017, 04:58:25 PM »
Disable small hacks and Canon's user interface functionality should be restored (at the price of a minor speed drop). Maybe it should be disabled by default, since recording speed is no longer critical with 10- and 12-bit recording.

Changing ISO and shutter works on 5D3 without disabling the hacks (even while recording), but has some UI quirks.

Danne

  • Hero Member
  • *****
  • Posts: 2719
Re: Pre-recording for the raw_rec module?
« Reply #28 on: March 12, 2017, 05:14:30 PM »
Actually disabling Use SRM memory got rid of the BUSY state signal while hold and then the settings could be change with or without global draw on. Real nice! I left the small hack on. 

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #29 on: March 12, 2017, 05:18:29 PM »
Hm, I have SRM memory enabled and I don't have any BUSY screen. Tried both global draw on and off, AF on and off. I'm currently on 1.2.3.

Danne

  • Hero Member
  • *****
  • Posts: 2719
Re: Pre-recording for the raw_rec module?
« Reply #30 on: March 12, 2017, 05:36:24 PM »
5D mark III 1.1.3
Eosm202
Tried again and also whith the compilations from the experimentals section as opposed to my own compiling builds but still BUSY state once rec is on and while in hold state. When ending recording BUSY stays for a second or so before dissapearing from the screen. I thought it was normal behaviour. BUSY state is always on while recording regular raw and after stopping it leaves after a second or so. Same for mlv_lite and mlv_rec. I could check the behaviour on a non experimental build and report back.
The BUSY state signal works the same on eosm, just tested.

*update
BUSY state behaviour on nighly_builds/experimental_builds/mlv_lite/mlv_rec/rec_trigger and so on, related to SRM memory.

bouncyball

  • Member
  • ***
  • Posts: 147
Re: Pre-recording for the raw_rec module?
« Reply #31 on: March 12, 2017, 06:40:37 PM »
@a1ex: I want to repeat my question. Is it possible to focus while in pause mode with AF-ON button without triggering recording. I always use back button to focus instead of half press shutter.

@Danne: I also do not see BUSY message with or without SRM. (fw. 1.1.3)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #32 on: March 12, 2017, 06:54:52 PM »
Telling the difference between AF and half-shutter is a bit tricky. The silent picture module uses a heuristic - if in AF mode, it waits for a few hundreds of ms to see whether the lens starts autofocusing. If yes, the half-shutter press is ignored.

Logging the MPU messages might give some more clues.

So, it's possible to implement it, but the trigger will be delayed and will require a long half-shutter press (unless another way to tell the difference between the two buttons is found).

bouncyball

  • Member
  • ***
  • Posts: 147
Re: Pre-recording for the raw_rec module?
« Reply #33 on: March 12, 2017, 07:07:40 PM »
@a1ex: Understood. Thank you for the explanation.

@Danne: Actually I was wrong about BUSY on screen message. It just half hidden under overlay but is there all the time while recording if SRM is on.

Also "Use SRM memory" menu item help/hint tells us:"Side effect: will show BUSY on the screen and might affect other functions" :P

Danne

  • Hero Member
  • *****
  • Posts: 2719
Re: Pre-recording for the raw_rec module?
« Reply #34 on: March 12, 2017, 08:17:17 PM »
Quote
Actually I was wrong about BUSY on screen message.
Darn, here I thought I was having something special going on with my 5D  :P
I guess the busy state is normal then and will interfere with setting changes working rec_trigger also with 1.2.3?

mk11174

  • Hero Member
  • *****
  • Posts: 766
Re: Pre-recording for the raw_rec module?
« Reply #35 on: March 12, 2017, 10:11:25 PM »
Hey, not around much anymore, BUT, I really would like to say I am loving the way this feature progressed! I find the 1 frame with pre record for 2 seconds very useful, VERY COOL! Other options work just fine as well! Glad Alex kept going on this one, love how it works with my DIY half shutter press button for my 700D. I will surely test this during storm season, should work fine, already tested in flash, and it captures them all just as good as Bolt Trigger module does. But this will be perfect as well for capturing nature events for sure or any kind of action that is hard to capture without record constantly, LOVE IT!!!
500D/T1i  550D/T2i  600D/T3i  700D/T5i

Kharak

  • Hero Member
  • *****
  • Posts: 562
Re: Pre-recording for the raw_rec module?
« Reply #36 on: March 14, 2017, 03:06:37 PM »
Hey, I am not much around either these days.

Could I suggest you rename this thread to 'Pre-Recording for Raw_Rec Module'? Its confusing to search for this on the forum when the thread does not correspond with the name of the feature.

So I downloaded latest nightly build yesterday, very eager and surprised by this new feature. Very very happy with it.

Though I had troubles getting any Module to Link as it said. I suppose it was because I had the Crop_rec module on there aswell, not sure? Deleted everything of the SD card and then it worked, used to be I just copy paste and overwrite whatever was on. Is Crop_rec Module not compatible with the latest nightly ? I mean for MLV_Rec aswell ? I don't remember if Crop_rec was only Experimental. Crop_Rec modules is also a Killer feature that I really enjoy working with. anyways, back on topic.

Could it be possible to adjust the desired amount of Pre-Recording by scrolling the shutter wheel in increments of 8-16 frames or so or just 1 second at a time? And that it showed more precisely how much is pre-recorded, preferably in X.X secs or even Frames? I had an issue today when I set it at 5 seconds, trying to film waves breaking over this ship I am shooting on. First of, it counted 3 seconds and when I hit record again a message popped up everytime saying something like "Buffer can not reach desired amount" and it would cancel the recording, so had to set it to 2 Secs. I don't remember exactly the message because when I was done shooting and trying to replicate the problem for this post, it worked with the 5 Seconds e.g. Counting to 3 secs and hitting record worked.. So I don't know what was going on there today. All settings were the same when I tried to replicate.

Which brings me back to why it would be nice to have clearer information on how much I am Pre-Recording. When it says "3 Secs" pre-recorded? Is that precisely 3 secs e.g. 3x 24 Frames or is it 3 secs and some more frames until it reaches 4x24 frames and it says 4 Secs ? I assume the buffer is not always holding the exact same amount of frames depending on background processes and other settings on camera?

Oh! and one more question, will this feature be seen in MLV_Rec in the future? for sound and metadata recording ?

Anyways, thank you so much for you're continued efforts with these cameras. My MK III still feels on par with anything else coming out these days.

Latest Nightly: March 12 -  2017
1920x1080 14 bit
MK III

Kharak.

EDIT: What steps could I take to increase the amount of Buffering in 14 bit ?
once you go raw you never go back

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #37 on: March 14, 2017, 06:15:36 PM »
You might be able to use it with crop_rec if you copy just mlv_lite.mo from the nightly, and you keep the old files from the crop_rec build. Didn't try, but if it doesn't work, I can sync the branches. The crop_rec branch is experimental because of the backend (last time I took it outside, i.e. many months ago, I had ERR70).

The error message was probably just the buffer getting full. When you select a large amount, it reserves 16MB for future buffering; maybe I should reserve some more. At such small buffer sizes, it can quickly run out of steam if the card write speed isn't known very well (it's measured on the fly), or if unexpected speed drops occur (they do). Though I don't remember noticing this message when testing (maybe I didn't push the settings far enough).

The display is currently rounded. I agree a more exact display could be useful, especially on cameras with less memory.

The buffer size will become less of an issue with reduced bit depths. I'm thinking to merge the current state into nightly and just hide the reduced bit depth menu on models with known issues, as it seems to work pretty well on recent models (except in-camera playback, which require raw_twk).

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9562
  • 5D Mark Free
Re: Pre-recording for the raw_rec module?
« Reply #38 on: March 15, 2017, 12:27:47 AM »
I think I've got a way to limit the max memory available for pre-recording without causing the regular recording to run out of steam.

How it works? The amount of memory reserved for recording (that is, not available for pre-recording) was fixed to 16MB before, and now it depends on both resolution and write speed. I expect recording will continue after pre-recording, so I reserve a buffer large enough to allow recording 500 frames with 90% of the measured write speed, but not more than half of the RAM and not less than 10 frames. That should give continuous recording, with buffer usage peaking somewhere near maximum, and then recovering.

That also means the pre-recording buffer size drops quickly as your required write speed approaches your card write speed.

There is an exception: if the trigger is set to "Half-shutter: 1 frame", there's little need for buffering after pre-recording. In this case, the pre-recording buffer is maxed out (using nearly all the available RAM).

The amount of memory available for pre-recording can now be seen in menu, if your selection exceeds the limit. Caveat: you need to record a test clip first.

Experimental build available; please report.

Kharak

  • Hero Member
  • *****
  • Posts: 562
Re: Pre-recording for the raw_rec module?
« Reply #39 on: March 15, 2017, 01:26:13 AM »
Reporting in:

Tested your new experimental mlv_lite with latest nightly and it worked on the first try. I set it at 5 seconds and it buffered to 3 secs and I hit record again and it worked.

I then did as you suggested, added this latest mlv_lite to the latest crop_rec build (I was apparently running an older version) and it too worked flawlessly. Though on very first try, it buffered to 2 secs and then on second try and every shot after that it was back to 3 secs.

And nice with the finer increments by the way, I used 5 Secs on theses tests because thats what failed on my shoot earlier this day. Maybe it failed last time because I just switched from mlv_rec to mlv_lite and the buffer somehow gets "confused" or some code stuff happens there. Just thought it might be a detail worth mentioning for the record, though it seems its resolved now anyways.

Thank you for your quick response and fix.

I have just seen that there is a Proxy recording module or build. How would that fair with Pre-Recording? I would personally not mind if the H264 file is not Pre-Recorded if it had to be so, but could this also somehow be conjoined? I have not tested it on a stand-alone basis or even read through the entire thread, so not sure how stable it is.

EDIT:

MK III
Lexar 1066x 128GB
14 bit
once you go raw you never go back

mk11174

  • Hero Member
  • *****
  • Posts: 766
Re: Pre-recording for the raw_rec module?
« Reply #40 on: March 17, 2017, 07:29:15 AM »
Working nicely here, love the grayed out amount of how many seconds you can get when selecting a to high of a pre-buffer, very nice addon!

Man, if this had motion detection and luminance detection this would be the ultimate module, not that it isn't already, but damn, this is working very nice for those addons to be of use.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

janvkem

  • New to the forum
  • *
  • Posts: 5
Re: Pre-recording for the raw_rec module?
« Reply #41 on: Yesterday at 12:25:03 AM »
Installed magiclantern-crop3x.2017Mar21.5D3113 and all seems to work (only checked briefly). Thanks a lot for combining it with the 10 bit recording! I really like the pre rec option!

vstrglv

  • Member
  • ***
  • Posts: 118
Re: Pre-recording for the raw_rec module?
« Reply #42 on: Yesterday at 08:19:11 PM »
I also installed magiclantern-crop3x.2017Mar21.5D3113. It works fine. Many thanks for compiling.
I have some questions.
1. If i load mvl_rec.mo and mvl_lite.mo and activate mvl_rec there is no sound recording.
2.If I load mvl_lite.mo and raw_rec.mo there is no difference which of them to activate. Both work as mlv_lite.

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 2857
Re: Pre-recording for the raw_rec module?
« Reply #43 on: Yesterday at 09:15:03 PM »
Quote
@a1ex

The assumption that size differs only by 48 bytes turned out to be wrong. Difference can vary. Here are the sample logs from various MLVs.

When using crop_rec there are no NULL blocks in MLV at all, Frame size also varies. ML version used to record these crops: magiclantern-crop3x.2017Jan13.5D3113.zip.

This somehow OT here b/c all of them recorded by mlv_rec (audio is on) not raw_rec/mlv_lite (to be inspected yet).

Here is excerpt from ordinary non crop MLV log recorded back in 2014:

what you might be seeing is the feature of mlv_rec to embed periodic/onevent blocks into the "DMA-alignment-padding" area of VIDF blocks.
this area would else have been just waste. so i decided it to place some low rate data in it - like RTCI and stuff.

iirc this is done by modifying frameSpace. (today i would simply use NULL blocks for that)

bouncyball

  • Member
  • ***
  • Posts: 147
Re: Pre-recording for the raw_rec module?
« Reply #44 on: Today at 11:16:54 AM »
@g3gg0

Thank you for the explanation. I suspected it was caused by some alignment-padding.

Just one more thing: why crop_rec MLVs do not have any NULL blocks?