RAW video timelapse with frame skipping

Started by dhilung, June 13, 2013, 11:50:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dhilung

This is a small change in the raw_rec module to enable timelapse video. It simply skips frames during the timelapse frame-interval, hence the slow card I/O is no more an issue.

The 'FPS override' somewhat gives similar results (usually desirable in a low-light condition). However, this frame-skipping option gives us better control over the FPS and the shutter-speed for timelapse, specially in a bright-light condition. It can still be used along with the 'FPS override'.



Test video



[updated to changeset:   7713:80e3ca539891]
raw_rec.c
raw_rec.mo
5D2 | 40D

SuperSix

Great ! Is it also available on the 5DIII ?

dhilung

Quote from: SuperSix on June 13, 2013, 12:06:48 PM
Is it also available on the 5DIII ?
I have not tested, but I think it should work just fine in 5D3.
5D2 | 40D

brapodam

It's nice, but there seems to be a fair bit of flickering going on in the video. Nevertheless, I hope to see this implemented in the main builds, because this eliminates the need for a ND filter to accommodate the shutter speeds imposed by FPS override.

JoshuOne

Super, dhilung. I just got through testing this module with my 500D and I am liking it, however there is a white stripe at the bottom of frame and I am wondering if this is due to the resolution (1584x636... which was highest i was allowed) that I used or if it is a bug of this mod. Thanks so much for this, and I am looking forward to using it as my last timelapse wasnt all that I desired. Keep up the good work. By the way, the white stripe is easy enough to cover with a black solid in AE...
~JoshuOne

a1ex

Why not just enable the intervalometer and silent pics? You get DNGs straight from the camera.

brapodam

Quote from: a1ex on June 13, 2013, 04:14:52 PM
Why not just enable the intervalometer and silent pics? You get DNGs straight from the camera.
I'm not sure if it's changed now, but the last time I tried it, silent pics came out really soft (even softer than H264 video), with a purplish tint (could be because I screwed the white balance, though it was on auto so I don't see how this could happen), with no ability to shoot with the screen off, and with some frames having issues like having a purple box at the bottom. Also it doesn't seem to shoot at the rate that I set the intervalometer to (it seems a lot slower - setting it to 1s interval resulted in something like 3s interval between pics)

Again, it could have changed since the last time I tested it, so I'm not sure if it has all these issues.

JoshuOne

Honestly, a1ex, I do not know any reason not to just use the intervalometer and silent pics, I shot a little test just now to make sure it really was that simple and sure enough it seemed to be. I do think that I was given a limit on the number of frames, and if they are considerably less than those available with this module, that could be a reason. As it is, the straight DNGs from silent pics are missing the white stripe and are one less post-pro step from greatness! Thanks for the suggestion.
~JoshuOne

brapodam

Quote from: JoshuOne on June 13, 2013, 04:57:35 PM
Honestly, a1ex, I do not know any reason not to just use the intervalometer and silent pics, I shot a little test just now to make sure it really was that simple and sure enough it seemed to be. I do think that I was given a limit on the number of frames, and if they are considerably less than those available with this module, that could be a reason. As it is, the straight DNGs from silent pics are missing the white stripe and are one less post-pro step from greatness! Thanks for the suggestion.
~JoshuOne
I just tested silent pics again today and from what I can tell, it doesn't keep up with the interval I set it to (1s). It may work for longer intervals, but it seems more like 2-3s between each picture from my quick test. This is strange because RAW video has no issues whatsoever doing 1fps video, apart from the 4GB limit, which you can just use the auto restart video feature (In timelapse, it doesn't matter if you miss a few seconds of frames, because depending on your interval, you may lose just 1 or 2 frames, which is not a big deal).

Honestly speaking, converting RAW to DNG doesn't take that long, so if we have this change implemented, I think we can do away with silent pics altogether. Last I checked, silent pics with intervalometer don't generate the post-deflicker XMP or UFRAW files anyway, so I don't see them being more useful than RAW video with this small change.

Also, after a quick test, I did not see the white stripe at the bottom that you described. I'm using the 60D though, so it could be different.

I think this would be most useful if Auto ETTR could work while recording too. I could not get it to work while recording; Auto ETTR only sets the exposure before recording despite setting it to always on (or am I doing something wrong?). It can work manually if you put it to set and press set while recording, but that's dumb because you'll have to repeatedly press set while recording, which is not an option for time lapse videos.

Aquillum

I'd love to try this on my 550D !

My main issue with SilentDNG + Intervalometer is
-  the lack of Display off.
   In 3sec intervals  it just doesn't go off (too short ? )so battery dies quickly
- XMP files arent written, even if ETTR is measured right, so there will be no advantage over FPS override/skip
  If XMP creation could be enabled also for SilentDNG I would prefer that option cause its an awesome feature.

JoshuOne

Greetings, I just thought of one more reason to use this mod in stead of silent pics, I think we are limited to 1000 frames in silent pics.
~J1
-edit- I am testing now to see if this mod will let me go over 1000 frames or not, I have to go to a one-second or more interval to be able to record at 1584-636 on my 500D without filling the buffer.
-edit- As I suspected, I was able to shoot well over 1000 frames using this frame-skipping mod._

EOS4K

Is it possible to record 4K video at 1fps using the new Magic Lantern RAW video hack? Wouldn't 1fps eliminate the need to sacrifice resolution (due to limited data transfer speeds) in RAW video mode?

Is there a reason this sample video was shot at 1872x1250 and not 2048x1080 or 3840x2160?


Thanks!


brapodam

Quote from: EOS4K on June 16, 2013, 07:39:32 AM
Is it possible to record 4K video at 1fps using the new Magic Lantern RAW video hack? Wouldn't 1fps eliminate the need to sacrifice resolution (due to limited data transfer speeds) in RAW video mode?

Is there a reason this sample video was shot at 1872x1250 and not 2048x1080 or 3840x2160?


Thanks!
I think they pull the RAW image from the live view buffer or something (at least that's how the 14 bit DNG silent pics work), so the max we can get is the live view resolution, which depends on your camera.

EOS4K

Quote from: brapodam on June 16, 2013, 08:35:10 AM
I think they pull the RAW image from the live view buffer or something (at least that's how the 14 bit DNG silent pics work), so the max we can get is the live view resolution, which depends on your camera.

Is THAT how it works? :o

The 5D Mk III has an LCD resolution of 1.04 dots (read 720x480 pixels). How are people producing RAW video in 1080p and even 2.5K from a Live View screen with DVD resolution? Perhaps I'm missing something here. In any case, I don't see why 4K would be impossible, seeing that 2.5K has already been demonstrated.

Any clarification would be greatly appreciated!

CFP

Yes that is how it works.

The RAW videos and silent pics are the images that are read from the sensor for the LiveView preview.

The max resolutions depend on the sensor resolution. My EOS 600D's sensor has a resolution of 5202 X 3465. The higest resolution that's possible for RAW is 1734 X 1155. That's because Canon doesn't read the full sensor and scales it to what ever we want but skips lines and columns to create their desired resolution. In the 600D's case, it skips every third line and column (5202 / 3 = 1734 & 3465 / 3 = 1155) to get a resolution that is close to full HD (1920 X 1080) in terms of width. So it can be used to create full HD H.264 videos.

Only if the developers would find a way to set the lines & columns skipping, higher resolutions might be possible on the 5D Mark III in 1X mode.
But it doesn't look like that is possible.

dhilung

Quote from: a1ex on June 13, 2013, 04:14:52 PM
Why not just enable the intervalometer and silent pics? You get DNGs straight from the camera.
Yes, that also gives similar results, and I support having one implementation for one feature. However, as of now, I still see at least two advantages while using frame skipping 1) better fps precision at low frame intervals (<2s) 2) easier file management (a single file per timelapse session). Not to mention that all the current and future raw video related features, such as live cropping, can be enjoyed in a timelapse session.
5D2 | 40D

EOS4K

Quote from: CFP on June 20, 2013, 05:19:48 PM
Yes that is how it works.

The RAW videos and silent pics are the images that are read from the sensor for the LiveView preview.

The max resolutions depend on the sensor resolution. My EOS 600D's sensor has a resolution of 5202 X 3465. The higest resolution that's possible for RAW is 1734 X 1155. That's because Canon doesn't read the full sensor and scales it to what ever we want but skips lines and columns to create their desired resolution. In the 600D's case, it skips every third line and column (5202 / 3 = 1734 & 3465 / 3 = 1155) to get a resolution that is close to full HD (1920 X 1080) in terms of width. So it can be used to create full HD H.264 videos.

Only if the developers would find a way to set the lines & columns skipping, higher resolutions might be possible on the 5D Mark III in 1X mode.
But it doesn't look like that is possible.

Thank you, CFP! I really appreciate your astute explanation for the current limitations with RAW HD videos from Canon EOS DSLRs. The 5D Mk III has a maximum sensor resolution of 5760 x 3840. 5760/3 = 1920. What a fabulous coincidence! Other sensors simply don't have such a perfect pixel count.

alexunderboots

5DM2 build 25.06.13 can't load module - error (((((

tcc: error: undefined symbol 'raw_lv_share_right' [E] failed to link modules

g3gg0

Quote from: CFP on June 20, 2013, 05:19:48 PM
Only if the developers would find a way to set the lines & columns skipping, higher resolutions might be possible on the 5D Mark III in 1X mode.
But it doesn't look like that is possible.

i found the line skipping parameter already. its ADTG register 0x800C.
but when changing it, the screen seems to "overprint" multiple times.
looks like the bottom scanlines are printed over the top as the image gets larger in vertical dimension.

didnt find the register that handles line count / end address.
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!

gerk.raisen

@dhilung

Could you post a diff file of your modification?
Better if is it against last commits. :)

Thank you.

dhilung

Quote from: g3gg0 on July 01, 2013, 01:05:22 PM
i found the line skipping parameter already. its ADTG register 0x800C.
but when changing it, the screen seems to "overprint" multiple times.
looks like the bottom scanlines are printed over the top as the image gets larger in vertical dimension.

didnt find the register that handles line count / end address.
@g3gg0 that sounds exciting!


Quote from: gerk.raisen on July 01, 2013, 01:46:02 PM
@dhilung

Could you post a diff file of your modification?
Better if is it against last commits. :)

Thank you.

@gerk.raisen
Sure :) Here is a diff to the last commit.
(changeset:   7713:80e3ca539891)


90a91,94
> //for timelapse
> static int fskip_choices_x[] = {0,0.1,0.5,1.0,1.5,2.0,3.0,4.0,8.0,15.0,30.0,1.0*60, 2.0*60,5.0*60,10.0*60,30.0*60};
> #define FSKIP_CHOICES_X CHOICES("OFF","1/10 sec","1/2 sec","1 sec","1.5 sec","2 sec","3 sec","4 sec","8 sec","15 sec","30 sec","1 min","2 min","5 min","10 min", "30 min")
>
100a105,106
> //no config yet
> static int fskip_index_x=0;
177a184,185
> static int fcounter=0;                            /* frame counter for timelapse mode */
> static int fskip_count=0;                         /* frames to skip in timelapse mode. Calculate in fskip_update.*/
527a536,541
> static MENU_UPDATE_FUNC(fskip_update)
> {
>     float fps = fps_get_current_x1000() / 1000.0;
>     fskip_count = (int)(fps*fskip_choices_x[fskip_index_x]);
> }
>
1296a1311,1323
>     /* frame skipping for  timelapse mode */
>     if (fskip_count>=1)
>       {
> if (fcounter>=fskip_count)
>   {
>     fcounter=0;
>   }else
>   {
>     fcounter++;
>     return 0; //skip this frame
>   }
>       }
>
1950a1978,1986
>                 .name = "Frame interval",
>                 .priv = &fskip_index_x,
>                 .max = COUNT(fskip_choices_x) - 1,
> .update = fskip_update,
>                 .help = "Skip frames for timelapse.",
>                 .choices = FSKIP_CHOICES_X,
>
>             },
>             {
5D2 | 40D

g3gg0

cant we keep that out of the raw_rec module and add another that handles frame skipping?
like bolt_rec was doing.
this would not take a lot of code. just implement the skip-check routines.

then you can "distribute" your own module that can add dozens of custom frame drop settings and stuff
without having to mess around with the raw_rec code.
(then it is more likely to get into ML source tree)
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!

a1ex

I still don't see a valid reason for using this and not FPS override or intervalometer.

g3gg0

not sure, but maybe due to the single container file? :)
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!

dhilung

Quote from: g3gg0 on July 03, 2013, 12:45:50 PM
not sure, but maybe due to the single container file? :)

Exactly, as a time-lapser, I can tell that life gets way easier during post production :) since I don't have to remember or hunt down 'that' transition of sequence. I can treat each timelapse session as a movie session (which essentially is), and directly work on it (e.g., directly import to AE using Ginger HDR etc.)

But again, technically, both ways give the exact same RAW data. This small modification was for a personal convenience, thought might be useful to others. I'll see if making a separate module makes sense.
5D2 | 40D