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. |
14th August 2017, 22:55 | #2621 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
|
|
14th August 2017, 23:28 | #2622 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Are you sure about that? I suspect the problem might be that calling deleteframes there doesn't do what you think it does. It won't change the length of the clip returned by frameeval, I'm pretty darn sure. What I'd expect it to do is to replace even numbered frames with the following frame.
Last edited by TheFluff; 14th August 2017 at 23:31. |
14th August 2017, 23:55 | #2623 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
So I can't delete frames with arbitrary functions using FrameEval? |
|
15th August 2017, 01:55 | #2624 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
Probably what you wanted to do. Halve the framecount and you're done. Code:
def DeleteEven(n, clip): return clip[n // 2]
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
15th August 2017, 11:48 | #2625 | Link | |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
The thing Myrsloik did relies on the fact that requesting a frame beyond the end of a clip just returns the last frame, so you get back a clip with the same length as the original, but every frame after the halfway point is just the same as the last. |
|
16th August 2017, 18:54 | #2626 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Is there something like ffmpegs shuffleframes in Vapoursynth? (A filter which allows so swap and drop frames by a given pattern?)
|
16th August 2017, 18:56 | #2627 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
16th August 2017, 19:03 | #2629 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
If your pattern can be expressed with it. Yes. But it gets kinda iffy for 1000+ frame cycles and can't do stuff like drop all prime number frames.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
16th August 2017, 19:06 | #2631 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Correct, no shuffle.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
16th August 2017, 19:20 | #2634 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
I think that works. Try it and see. I probably made selectevery take the order into account.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
18th August 2017, 07:22 | #2635 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
@Myrsloik
can you write something to convert a vaporsynth video clip to a numpy array and a reverse conversion like-wise? so, like forward conversion: video clip -> numpy.array((framecount, height, width, channel)) reverse conversion: numpy.array((framecount, height, width, channel)) -> video clip the conversion should only support GRAYS/RGBS/YUV444PS inputs obviously the thing is... I wanna pre-process my image samples with vaporsynth before feeding them to keras I could use vspipe to generate raw files and load them with numpy.memmap for now, but it sucks Last edited by feisty2; 18th August 2017 at 07:24. |
18th August 2017, 11:15 | #2636 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
All frames are exposed as a memoryview. Just use get_frame(). I don't know the exact python way but I'm very certain you can create numpy arrays from memoryviews. Or maybe it already is one.
For the reverse you can probably use modifyframe (see the insane filter writing in python thread). No idea what the speed will be like, probably not that bad as long as you find the appropriate. Or do it all in a single modifyframe callback. I have no idea what kind of preprocessing you want to do.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
18th August 2017, 13:57 | #2637 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
say I wanna do a super resolution neural net with keras, first I would need to generate the corresponding low resolution version of the high resolution samples, and for that I need resampling filters.
there's scipy.misc.imresize but it's pretty rudimentary comparing to fmtc, it has very few resampling kernels, doesn't even have spline! and you can't tweak stuff like "taps" or whatever for each kernel, with fmtc I got control over everything, I can even create my own resampling kernel or resize under linear light so I want vaporsynth (filters) to do stuff like that concretely, something like Code:
def GenLowResSamples(samples): core = vs.get_core() samples = ArrayToVideo(samples) #reverse conversion samples = core.fmtc.resample(samples, sample.width//2, sample.height//2, kernel="sinc", taps=128, fulls=True, fulld=True) samples = core.fmtc.resample(samples, sample.width*2, sample.height*2, kernel="sinc", taps=128, fulls=True, fulld=True) samples = VideoToArray(samples) #forward conversion return samples |
20th August 2017, 01:42 | #2638 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Hi I'm trying to frame serve a video from Adobe Premiere to Vapoursynth using this frame server called advanced frame server, when I try to grab it with avisource, the editor crashed and I got this error "setVideoInfo: The frame rate specified by AVISource must be a reduced fraction. (Instead, it is 23976/1000.)", and there's no option in avisource to change it.
|
23rd August 2017, 02:24 | #2640 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
Tried to implement r210 DIB. Have issue with VapourSynth-R38
r = core.avisource.AVISource('rgb.avi') r = core.resize.Point(r, format=vs.RGB30) r.set_output() Source is 784x400 but appears to have 832*4 pitch from vs (I derived it from total size and it works). Is this error on output or there is some rule for it?
__________________
VirtualDub2 |
Tags |
speed, vaporware, vapoursynth |
|
|