I want to use the following script to browse pictures, pausing for 15 seconds on each picture, but it only reads the first two pictures.
.
.
.
video = core.bs.VideoSource(source=r'E:\001\%02d.jpg')
video = core.std.AssumeFPS(video,fpsnum=1, fpsden=15)
video = haf.ChangeFPS(video, 24000, 1001)
audio = core.bas.Source(r'E:\audio\xxx.mp3', track=-1)
audio.set_output(1)
video.set_output(0)
This is the script from avisynth, and it works great.
.
.
.
v = ImageSource("I:\001\%02d.jpg", start=0, end=17, use_DevIL=true)
v = AssumeFPS(v, 1,16)
video = ChangeFPS(v, 25,1)
audio=DirectShowSource("E:\audio\xxx.mp3")
AudioDub(video,audio)
Can anyone help me with this problem?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
I'd use imwri plugin and python code to create a list of filepaths, it is more versatile and comforting than %xxxd syntax for reading images:
Code:from vapoursynth import core from pathlib import Path from havsfunc import ChangeFPS DIRECTORY = r'D:\images' IMAGE_DURATION = 15 # seconds if not hasattr(core, 'imwri'): raise AttributeError('vs-imwri plugin is needed to load images: https://github.com/vapoursynth/vs-imwri/releases') images = Path(DIRECTORY).glob('IMG_*.JPG') # loading images into a list using wild cards in image name video = core.imwri.Read(filename=list(images)) video = core.std.AssumeFPS(video, fpsnum=1, fpsden=int(IMAGE_DURATION)) video = ChangeFPS(video, 24000, 1001) audio = core.bas.Source(r'E:\audio\xxx.mp3', track=-1) audio.set_output(1) video.set_output(0)
-
so basically you do not have to use audio in vapoursynth, just muxing your audio track to that encoded vapoursynth video stream
-
Thanks for @_Al_ for help, But it returned the error: ImportError: cannot import name 'Sequence' from 'collections'.
-
Does it only read first 2 pictures with video only ?
Are you using most recent bestsource plugin ?
https://github.com/vapoursynth/bestsource/releases/ -
Thanks @poisondeathray for your attention to this issue. It does read only two images, 00.jpg and 01.jpg, and the image sizes are the same. It seems that it cannot automatically detect how many images are in the folder. Do you have any good solution?
-
A word to the wise ... if the pics have different sizes (eg HD or 4k) or different rotations in the metadata (eg portrait, landscape, 90 degrees, 180 degrees, etc) then you're in for a bit of a learning curve
Good luck.
PS _AI_ is brilliant at this stuff and IIRC has access to relevant code (or has my memory failed yet again).
Similar Threads
-
VapourSynth "dedup" idea, potential script speed enhancement?
By Frankysan in forum Video ConversionReplies: 3Last Post: 7th Jan 2024, 18:36 -
Installing vapoursynth
By rrats in forum Newbie / General discussionsReplies: 3Last Post: 30th Sep 2021, 16:35 -
Looking for Batch MP4 Normalization Script of existing script
By VideoFanatic in forum Video ConversionReplies: 6Last Post: 31st Jul 2021, 19:50 -
Vapoursynth - Help installing f3kdb plugin and Hysteria script on Windows
By T0talN00b in forum Newbie / General discussionsReplies: 1Last Post: 26th Jun 2021, 04:03 -
ffmpeg slideshow: why do pictures keep looping a good 2 minutes after audio
By renedevilil in forum Newbie / General discussionsReplies: 0Last Post: 2nd Dec 2019, 16:05