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. |
1st May 2021, 03:42 | #1 | Link |
Registered User
Join Date: Nov 2003
Posts: 365
|
Import ImageWriter images back in but differently
I've successfully used ImageWriter to extract individual images from a video that is largely a simple slide show. Here's a sample of my script:
Code:
frame=426 ImageWriter("slides\myProject.",frame,frame,"jpg") frame=522 ImageWriter("slides\myProject.",frame,frame,"jpg") I can't figure out how to do this. ImageSource appears to use as it's sole video source, the standalone images. I already have a video with audio, but want to replace a range of the video frames only (not touching the audio) with a single "slide" from one of my .jpgs. Then do this all over again for a different slide and target frame range. (Sorry if this is not as succinct as it might have been.) Last edited by TCmullet; 1st May 2021 at 04:59. |
1st May 2021, 04:30 | #2 | Link |
Registered User
Join Date: Sep 2005
Posts: 130
|
A n00b way to do it
PHP Code:
|
4th May 2021, 03:51 | #3 | Link |
Registered User
Join Date: Nov 2003
Posts: 365
|
I guess there's no way to do it directly, even though snatching the slides was simple. So I've written a function to do it. It works (and was a good exercise, I guess).
Code:
function Insert1ImageRange(clip c, string fname, int fstart, int fend) { # Insert 1 image into a video clip replacing # the target range of frames holdaud=c before = c.trim(0, fstart-1).killaudio() after = c.trim(fend+1, 0).killaudio() inserted = \ imageSource(fname,start=fstart,end=fend,fps=framerate(c)).Spline36Resize(width(c),height(c)) vid = before ++ inserted.ConvertToYV12() ++ after return audiodub(vid, holdaud) } |
Thread Tools | Search this Thread |
Display Modes | |
|
|