Is it possible to write an AviSynth script that replaces just one shot in a movie by loading an image and panning across it?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 14 of 14
Thread
-
-
It should be, I don't see why not. You could probably do it by creating the animated image at the proper length, then overlay that on the video at a specified time.
Got my retirement plans all set. Looks like I only have to work another 5 years after I die........ -
Are there any tutorials you can direct me to that describe how to create the animated image at the proper length?
-
I use Avisynth now and then, but never for editing. This is something that I can do in 30 seconds in a video editor. I'm sure if I put an effort into it, I could do it in Avisynth, but I'm not interested and it would be too boring anyway.
Jagabo is someone I consider to be an Avisynth guru, maybe he'll respond with a script.Got my retirement plans all set. Looks like I only have to work another 5 years after I die........ -
Works for me - i'm not the author and i don't remember who is the author but anyway he deserve for credits
Panoramaxxx picture was quite large (over 10000x1080)
Code:imagesource("Panorama_Large_0.jpg") pwidth = 1280 # set to desired pheight = 720 # output resolution pwidthF=float(pwidth) pheightF=float(pheight) bicubicresize(width()*pheight/height(),pheight) trim(1,1).loop(10000*3).AssumeFPS(50.0) animate( 0,10000*3, "bicubicresize", pwidth,pheight, .33,.33, 0.0, 0.0, pwidth,pheight, \ pwidth,pheight, .33,.33, width()-pwidthF,0.0, pwidth,pheight) return(last)
-
Something like:
Code:# A function to crop a section from a larger image with subpixel accuracy function CropSection(clip vid, float xpos, float ypos, int width, int height) { BicubicResize(vid, width, height, src_left=xpos, src_top=ypos, src_width=width, src_height=height) } # get a source video source = ffVideoSource("video.mp4") # build a 100 frame panning sequence from a still image, with properties that match the source video still = ImageSource("image.jpg", start=0, end=99, fps=source.framerate) # over frames 0 to 99 pan from 100,100 to 250,150 still = Animate(0,99, "CropSection", still,100.0, 100.0,source.width,source.height,\ still,250.0, 150.0,source.width,source.height) still = still.ConvertToYV12() # match source color format # replace frames 100 to 199 of the source video with the panning sequence source.Trim(0,99) + still + source.Trim(200,0)
-
Thank you very much! I was able to plug my data in and have it work perfectly.
Now I'm trying to make the image an overlay, so that there is a hole in part of it that shows the animation of the original video underneath. But I'm getting an error:
Avisynth open failure:
ShowAlpha: RGB32 data only
(line 15)
Is it possible to have both animation and overlay when the video source is from a DVD? I assume my color space is YV12 since it's from a DVD.
Here is my current script (eventually I'll be using two video sources):
Code:LoadPlugin("C:\DVD\DGDecode.dll") clip1 = MPEG2Source("C:\DVD\04\VTS_01_1.d2v") clip2 = MPEG2Source("C:\DVD\24DC\VTS_01_1.d2v") still = ImageSource("C:\Images\04.png", pixel_type="RGB32", start=0, end=258, fps=clip1.framerate) function CropSection(clip vid, float xpos, float ypos, int width, int height) { BicubicResize(vid, width, height, src_left=xpos, src_top=ypos, src_width=width, src_height=height) } still = Animate(0,258, "CropSection", still,0.0, 0.0,clip1.width,clip1.height,\ still,0.0, 834.0,clip1.width,clip1.height) still = still.ConvertToYV12() clip1.Trim(0,11666) + still.Overlay(still, mask=still.ShowAlpha()) + clip1.Trim(11926,0)
-
Make your mask before converting to YV12:
Code:LoadPlugin("C:\DVD\DGDecode.dll") clip1 = MPEG2Source("C:\DVD\04\VTS_01_1.d2v") clip2 = MPEG2Source("C:\DVD\24DC\VTS_01_1.d2v") still = ImageSource("C:\Images\04.png", pixel_type="RGB32", start=0, end=258, fps=clip1.framerate) function CropSection(clip vid, float xpos, float ypos, int width, int height) { BicubicResize(vid, width, height, src_left=xpos, src_top=ypos, src_width=width, src_height=height) } still = Animate(0,258, "CropSection", still,0.0, 0.0,clip1.width,clip1.height,\ still,0.0, 834.0,clip1.width,clip1.height) alpha_mask = still.ShowAlpha() still = still.ConvertToYV12() clip1.Trim(0,11666) + still.Overlay(still, mask=alpha_mask) + clip1.Trim(11926,0)
-
Thank you, the error is gone, but it looks like the mask isn't working. The hole in the PNG is showing up as white instead of empty.
-
Oh, you need to specify that you want to overlay onto the original video.
Code:clip1.Trim(0,11666) + clip1.Trim(11667, 11925).Overlay(still, mask=alpha_mask) + clip1.Trim(11926,0)
-
This is a little off topic, but I have other shots I'm doing that have no motion, animation, panning, zooming, etc. (they're completely still).
In those instances, is converting to source framerate and color space necessary?
If so for framerate, does the answer change if I'm using Srestore to specify framerate at the end of the script?
My source video is from DVD. -
If you are appending segments in an avs script, yes they need the same framerate and colorspace
If the other shots are completely static, you can assume any framerate for those sections with AssumeFPS()
You can add the edits after srestore, and assume the same framerate in those other sections before joining them -
Actually, if those static shots have audio and are timed to a composition, you'd want to use changefps() instead of assumefps() . AssumeFPS() will slow down/ speed up but keep the same frame count. That will change the timing and cause you to go out of sync if timing was important. ChangeFPS() will drop or duplicate frames (which doesn't really matter for a still shot) and keep the same duration
Similar Threads
-
Combining photos in a symbol with motion
By atri_gul in forum EditingReplies: 31Last Post: 2nd Jun 2015, 18:03 -
How to retain chapter markers when combining video onto DVD?
By Calrissian34 in forum DVD RippingReplies: 4Last Post: 31st Jan 2014, 06:03 -
combining a video feed with PC screen into single stream
By Masquerade in forum Newbie / General discussionsReplies: 5Last Post: 13th Apr 2013, 13:39 -
Virtualdub: Combining audio and video files in workflow.
By Cronjob in forum Video ConversionReplies: 2Last Post: 16th Sep 2012, 11:00 -
Combining synched sound with video - total absolute newbie
By Povster in forum Newbie / General discussionsReplies: 2Last Post: 24th Mar 2011, 16:37