Magic Lantern Forum

Using Magic Lantern => Post-processing Workflow => HDR and Dual ISO Postprocessing => Topic started by: 3pointedit on June 17, 2012, 05:12:02 AM

Title: Simple HDR video using Blender's VSE
Post by: 3pointedit on June 17, 2012, 05:12:02 AM
UPDATE:
Here is a revised version of the Blender VSE Quick and Dirty HDR tutorial.

Seems involved but is actually pretty easy and not as hard to do as the old technique.



OLD Version:
Here is a tutorial that I made a little while ago. It relies on the excellent freeware Blender 3D. Apart from the great animation and rendering tools there is a capable video editor inside as well.



1.shoot video at 720 50p (or 60 if you like 30fps result)
2.add the strip to the timeline
3.add a speed effect strip to the shot, turn off "stretch to input length", set "multiply speed" to 2.0
4.drag the tail handle of the shot so that it runs at half it's duration (dur/2)
5.strip is now all dark frames
6.duplicate the camera strip shot, move it up 1 layer
7.nudge it's first frame handle 1 frame to the right then drag shot back to line up with lower shot
8.add another speed effect with "multiply speed" set to 2.0. This will all be light frames
9.line up the 2 shots to start at the same point
10.select both strips (meta each strip with its speed effect if you like) then add a Gamma Cross effect.
11.Gamma effect strip should have "Default Fade" turned of with a value of 0.3. It's "Blend" opacity value should be 1.0
You can vary the mix between light and dark frames by altering the the Gamma Cross "Fade" value.

To check that all this works create a waveform window from the VSE window.

Original blog at http://blendervse.wordpress.com/2011/12/28/vse-hdr-quick-and-dirty-8bit/ (http://blendervse.wordpress.com/2011/12/28/vse-hdr-quick-and-dirty-8bit/)
Title: Re: Simple HDR video using Blender's VSE
Post by: bart on June 17, 2012, 09:41:23 AM
Hi 3point,

Well done and I think this is the best free and multi platform option at the moment. It's an all video work flow in a single and powerful program.
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on June 17, 2012, 11:41:36 AM
Yes b4rt, Blender is a great resource on all platforms and development continues rapidly, thanks to a strong community. For anyone who is interested www.blender.org/ (http://www.blender.org/)

My favourite feature (other than an awesome compositor), would be the fact that it is completely portable! That's right, you can run an animation studio with full HD editor (including sound editing) from a memory stick! And you can upgrade it for FREE at any time.
That is why I like to bundle Magic Lantern and Blender together, as they seem like kindred spirits of the Free Open Software world.
Title: Re: Simple HDR video using Blender's VSE
Post by: scrax on June 17, 2012, 09:44:30 PM
Hi 3point,
thanks for the tut.
Do you know if blender can be used from command line in someway?
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on June 18, 2012, 01:44:14 AM
Thanks for asking, yes you can run Blender from a command line, however IIRC you do not have access to ffmpeg like instructions. That is frame ordering etc. It would have been nice to run a script over all sources in an edit to separate out light and dark frames. You can create Python scripts that run internally, perhaps one could generate a script that dupes a video clip and applies the speed effect etc.

Hope that answers your question. There is a Blender community forum called Blenderartists, there are lots of people over there that could answer better than me.
Title: Re: Simple HDR video using Blender's VSE
Post by: Tired2 on June 22, 2012, 07:28:05 PM
Just wanted to say thanks.  I used this tutorial a while back when trying to learn VSE.  Thanks for putting in and sharing your efforts.
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on June 23, 2012, 01:01:06 PM
I found a much easier way to achieve this effect in Blender and I am looking at making a script to automate it. So stand by...
Title: Re: Simple HDR video using Blender's VSE
Post by: scrax on June 23, 2012, 01:53:28 PM
Great, waiting for it, thinking about include it in MLTools if it is ok for you.
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on June 25, 2012, 02:47:45 AM
Please don't hold your breath waiting, as I must teach myself python scripting first. Hopefully soon though.
Title: Re: Simple HDR video using Blender's VSE
Post by: Videoteq on June 26, 2012, 06:29:27 AM
Great tutorial. Bought the "Track, Match, Blend" DVDs a few weeks ago which are really good too. Seems like there's no stopping Magic Lantern & Blender - what a brilliant combo.
Title: Re: Simple HDR video using Blender's VSE
Post by: sutobe on July 01, 2012, 04:37:03 PM
Hey,

I'm having some problems with this tutorial.

first, I'm totally new to Blender, never had anything to do with it before.....I also find it difficult to control.

Now its this, when I import a movie clip and want to cut the first few seconds of it its really annoying to do.

I mark the clip with right mouse, move the green bar to the part I want to cut the clip and press Shift+S to snip it.

English isnt my first language so maybe I have a total misunderstanding of a "snip" but isnt that suposed to mean to snip the clip apart?

because all it does it jumps to the beginning of the clip, starting where I placed the green bar. -.-

So I tried it with dragging the clip handle to the position I want the clip to start. This works so far but as soon as I divide the clip length by 2 it messes everything up, shrinks the clip and the Speed Control both to tiny dots in the negative part of the "timeline". I hope you get what I mean.

When I drag the clip so its only half as long as before and turn "stretch to input length" off, the picture freezes when playing or scrolling through the clip.


^this is only when I try to make the whole clip shorter!



furthermore, after a couple of hours I somehow managed to get everything done (I kinda know the workflow for After Effects, this is basicly the same), I try to render everything.

the result is very unsatisfying because the light and dark frames arent synchronized, no matter if I put the upper lighter clip on the starting frame of the darker clip or +1 frame.

I'm kinda lost..... + the tutorial in the video is a little bit different to the tutorial you posted beneath the youtube video.

I'm especially struggeling with the Effect strip settings.....and do I have to render both the Meta-strips and the Gamma Cross Effect or do I have to turn off the "eyes" on the metas and only render the Gamma Effect strip?


Isnt ML Tools suposed to process HDR videos? I hope they'll get finished soon because this is giving me headaches.

thanks for any help
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on July 02, 2012, 03:31:12 PM
Shift-S performs a Snap function. That is the Strip or end of a strip will Snap to the play bar. K key is for cutting a strip. Sorry for any confusion I will try to be more clear in future. Try the following technique instead.

Make project settings 25fps, import HDR video of 50fps.

Select the video strip and press N key for properties (on right side of VSE).

Find the Strobe value and increase it to 2.00
The strip will play ONLY light or dark frames.

Duplicate the strip and place it directly above (G key to drag and Y key to constrain to vertical)

Make sure dupe strip is selected and find its Trim start value, change it up to 2.00 from 1.00
Now it should be all dark frames

Select both strips and add a Gamma Cross effect, turn off the preset transition, set value to 0.5.
Change the mix value to the best balance for light or dark.

Select the Gamma strip and add a speed effect, set its speed value to 2.00

Select all these and then press ctrl G key to make a meta strip (all bundled into one strip).

Seems involved but is actually pretty easy and not as hard to do as the old technique.

Tutorial to follow,
Title: Re: Simple HDR video using Blender's VSE
Post by: sutobe on July 02, 2012, 05:01:47 PM
Hey!

Thanks for the reply, I'm not blaming you for anything  ;) I'm just confused about the software, and I really thought "to snip" is just another word for "to cut". haha thanks for the heads up

I will try this workflow later, maybe post a video....we'll see. I'm more into learning photography but I also want to know how to use most of the ML functions in case I need them.

Lets hope this forum gets filled up with tons of more tutorials and hints :-)
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on July 03, 2012, 01:13:52 AM
Thats ok, do bear in mind that this is a quick workaround. The effect works fine but is only a straight mix between both images, not a true value based cross over between low exposure and bright exposure. Sadly there is no keyer in the VSE to achieve this. And while the Blender compositor can peform that key function it cannot do the time separation of the light/dark streams.
Title: Re: Simple HDR video using Blender's VSE
Post by: sutobe on July 08, 2012, 02:14:01 PM
Ok now this isn't working for me as well.

Both strips have dark frames.....processed video consists of the dark sections only.

-When I change strobe value from the duplicated strip back to 1 it switches dark / bright again. If I leave it on 2 (like I did with the first strip) it stays dark.

-"Trim start value" is actually the "Start Frame", right?

-whats "preset transition"?   Opacity maybe?

-Mix value?


I'd be happy if you could name the functions like they are named in the programm because I'm getting nowhere.

with the first tutorials the pictures aren't synchronized (one layer moving way faster than the other), with the third tutorial its only dark frames.

did exactly as described, something doesn't seem to be right


thanks
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on July 09, 2012, 09:25:00 AM
I hope this update works for you, sorry if the language I used didn't fit. I really tried to be clear. Good luck.

Title: Re: Simple HDR video using Blender's VSE
Post by: bart on July 09, 2012, 11:47:30 AM
Thanks for the video.
I have some questions:

- If your stream is 50fps, why double the speed if you want to end with 25fps?
- Why do you trim the first frame if you don't do interpolation?
- It looks like the clipped tenttop becomes darker in the end results but I don't see any structure detail appearing.
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on July 09, 2012, 02:18:55 PM
Previously I separated the alternating frames by doubling the frame rate, then I duplicated the strip at the start making them all dark. Then I bumped the initial frame by 1 frame, making the duplicated strip start on a light frame. But it requires lots of manual manipulation of the strips, so it is liable to fail.

This time because I am duplicating each frame, via the strobe property, I can leave the speed up until the end.

Remember that the '50fps HDR 720HD resolution' effectively captures 2 exposures of 25fps footage, then we must merge the 2 exposures into a single frame. Thereby halving the frame rate.

The trim function simply adjusts the start frame so that you get the other frame type, I recommend using the 'trim value' to eliminate handling or clicking error.

I just reverse the process to separate out the alternating exposures, so I speed them up at the back end.

Lastly, about the detail in the tent, while you may not see the colour in the video image window the proof is in the waveform. I think that youtube removed to much light image detail. Remember that the original was flat lining in the bright areas, so I have achieved a much more gradeable result here. You can vary the balance between light and dark by altering the mix value.
Title: Re: Simple HDR video using Blender's VSE
Post by: sutobe on July 09, 2012, 07:34:23 PM
hey thanks for keep on trying to help me with this lol

I'll try this later and give feedback.
Title: Re: Simple HDR video using Blender's VSE
Post by: bart on July 09, 2012, 08:05:06 PM
Quote from: 3pointedit on July 09, 2012, 02:18:55 PM
Previously I separated the alternating frames by doubling the frame rate, then I duplicated the strip at the start making them all dark. Then I bumped the initial frame by 1 frame, making the duplicated strip start on a light frame. But it requires lots of manual manipulation of the strips, so it is liable to fail.

This time because I am duplicating each frame, via the strobe property, I can leave the speed up until the end.

Remember that the '50fps HDR 720HD resolution' effectively captures 2 exposures of 25fps footage, then we must merge the 2 exposures into a single frame. Thereby halving the frame rate.

The trim function simply adjusts the start frame so that you get the other frame type, I recommend using the 'trim value' to eliminate handling or clicking error.

I just reverse the process to separate out the alternating exposures, so I speed them up at the back end.

Lastly, about the detail in the tent, while you may not see the colour in the video image window the proof is in the waveform. I think that youtube removed to much light image detail. Remember that the original was flat lining in the bright areas, so I have achieved a much more gradeable result here. You can vary the balance between light and dark by altering the mix value.

Ahh understood. Thanks for the extra info. When I have time I'll start with following your movie step by step.
Title: Re: Simple HDR video using Blender's VSE
Post by: jordancolburn on September 03, 2012, 07:33:36 PM
Thanks for the tutorial.  The steps were very easy to follow even though I've only had a bit of experience with blender.

Quote from: 3pointedit on July 03, 2012, 01:13:52 AM
Thats ok, do bear in mind that this is a quick workaround. The effect works fine but is only a straight mix between both images, not a true value based cross over between low exposure and bright exposure. Sadly there is no keyer in the VSE to achieve this. And while the Blender compositor can peform that key function it cannot do the time separation of the light/dark streams.

So It's not true tone mapping?  You basically just have an adjustable exposure video at the end, or is there some dynamic range gained?
Title: Re: Simple HDR video using Blender's VSE
Post by: 3pointedit on September 04, 2012, 10:17:18 AM
In the VSE I am not creating a HDR image that can be manipulated for output. It is purely a mix of 2 exposure extremes into the same color space.

The other tutorial I have created (check my youtube channel) uses the Blender Compositor, it allows more creative blending of the 2 components, but I have not figured out how to promote their exposures into a larger color gamut.
Title: Re: Simple HDR video using Blender's VSE
Post by: jordancolburn on September 04, 2012, 06:45:16 PM
Gotcha, I'll check out your tutorial on youtube too.