MLV container like magic lantern - Feature Requests - CHDK Forum
supplierdeeply

MLV container like magic lantern

  • 7 Replies
  • 3860 Views
MLV container like magic lantern
« on: 03 / June / 2015, 03:21:05 »
Advertisements
I am shooting a lots of timelapse.

working with thousands of DNG files is a bit cumbersome.

magic lantern are storing RAW movie in an MLV container, which is easier to work with.

is it possible to port the MLV container to CHDK, so that a series of timelapse DNG pictures can be storing in one single MLV file?

*

Offline reyalp

  • ******
  • 14114
Re: MLV container like magic lantern
« Reply #1 on: 03 / June / 2015, 16:47:24 »
is it possible to port the MLV container to CHDK, so that a series of timelapse DNG pictures can be storing in one single MLV file?
There is no technical reason raw data couldn't be written to a different kind of file, including one that stores multiple frames per file.

However, it seems like converting a series of raws into your preferred format should be pretty easy to automate on a PC. This doesn't seem like a good reason for me to spend a bunch of time on development.

There might be some performance benefit, but without a lot of additional development it would likely be marginal, similar to the difference between "CHDK raw" and DNG.

MLV appears to be an invention of the ML team (http://www.magiclantern.fm/forum/index.php?topic=7122.0) it's not immediately clear if the existing format and tools could support P&S data without modifications. At a minimum, I would guess that their tools don't support 10 and 12 bit data (but I haven't looked.)

Don't forget what the H stands for.

Re: MLV container like magic lantern
« Reply #2 on: 04 / June / 2015, 01:24:09 »
thank you for looking into this.

yes, agree that this is not a very good reason to develop this. and I too agree that the size advantage is too small to justify.


Re: MLV container like magic lantern
« Reply #3 on: 04 / June / 2015, 17:33:26 »
hi, g3gg0 there, over from Magic Lantern.
after some trouble with antispam not allowing me to register, i finally could solve that using IE :)


MLV file format itself supports any bit depth between 1 and 16 bits, just by setting the right
bit depth in the field bits_per_pixel of raw_info in RAWI block. however, the ordering scheme
of the bits must stay the same.

the MLV RAW frame format is the unmodified stream the EDMAC is receiving from the ADCs.
as alex noted in raw.h, the 14 bit data is written there as 16 bit words like that:

(explanation: every letter is one bit. 'a' is the first pixel, 'b' the second, etc..)
Code: [Select]
    MSB          LSB
    aaaaaaaaaaaaaabb  (word 1)
    bbbbbbbbbbbbcccc  (word 2)
    ccccccccccdddddd  (word 3)
    ddddddddeeeeeeee  (word 4)
    eeeeeeffffffffff  (word 5)
    ffffgggggggggggg  (word 6)
    gghhhhhhhhhhhhhh  (word 7)
   
all these words are then written as little endian data into the file, swapping the bytes of the 16 bit words,
giving you bytes that contain this data:
Code: [Select]
    aaaaabb aaaaaaaa bbbbcccc bbbbbbbb ccdddddd cccccccc eeeeeeee dddddddd ffffffff eeeeeeff ...

for example if you have a 10bpp RAW mode and the RAW pixel data is set up like this:
Code: [Select]
    MSB          LSB
    aaaaaaaaaabbbbbb
    bbbbccccccccccdd
    ddddddddeeeeeeee
    eeffffffffffgggg


and thus giving you raw data bytest that looks like that:
Code: [Select]
    aabbbbbb aaaaaaaa ccccccdd bbbbcccc eeeeeeee dddddddd ffffgggg eeffffff ...


then by definition MLV format can handle your raw data without modification.

now depending on the tool, your footage can be read or must be converted to 14bpp prior use.
if a tool doesnt support depths different from 14 bits, you can convert your footage using mlv_dump:
Code: [Select]
    ./mlv_dump -b 14 -o <out_14bpp.mlv>  <in_10bpp.mlv>

if the raw data is compatible and you decide to port MLV to CHDK, then people can make use of the
same toolchains for post processing of raw data plus you probably save the
processing time needed for conversion of RAW data to DNG, resulting in shorter frame saving time.

BR,
g3gg0



Re: MLV container like magic lantern
« Reply #4 on: 04 / June / 2015, 21:12:47 »
hi g3gg0

thanks for the comments.

I have been playing with CHDK for years, also have ML on my 60D.

CHDK is so lovely to save DNG in a cheap tiny camera. And MLV is really great to work with.

for my timelapse usage, Ixus camera is really very powerful, I am shooting with 2 cameras, each on a gorilla pod, could be buying 2 more so that I can shoot multiple angles in one location.

size is a big advantage of the tiny cameras, I can bring several cameras at a time, it is not heavy to put more on my backpack.

while on the other hand, I play with MLV and learn the workflow with davinci resolve. They add up together to give professional result without breaking my wallet (except the need to make a powerful computer to run resolve)

the idea to have MLV on CHDK came few days ago, when I am processing thounsands of DNG from 2 cameras. and the advantage is as you said, the same toolchain and shorter saving time.

it could be leading to a solution to another problem I am facing. the slow SD interface in the cameras, making me shooting no faster than 0.5 fps. The timelapse movie, even though I am playing at 24 fps, it still looks way too fast. when shooting moving cumulonimbus cloud, I can't make it looks slower.

*

Offline reyalp

  • ******
  • 14114
Re: MLV container like magic lantern
« Reply #5 on: 04 / June / 2015, 22:32:30 »
Thanks g3gg0 for the information about MLV. It sounds like the 10 and 12 bpp data from P&S would work.

it could be leading to a solution to another problem I am facing. the slow SD interface in the cameras, making me shooting no faster than 0.5 fps. The timelapse movie, even though I am playing at 24 fps, it still looks way too fast. when shooting moving cumulonimbus cloud, I can't make it looks slower.
I doubt there would be a be a really big improvement in shooting speed. In current CHDK code, DNG is generally something like 100-200ms more than a pure framebuffer dump ("CHDK raw"). If that really matters, you could use CHDK raw, but it's fairly inconvenient to work with.

What kind of script are you using for shooting? If your script does a half press / focus / AE cycle for every shot, it is possible to get a significant improvement using continuous mode. Holding half press and clicking full may give similar performance or something in between, depending on the camera. The downside (at least for cameras that don't have an AE in continuous mode options) is that you have to calculate exposure yourself from the raw data, but this can be done. See http://chdk.setepontos.com/index.php?topic=11081.10 for an example.
Don't forget what the H stands for.

Re: MLV container like magic lantern
« Reply #6 on: 04 / June / 2015, 23:48:16 »
hi reyalp, I am using the fast intervalometer script
http://chdk.wikia.com/wiki/UBASIC/Scripts:_A_fast_%22intervalometer%22

I have not been shooting a long enough timelapse to see big lighting condition change, so fixing the exposure at the beginning should mostly work for me.

*

Offline reyalp

  • ******
  • 14114
Re: MLV container like magic lantern
« Reply #7 on: 05 / June / 2015, 01:01:10 »
hi reyalp, I am using the fast intervalometer script
http://chdk.wikia.com/wiki/UBASIC/Scripts:_A_fast_%22intervalometer%22
OK, you won't get a script shooting faster than that :)
Don't forget what the H stands for.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal