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. |
20th January 2013, 01:00 | #701 | Link |
Pajas Mentales...
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
|
for example, in my encode scripts with avisynth in my linux, call avs2pipe before encode and extract number of frames and WxH from output and parse to x264. and with avs2yuv (asv2pipe and avs2pipemod don't silence his output) process the video
Code:
x264="/path/of/x264/ cmd="$(<x264_commands)" info="$(wine avs2pipe --info "$1")" frames="$(echo -n "$info" | sed -ne 's/^v:frames\(.*\)$/\1/p' | sed 's|[\r ]||g')" res+="$(echo -n "$info" | sed -ne 's/^v:width\(.*\)$/\1/p' | sed 's|[\r ]||g')" res+="x" res+="$(echo -n "$info" | sed -ne 's/^v:height\(.*\)$/\1/p' | sed 's|[\r ]||g')" wine avs2yuv "$1" -o - | "$x264" - --output "$2" --stdin y4m --frames "$frames" --input-res "$res" $cmd (x264_commands: is a file with x264 parmeters for encode) i supposed with vapoursynth its the same method, but swap "wine avs2yuv" to "python script.py" command in win make a .bat with same process and running xd greetings |
20th January 2013, 01:03 | #702 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
detect_framecount.py
This will print the number of frames : Code:
import vapoursynth as vs import sys core = vs.Core(threads = 6) c = core.avisource.AVISource(r'e:\P4_14.avi') print("Number of frames: ", c.num_frames) # or just print(c.num_frames) And you can also do thinks like this: Code:
import vapoursynth as vs import sys import os core = vs.Core(threads = 6) c = core.avisource.AVISource(r'e:\P4_14.avi') print("Number of frames: ", c.num_frames) # or just print(c.num_frames) os.system("calc") # or your x264 call... @sl1pkn07, I think the combination with wine will slow down your encode unnecessarily
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 20th January 2013 at 01:14. |
20th January 2013, 01:12 | #703 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
ChaosKing, the problem is that modifying the original script will not be possible/desirable.
What I need is a Python script that will load an existing VapourSynth script (which is provided by the user and which will be piped into x264 as-is) and from that script detect the total frame count. I know I can use imp.load_source() to load the VPY script, but I don't really know what to do with it...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 20th January 2013 at 02:26. |
20th January 2013, 01:19 | #704 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
It will kinda improve in the next version/not so distant future. The clip.output() stuff will go since it's just unnecessarily complicated and will be replaced with a standard program to pipe the output. So if you're not in a hurry it should solve itself in a bit. The main problem is that if someone uses clip.output() you have to rewrite the script to get the number of frames...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
20th January 2013, 01:28 | #705 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
Ideally that "standard program" would write the data to the STDOUT and, at the same time, print some basic info (including total frame count) onto the STDERR. And it would also have a switch to only print the info but not output anything. Well it's the thing that's currently blocking me for properly integrating VapourSynth into my x264 GUI. But it surly can wait a few more days. Yup, that's the problem. And re-writing is not easy to do, because I cannot expect the user's script to be in a specific form...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
|
22nd January 2013, 01:28 | #706 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,699
|
Myrsloik, do you have a coding style that you prefer we stick to when hacking around in the core? Similar to libav's coding rules (https://libav.org/developer.html#toc...ng-conventions)?
|
22nd January 2013, 01:37 | #707 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
You can probably see the pattern in all the existing code and try to copy it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
22nd January 2013, 01:49 | #708 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,699
|
Okay, I figured it would be something like that.
I asked because I was considering throwing together a basic indent command line to make sure I didn't miss violations from time to time. I've been following your style as far as I've paid attention to so far, so I just wanted to make sure that any possible merges would work just fine. |
29th January 2013, 04:49 | #709 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,699
|
Myrsloik, how exactly does the "struct VSAPI" definition in vapoursynth.pxd relate to the "const vsapi" initialization in vsapi.cpp?
I though at first that it was a direct 1:1 mapping between API functions, but now I'm not so sure. Does order not matter when adding a new function to both of these? For reference, I'm adding a new function, transferVideoFrame(), that can be used by video filters to transfer frame data between the host memory and GPU memory. Forgive me if this is a stupid question, I just have little familiarity with the Cython integration layer. Edit I see that the full API is declared in Vapoursynth.h, but I'm still wondering about the .pxd typedef. Last edited by Adub; 29th January 2013 at 04:57. |
29th January 2013, 10:38 | #710 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Cython is a bit special. The pxd is just says that a function/data structure with something kinda like this or that exists. For the actual compilation cython still includes vapoursynth.h and uses its definitions directly. If you look some more you'll also see that cython doesn't have the const keyword.
In theory its definitions should match vapoursynth.h but it doesn't really matter that much as long as it compiles.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
1st February 2013, 00:09 | #712 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Sorry for my impatience, but any news on that yet?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
1st February 2013, 02:58 | #713 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Not really, real life has intervened. This time I don't even dare to guess when stuff will be done...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
2nd February 2013, 15:56 | #714 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
I'm getting errors while opening a MOV with "Animation RLE" as a codec.
Using FFMS2 (both version, found here: http://forum.doom9.org/showpost.php?p=1607732&postcount=1739) the error is: Code:
Traceback (most recent call last): File "<pyshell#6>", line 1, in <module> vid=core.ffms2.Source(source='vid_23976fps.mov') File "vapoursynthpp.pyx", line 1048, in vapoursynth.Function.__call__ (src\cython\vapoursynthpp.c:15779) vapoursynth.Error: 'Source: No suitable output format found' Using the FFMS2 version compiled also for AviSynth (the second link) in AviSynth, doesn't throw any error and correctly open the file as RGB32. |
4th February 2013, 00:39 | #715 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,699
|
Hmmm, looking at VapourSynth.h, there doesn't appear to be a corresponding VSPresetFormat for RGB32.
Do you have a small sample of your problem clip? Edit: Ahh, I see that CompatBGR32 is what is used instead. Last edited by Adub; 4th February 2013 at 00:47. |
4th February 2013, 00:45 | #716 | 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 |
|
4th February 2013, 23:54 | #717 | Link | ||||
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Hi Myrsloik, here comes a long post.
I recently tested a handful of plugins to see which ones display the following warning. Quote:
Code:
import vapoursynth as vs core = vs.Core(threads=4) # Plugins core.avs.LoadPlugin(path=r'C:\DGDecodeNV.dll') core.avs.LoadPlugin(path=r'C:\WhateveAVSplugin.dll') # Source src = core.avs.DGSource(dgi=r'C:\blu-ray 1080p.dgi') # For plugins that only work in YUY2 #src = core.resize.Point(clip=src, format=vs.COMPATYUY2) # Processing src = core.avs.WhateverName(c1=src) # VDub ouput last = src Here's a list of plugins that need to be added to the prefetch list.
PHP Code:
Here's a list of the filters that currently do not work with VapourSynth. Quote:
PHP Code:
Quote:
PHP Code:
*** The following 3 plugins only work with YUY2, and they all silently crashed VDub. I had to quickly take a screen grab of VSMeter in order to get the error message before it crashed.
Quote:
PHP Code:
*** I couldn't get the following plugin it to work. I tried writing the parameters every way possible is VS but no luck. I'm guessing it's because of duplicate parameter names? PHP Code:
I still have a lot more plugins to test. I will then (hopefully) make a comprehensive list of all working AVISynth plugins. One thing I'm still wondering, what are some of the benefits of adding plugins to the prefetch list? Also, could you please explain a little about the different prefetch schemes? Code:
#define OTHER(fname) if (name == #fname) return PrefetchInfo(1, 1, 0, 0); #define SOURCE(fname) if (name == #fname) return PrefetchInfo(1, 1, 0, 0); #define PREFETCHR0(fname) if (name == #fname) return PrefetchInfo(1, 1, 0, 0); #define PREFETCHR1(fname) if (name == #fname) return PrefetchInfo(1, 1, -1, 1); #define PREFETCHR2(fname) if (name == #fname) return PrefetchInfo(1, 1, -2, 2); #define PREFETCHR3(fname) if (name == #fname) return PrefetchInfo(1, 1, -3, 3); #define PREFETCH(fname, div, mul, from, to) if (name == #fname) return PrefetchInfo(div, mul, from, to); |
||||
5th February 2013, 00:48 | #718 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
The OTHER and SOURCE macros don't really do anything. They're just for show and a reminder to myself about which functions I've actually checked. The PREFETCHX ones are the radius around the current frame that needs to be prefetched. For example PREFETCH0 means that a filter needs frame n as input to output frame n. PREFETCH1 means that n-1, n, n+1 are needed as input for frame n. You get the point.
The general PREFETCH macro allows you to divide and multiply the output frame number before determining which input frames are needed. So filters like decimate can be made to work. The main reason for the prefetch stuff is that it makes implementing threading for avisynth filters a lot easier. With prefetching all frames a filter will need as input to produce a single frame will be available from the start. If they're not available the filter will, like in single threaded avisynth, have to call the filter above it in the chain and wait for it to return. This also means that the filter instance can't be used by another thread either since avisynth filters are all single threaded. So then the other threads most likely have to sit around and wait and do nothing. Note that avisynth-mt gets around this by spawning a lot of filter instances instead. I hope this is clear enough.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
10th February 2013, 03:08 | #720 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,699
|
Myrsloik, kind of different question, but I figure you would know.
How often in video processing is there a operation dependence between planes? For example, is there a time when a filter needs information from the chroma planes to perform an operation on the luma plane? The reason I ask is that I am considering adding stream support to my CUDA port. It might be incorporated into a later version, but it has some strong capabilities. Streams are a CUDA-ism that let the developer run multiple kernels in parallel on a CUDA device. This would allow for the ability to operate on all luma and chroma planes in parallel. The only time I can think of an inter-plane dependence is possibly when performing motion compensation, so I thought I'd ask. Simple filters like invert would see a nice speed boost, as they would likely only take as long as the luma plane to process, considering that there is much less data in the chroma planes (in subsampled video, that is). |
Tags |
speed, vaporware, vapoursynth |
|
|