Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > Newbie Questions > Picture In First Plan And Movie In Second


Posted by: lagirafe23 Jun 1 2014, 02:11 AM
Hello every body,

My name is John-nathan i live in La Rochelle in France.

I speak just little bit english very sorry.

Virtual dub is beautiful and very very good log ! ! !

I would like to put a picture in the foreground and a video in the background.
My video will bunk Photo.

Exemple :

http://s2.dmcdn.net/wXF5/193x108-LWe.jpg

Like this photo explosion covers the wall, the wall being "my image" (the foreground) and the explosion "my video" (the background).
As if the explosion was lively and gradually cover the wall and watch the wall when the explosion disappear

The video straddles the small picture somehow.
So that the video will hide the picture depending on how she will ride.
I do not know if I'm clear enough.

Is this possible?

I really am a newbi an explanation for this picture would be great.

Thank you very much;)

Posted by: raffriff42 Jun 1 2014, 03:56 AM
Still picture over video: very easy, use the Logo filter.

Video over still picture: harder. Use the Layer filter, or Avisynth.

(all 3 methods are explained in http://forums.virtualdub.org/index.php?act=ST&f=2&t=21916)

Posted by: lagirafe23 Jun 1 2014, 07:11 PM
Thank you for answering me.

The problem with the filter logo is that it lasts the whole video.

Actually I want to do this "Video over still picture. Harder Use the Layer filter, or Avisynth."

In the download it gives me a zip with this:
http://hpics.li/3b45f59

I put it in the VirtualDun / plugins folder?

Hide a piece of the image when the video overlaps a part of the image becomes clear that the complicated to make air ...

Posted by: raffriff42 Jun 1 2014, 10:25 PM
I'm looking at the the web page from your screen shot in translation: http://translate.google.com/translate?langpair=auto|en&u=http%3A%2F%2Fletransfertpellicule.free.fr%2Findex.php%2Ftutoriels%2Fvirtualdub-pour-les-nuls.html%3Fstart%3D4.
It's a very good introduction to VirtualDub and Avisynth!

It's slightly out of date, however. Here are some updated links:
  • Get http://sourceforge.net/projects/virtualdub/files/virtualdub-win/1.10.4.35491/VirtualDub-1.10.4.zip/download (for compatibility with most plugins, 32-bit is better)
  • Get http://sourceforge.net/projects/avisynth2/files/AviSynth_Alpha_Releases/AVS%202.6.0%20Alpha%205%20%5B130918%5D/.
  • In place of any other input plugins, I use the http://forums.virtualdub.org/index.php?act=ST&f=2&t=22269&st=0#entry95795.
  • AvsP is no longer maintained; get http://forum.doom9.org/showthread.php?t=153248 instead.
QUOTE
In the download it gives me a zip with this ... I put it in the VirtualDub / plugins folder?
Basically, yes - except you put the files in the Plugins32 folder in newer versions of VirtualDub. Also, you only need two files from the http://neuron2.net/hosted.html's ZIP archive: "vdf_layer.vdf" and "vdf_layer.txt." The others you can delete (although keeping them does no harm)

I am not competent to advise you on the VirtualDub Layer filter, but I can write a simple AviSynth script that does the same thing:
CODE
## put a video (reduced size) over a background image.
## The color (R=64, G=64, B=64) is transparent.
## *** assumes you are running Avisynth 2.6.0 ***

## foreground video (replace "example.avi" with full path to file)
F = DirectShowSource("example.avi")

## background image (replace "example.jpg" with full path to file)
B = ImageSource("example.jpg", fps=F.FrameRate, end=F.FrameCount)

## ensure they are in a compatible format
F = F.ConvertToRGB32
B = B.ConvertToRGB32

## resize background image to desired video size
B = B.BicubicResize(1280, 720)

## resize foreground to desired size
F = F.BicubicResize(Round(0.5*F.Width), Round(0.5*F.Height))

## create color key mask (optional)
## the color (R=64, G=64, B=64) (plus/minus 2) is transparent.
F = F.ResetMask().ColorKeyMask(to_rgb(64, 64, 64), 4)

## overlay the video @ 32 pixels from left, 16 pixels from top
L = Layer(B, F, x=32, y=16, level=257)

## Fade IN the top layer:
R = UUDissolve(B, L, 120, 30)

## Fade OUT the top layer:
R = UUDissolve(R, B, 220, 30)

return R.ConvertToYV12

#######################################
## return an Avisynth color number
##
function to_rgb(float r, float "g", float "b") {
   r = Min(Max(0, Round(r)), 255)
   g = Min(Max(0, Round(Default(g, r))), 255)
   b = Min(Max(0, Round(Default(b, r))), 255)
   return (r*65536) + (g*256) + b
}

#######################################
### dissolve to alternate clip
# http://atlas.kennesaw.edu/~dhirschl/avisynth.html
#
#@ A - main movie
#@ B - angle2 (synchronized with clip A)
#@ lenDissolve - number of frames for dissolve;
#               make sure lenDissolve is not too high
#
function UUDissolve(clip A, clip B, int "markIn", int "lenDissolve")
{
   markIn = Default(markIn, 0)
   lenDissolve = Default(lenDissolve, 0)

   return Dissolve(A.Trim(0, markIn + lenDissolve),
   \               B.Trim(markIn, 0), lenDissolve)
}
See http://avisynth.nl/index.php/Layer for more information about layering.

EDIT - fade the top layer in and out

Posted by: dloneranger Jun 2 2014, 02:09 PM
Just to add a bit about this
QUOTE
The problem with the filter logo is that it lasts the whole video.


Any filter can be 'blended' to alter the effect from 100% to 0% (transparent)
So, you could make a logo be 0% after 1 minute etc
Here's a how-to https://www.youtube.com/watch?v=hVLsDW5nQso


Posted by: malky Jun 2 2014, 04:21 PM
Version 1.7 you can have animated logos and specify position and when to display.

http://neuron2.net/logo/logo.html

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)