Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th December 2011, 16:13   #21  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
You can do the same kinda things with CHDK, and even stock firmwares in newer models now.
jmac698 is offline   Reply With Quote
Old 30th December 2011, 18:48   #22  |  Link
Yellow_
Registered User
 
Join Date: Sep 2009
Posts: 378
Quote:
Originally Posted by jmac698 View Post
You can do the same kinda things with CHDK, and even stock firmwares in newer models now.
hey jmac, with video? I think not. :-) Unless it's RED HDRx ;-)

Yes, bracketed exposures and HDR shooting in camera for stills is common, not video. :-)
Yellow_ is offline   Reply With Quote
Old 30th December 2011, 19:36   #23  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,810
Quote:
Originally Posted by tin3tin View Post
A testing script for hdr video shot with the new Magic Lantern EOS hack, with both overlay/blend and Fuse:

Code:
fuse(a,b,mymask.invert())
Hi tin3tin - it's nice to see Fusion is finally finding some use, and those example images you posted are a good example of what it can do. Just a note for anyone else reading, the algorithm behind fuse doesn't require a greyscale mask - a hard black/white mask usually produces good results as well.

I think I may dig out the old code and rewrite it. I've recently written a still image blender and learned a lot in the process, so a new version will probably be a lot quicker.

David
wonkey_monkey is offline   Reply With Quote
Old 30th December 2011, 19:43   #24  |  Link
Yellow_
Registered User
 
Join Date: Sep 2009
Posts: 378
With regard to color space is fusion a function that is best done in RGB? Is there possibility of native YCbCr function for video?

Would it work within Dither Tools stacked 16bit functions?

http://forum.doom9.org/showthread.ph...59#post1386559
Yellow_ is offline   Reply With Quote
Old 30th December 2011, 19:54   #25  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
@ Gavino You're right as always . Anyway making the mask as a mix of the two frames will not work with things in motion. The actual mask gotta be created out of a frame which is exactly similar to the frame it is overlayed motionwise. So either the overexposed or the underexposed frame must be turned into an inbetween(with interframe) before it is overlayed/fusioned with a mask based on it.

@DavidHorman It is a great plugin you have scripted. I wonder how it deals with the blacks and whites - does it strech the spectrum after overlaying the two images? The blacks seems a bit crushed?
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 30th December 2011, 20:57   #26  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,395
and there is no Magic Lantern for 7D?
__________________
certain other member
smok3 is offline   Reply With Quote
Old 30th December 2011, 21:44   #27  |  Link
Yellow_
Registered User
 
Join Date: Sep 2009
Posts: 378
Quote:
Originally Posted by tin3tin View Post
@ Gavino You're right as always . Anyway making the mask as a mix of the two frames will not work with things in motion. The actual mask gotta be created out of a frame which is exactly similar to the frame it is overlayed motionwise. So either the overexposed or the underexposed frame must be turned into an inbetween(with interframe) before it is overlayed/fusioned with a mask based on it.
I think that depends on the shot, the assumption is that these 'HDR' videos are made of two 12.5fps streams that need the motion interpolating, in reality all the motion is there at 25P or whatever, it's the exposure that jumps and, as an example the seascape video has so little movement, that to produce interframe output seems unnecessary when something like 90% of the content is stationary and no hand held motion to complicate from a locked off tripod shot.

Something like masktools2 mt_motion could possibly be used to isolate and 'remove' from processing the motion, blend the 90% static that's left and reverse the mask to add back the motion and adjust to blend in.

In theory. :-) I've been trying mt_motion out with some success but am a total novice with the functions. :-)

Last edited by Yellow_; 30th December 2011 at 21:48.
Yellow_ is offline   Reply With Quote
Old 30th December 2011, 23:11   #28  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,810
Quote:
Originally Posted by Yellow_ View Post
With regard to color space is fusion a function that is best done in RGB? Is there possibility of native YCbCr function for video?

Would it work within Dither Tools stacked 16bit functions?
I don't know anything about Dither Tools - does it create some kind of fake RGB64?

Quote:
Originally Posted by tin3tin
@DavidHorman It is a great plugin you have scripted. I wonder how it deals with the blacks and whites - does it strech the spectrum after overlaying the two images? The blacks seems a bit crushed?
It doesn't do anything to the spectrum - I think that's just the way it works. I might include some parameters for adjusting levels before output, because it might be possible that some parts get clipped and some detail is lost.

David
wonkey_monkey is offline   Reply With Quote
Old 31st December 2011, 06:20   #29  |  Link
Yellow_
Registered User
 
Join Date: Sep 2009
Posts: 378
hi David, yes Dither Tools uses a denoiser to try and recover high bit depth data from 8bit sources and then stacks that back in LSB/MSB.

http://forum.doom9.org/showthread.ph...59#post1386559

Then using a tool like Avs2yuv or pipemod to handle the avs script it can pipe the data to 10bit x264 encoder or as rgb48 to Imagemagick amongst other tools, IM can write hdri formats like ppm, tiff, exr, hdr as well as a lot of 8bit LDR formats.

Or there are various dither functions including encoder friendly ones to dither back to 8bit if preferred.

But I think what I'm driving at is if there is possibility to add a function using the fusion type principle that rebuilds the details levels / gradients from the data in the two 8bit exposures (rather than denoising as dither tools) into a wider dynamic range 16bit file rather than just fusing two exposures into 8bit which with two exposures only feels more akin to dodging and burning rather than HDR.

The floating point imagemagick output could then be tonemapped as part of the 'Post' grading process. Although I guess the whole point of fusion is to avoid this. :-) But on the other hand it is also making assumptions / weighting on what image data to keep and throw away?

Not sure if you've seen this, maybe useful generally: http://www.tawbaware.com/tufuse.htm

One last element of this is the practicality of editing flickering video straight off the camera, so as fusion does now merging the exposures into a file for editing is useful too albeit including conversion to RGB and back to YCbCr.

Last edited by Yellow_; 31st December 2011 at 06:55.
Yellow_ is offline   Reply With Quote
Old 31st December 2011, 10:28   #30  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,810
I've wondered about applying Fusion to the smoothing problem, but I'm not really sure how to go about it, if it's possible - as far as fuse is concerned, a step in a gradient is a detail like any other. I know about tufuse - I'm on the Tawbaware forums and I designed the PTA icon - Fusion works on the same principles and I took some hints from tufuse when I wrote it.

Quote:
But on the other hand it is also making assumptions / weighting on what image data to keep and throw away?
The decision is made solely on the content of the mask, if that's what you mean... if you had two differently focused videos of the same scene, for example, and could construct the appropriate mask, it could do focus blending as well.

David
wonkey_monkey is offline   Reply With Quote
Old 31st December 2011, 20:09   #31  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,810
I've rewritten the filter:

http://horman.net/fusion2.zip

It should definitely be faster and might give better results.

As before, the syntax is:

Code:
fuse(a,b,m) # fuse two videos, a and b, using the mask m (green channel)
fusemask(a,b[,exp]) # create a mask to pass to fuse, for a target exposure of exp (0-1, defaults to 0.5)
David

Last edited by wonkey_monkey; 31st December 2011 at 20:36.
wonkey_monkey is offline   Reply With Quote
Old 1st January 2012, 08:01   #32  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
Your new release works well. Thank you!
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 1st January 2012, 17:11   #33  |  Link
PALpilot
Registered User
 
Join Date: Dec 2007
Posts: 17
Quote:
Originally Posted by tin3tin View Post
Your new release works well. Thank you!
Hi tin3tin,

Could you post your script that's working with the new version?
PALpilot is offline   Reply With Quote
Old 1st January 2012, 18:13   #34  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
Something like this, and then tinker with the exp value:
Code:
loadplugin("C:\Users\tin2tin\Desktop\Fotos 60D\fusion.dll")
loadplugin("C:\Program Files\DVD slideshow GUI\FFmpegSource\ffms2.dll")
import("C:\Program Files\DVD slideshow GUI\FFmpegSource\ffms2.avs")

v=ffmpegSource2("C:\Users\tin2tin\Desktop\Fotos 60D\MVI_3769.MOV").converttorgb32()
a=selecteven(v)
b=selectodd(v)

fuse(a,b,fusemask(a,b,exp=0.5))
I've noticed that my 60D sometimes starts with the underexposed image and sometimes with the overexposed image, so you'll have to swap the a and b values.
__________________
DVD slideshow GUI(Freeware).

Last edited by tin3tin; 1st January 2012 at 18:49.
tin3tin is offline   Reply With Quote
Old 1st January 2012, 19:00   #35  |  Link
PALpilot
Registered User
 
Join Date: Dec 2007
Posts: 17
Thank you.

But I get an error on fusion.dll (v2)

=========
Avisynth open failure:
LoadPlugin: unable to load "c:\Program Files (x86)\avisynth 2.5\plugins\fusion.dll", error=0x7e

and without loadplugin it doesn't recognise the fusemask command. Maybe it has to do with windows 7 x64? The old version works with the same script. It's in the DLL.
PALpilot is offline   Reply With Quote
Old 1st January 2012, 21:49   #36  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,810
Quote:
Originally Posted by tin3tin View Post
I've noticed that my 60D sometimes starts with the underexposed image and sometimes with the overexposed image, so you'll have to swap the a and b values.
Actually you won't have to - you're swapping the parameters for fusemask as well, so they cancel each other out.

Quote:
Originally Posted by PALpilot
Avisynth open failure:
LoadPlugin: unable to load "c:\Program Files (x86)\avisynth 2.5\plugins\fusion.dll", error=0x7e
Just a guess off the top of my head, but do you have a non-SSE2 CPU?

David

Last edited by wonkey_monkey; 1st January 2012 at 21:54.
wonkey_monkey is offline   Reply With Quote
Old 2nd January 2012, 09:14   #37  |  Link
PALpilot
Registered User
 
Join Date: Dec 2007
Posts: 17
Quote:
Originally Posted by davidhorman View Post
Just a guess off the top of my head, but do you have a non-SSE2 CPU?
David
I have Intel Core2Quad 8200
http://ark.intel.com/products/36547/...333-MHz-FSB%29
PALpilot is offline   Reply With Quote
Old 2nd January 2012, 15:55   #38  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
The 0x7e error indicates that one or more dependent dlls are missing from the system.

make sure you have the Visual Studio 2010 runtime installed, as the plugin requires it.
__________________
custom x264 builds & patches | F@H | My Specs

Last edited by kemuri-_9; 2nd January 2012 at 16:07.
kemuri-_9 is offline   Reply With Quote
Old 3rd January 2012, 08:47   #39  |  Link
PALpilot
Registered User
 
Join Date: Dec 2007
Posts: 17
Quote:
Originally Posted by kemuri-_9 View Post
The 0x7e error indicates that one or more dependent dlls are missing from the system.

make sure you have the Visual Studio 2010 runtime installed, as the plugin requires it.
Nice one. That helped. First I switched to the x64 version but that didn't work. The x86 version is the one you need on x64 windows7 systems.


And I uploaded another test scene for people to try out.
MVI_7951.MOV 92.2 MB
http://www.megaupload.com/?d=5B5CUV3S

Last edited by PALpilot; 3rd January 2012 at 09:13. Reason: added fileurl
PALpilot is offline   Reply With Quote
Old 26th January 2012, 21:01   #40  |  Link
TheoRI
Registered User
 
Join Date: Jan 2012
Posts: 8
HDR, Fusion and Super 8 film

Dear videoFred and other member,

I am using a modified projector with a 5MP industrial CMOS camera to capture our super 8 film. As part of the development process it is evident that the camera does not have the range to capture all the detail available on the film. So I am contemplating running 2 capturing instances at different exposure - light intensities and then "combining the frames" using the fusion script:
http://forum.doom9.org/showthread.php?t=152109

I capture a Bright and a Dark sequence and then would like to join them together.
The avisynth scrip I use below.

The problem I have is that due to small position difference each frame is not aligned in the x-y as they are captured at different times. This results in some "ghosting" around objects. Is it possible to align the frames using an avisynth script before "fusing" them? IF so how? Please update the script below.

The output of this script will then be fed into the script that videoFred developed for super 8 restoration (Thanks a million!)
http://forum.doom9.org/showthread.php?t=144271

Kind Regards
Theo

# HDR script using Fusion plugin
# http://forum.doom9.org/showthread.php?t=152109
#
#=============================================================================================


Dark="e:\telecine\Dark input.avi" # source clip, please specify the full path here
Bright="e:\telecine\Bright input.avi" # source clip, please specify the full path here

exposure = 0.5

#----------------------------------------------
loadplugin("fusion.dll")
SetMemoryMax(1024)

a= avisource(dark).converttorgb32().trim(0,0)
b= avisource(bright).converttorgb32().trim(0,0)

# horizontal stack of Dark, Fuse, Light
# Stackhorizontal(a.subtitle("Dark"),fuse(a,b,fusemask(a,b,exp=exposure)).subtitle("Fuse"),b.subtitle("Bright"))

fuse(a,b,fusemask(a,b,exp=exposure))
Attached Files
File Type: zip Dark_Fuse_Bright_sample.zip (125.1 KB, 41 views)
TheoRI is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.