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 Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th August 2011, 17:10   #1  |  Link
Jonaldinho
Registered User
 
Join Date: Aug 2008
Posts: 49
Adding a picture to a video

Hi, i'm trying to add a picture to the end of a video in avisynth. I want the image to display for 10 seconds. I want the video to fade out to black and the picture to fade in from black. I have already managed to do this, I just don't know how to add the picture to the end of the video.

Here's my video script:

Code:
vid=DirectShowSource("C:\Capture\Example Video.GRF", audio=false).AssumeBFF()
aud=DirectShowSource("C:\Capture\Example Audio.GRF", video=false)
AudioDub(vid, aud)
ConvertToYV12(interlaced=true)
Load_Stdcall_Plugin("O:\MeGUI\tools\yadif\yadif.dll")
Yadif(order=0)
LanczosResize(852,480) # Lanczos (Sharp)
LoadPlugin("O:\MeGUI\tools\avisynth_plugin\FluxSmooth.dll")
FluxSmoothST(7,7) # Medium Noise

__film = last
__t0 = __film.trim(290, 5636)
__t0

Fadeout2 (25)
Here's my picture script:

Code:
ImageSource("C:\Capture\Example.jpg", end = 250, use_DevIL=false).AssumeFPS(25, true)
ConvertToYV12(interlaced=false)
Fadein2 (25)
Any help appreciated.

Last edited by Jonaldinho; 7th August 2011 at 20:49.
Jonaldinho is offline   Reply With Quote
Old 7th August 2011, 22:38   #2  |  Link
cobo
Registered User
 
Join Date: Mar 2004
Posts: 118
Assuming you want silence for the final image, I think this would work. Adjust the audio_rate of BlankClip to match that of your first clips audio.
Code:
vid=DirectShowSource("C:\Capture\Example Video.GRF", audio=false).AssumeBFF()
aud=DirectShowSource("C:\Capture\Example Audio.GRF", video=false)
AudioDub(vid, aud)
ConvertToYV12(interlaced=true)
Load_Stdcall_Plugin("O:\MeGUI\tools\yadif\yadif.dll")
Yadif(order=0)
LanczosResize(852,480) # Lanczos (Sharp)
LoadPlugin("O:\MeGUI\tools\avisynth_plugin\FluxSmooth.dll")
FluxSmoothST(7,7) # Medium Noise

__film = last
__t0 = __film.trim(290, 5636)
__t0

Fadeout2 (25)

a=last

vid2=ImageSource("C:\Capture\Example.jpg", end = 250, use_DevIL=false).AssumeFPS(25, true).ConvertToYV12(interlaced=false)
aud2=BlankClip(vid2, audio_rate=48000)
b=AudioDub(vid2, aud2).Fadein2 (25)

a+b

Last edited by cobo; 7th August 2011 at 22:44.
cobo is offline   Reply With Quote
Old 7th August 2011, 22:51   #3  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by cobo View Post
Adjust the audio_rate of BlankClip to match that of your first clips audio.
This can be ensured by using audio_rate=AudioRate(a).
You might also need to set channels=AudioChannels(a).
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 8th August 2011, 09:54   #4  |  Link
Jonaldinho
Registered User
 
Join Date: Aug 2008
Posts: 49
Thanks a lot Cobo and Gavino. Cobo's script worked after i'd adjusted it with Gavino's tip & set the channels to the same as video (a).
Jonaldinho is offline   Reply With Quote
Reply

Tags
avisynth, combine, imagesource, join, unalignedsplice


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:45.


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