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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th September 2015, 17:08   #41  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
While you're designing the native VS build, I have a question regarding Vapoursynth's multithreading and DGSource. Is it generally safe to allow multithreading for DGSource or is it better to use core = vs.get_core(threads=1) before it and core = vs.get_core(threads=-1) afterwards? I assume it's mostly up to the GPU driver but there's no general opinion on this matter.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 19th September 2015, 17:17   #42  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Boulder View Post
While you're designing the native VS build, I have a question regarding Vapoursynth's multithreading and DGSource. Is it generally safe to allow multithreading for DGSource or is it better to use core = vs.get_core(threads=1) before it and core = vs.get_core(threads=-1) afterwards? I assume it's mostly up to the GPU driver but there's no general opinion on this matter.
This isn't avisynth. All filters have to specify how they want to be threaded. Only the first get_core() call matters, all arguments are ignored for later calls (you should never need to use any of the arguments apart from when debugging or developing).
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 19th September 2015, 18:05   #43  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by Myrsloik View Post
This isn't avisynth. All filters have to specify how they want to be threaded. Only the first get_core() call matters, all arguments are ignored for later calls (you should never need to use any of the arguments apart from when debugging or developing).
What about in the case of an Avisynth plugin loaded in Vapoursynth?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 19th September 2015, 18:18   #44  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Boulder View Post
What about in the case of an Avisynth plugin loaded in Vapoursynth?
It's still not avisynth.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 19th September 2015, 20:46   #45  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
I don't know enough about Vapoursynth yet to comment with respect to DGSource(). I'll let you know what I discover about it.
videoh is offline   Reply With Quote
Old 19th September 2015, 22:38   #46  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Things are looking real good, guys and gals. I am playing video with random access from a .vpy script with 64-bit DGDecodeNV.dll.

The only stuff left is to change the bitblt's for pulldown to Vapoursynth ones (AVSenv->BitBlt is obviously not available) and to implement the debug overlay. Then it's done!

Last edited by videoh; 19th September 2015 at 22:41.
videoh is offline   Reply With Quote
Old 19th September 2015, 22:45   #47  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Awesome!
Reel.Deel is offline   Reply With Quote
Old 19th September 2015, 22:48   #48  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
OMG that's so awesome!
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 20th September 2015, 02:04   #49  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Here is some tasty DGDecodeNV cooked Vapoursynth-style. Your test results will be appreciated. The standard DGIndexNV should be used for indexing. Note that hinting is gone for Vapoursynth as it will be converted to use Vapoursynth per-frame properties.

http://rationalqm.us/misc/DGDecodeNV_Vapoursynth.zip

This is a dual-function DLL for both Avisynth and Vapoursynth. Sample script:

import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin('dgdecodenv_vs64.dll')
ret = core.dgdecodenv.DGSource('alba.dgi',debug=1)
ret.set_output()

Last edited by videoh; 20th September 2015 at 02:16.
videoh is offline   Reply With Quote
Old 20th September 2015, 05:51   #50  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
Quote:
Originally Posted by videoh View Post
Here is some tasty DGDecodeNV cooked Vapoursynth-style.
Did a quick test to load a random ts file and a bluray file and it works like a charm. MPEG2 and H.264 source.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 20th September 2015, 13:19   #51  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Sweet. Thank you for the testing.
videoh is offline   Reply With Quote
Old 20th September 2015, 15:45   #52  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
any plans to get plugin for non-windows systems?

Last edited by sl1pkn07; 25th September 2015 at 19:11.
sl1pkn07 is offline   Reply With Quote
Old 20th September 2015, 16:06   #53  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Currently, no, but it's not ruled out in the future.

Last edited by videoh; 20th September 2015 at 21:14.
videoh is offline   Reply With Quote
Old 20th September 2015, 18:00   #54  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Thanks for the test build Unfortunately it might take me a while to get to test it so you'll probably end up releasing a final build before that.. Nevertheless, great job once again!
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 22nd September 2015, 16:11   #55  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
I did in fact release it as DGDecNV 2050.
videoh is offline   Reply With Quote
Old 3rd October 2015, 10:04   #56  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
I didn't want to open a new thread so I'm posting this here since it seems to concern DGSource.

With a simple script,

Code:
import vapoursynth as vs
core = vs.get_core()
clp = core.dgdecodenv.DGSource('L:\ALL_ABOUT_EVE\eve.dgi')
clp.set_output()
vspipe throws an error "Specified filter framerate must be normalized" and gives the Windows crash report window. It points to ucrtbase.DLL.

I checked on a different source I happened to have on my computer, and it doesn't have any problems.

I'm using Vapoursynth R28RC1 with Python 3.5 and the latest slipstream of DGDecNV. Can you verify if this is more likely related to VS itself or DGDecNV?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 3rd October 2015, 10:43   #57  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
I added an extra check in r28 to make sure a certain framerate only has one representation. It makes checking for the same framerate much easier. Use vs_normalizeRational on the framerate field and it will work.

This change was made to fix things like 60000/2002 not being considered equal to 30000/1001.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 3rd October 2015, 11:05   #58  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
So we need to include VSHelper.h and call vs_normalizeRational() anytime the framerate is set? Seems odd to error out and core dump on that, when setVideoInfo calls it anyway.
foxyshadis is offline   Reply With Quote
Old 3rd October 2015, 12:15   #59  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
It's more than odd. Vapoursynth now breaks working filters "to make things easier". It's a terrible precedent that evolution of Vapoursynth can break filters.

If Vapoursynth detects a "non-normalized framerate" (whatever that may be, I have seen no formal explanation) then why can't Vapoursynth normalize it internally if it needs to do so? Instead of having the code once, you require every source filter writer to do it? And for me it's not just the source filter; the indexer component will need to be changed as well (I'm not going to report one frame rate through the GUI and index file and then give a different one to Vapoursynth). Vapoursynth has code to detect a non-normalized rate and throw an error, but not to normalize it? Vapoursynth can't call vs_normalizeRational() itself on the incoming frame rate? That is bizarre.

And what if a stream actually carries a non-normalized framerate? The source filter has to lie about it? I'm not just talking about multiples but also small deviations from exact rates.

Speaking for myself, I have no intention of modifying DGDecNV this way, so if things stand then DGDecNV will be unusable in Vapoursynth (and I'll have a bad taste in my mouth about spending my time supporting Vapousynth). At least I'll save some time by not having to do it again for DGDecIM.

Last edited by videoh; 3rd October 2015 at 12:59.
videoh is offline   Reply With Quote
Old 3rd October 2015, 13:24   #60  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by videoh View Post
It's more than odd. Vapoursynth now breaks working filters "to make things easier". It's a terrible precedent that evolution of Vapoursynth can break filters.

If Vapoursynth detects a "non-normalized framerate" (whatever that may be, I have seen no formal explanation) then why can't Vapoursynth normalize it internally if it needs to do so? Instead of having the code once, you require every source filter writer to do it? And for me it's not just the source filter; the indexer component will need to be changed as well (I'm not going to report one frame rate through the GUI and index file and then give a different one to Vapoursynth). Vapoursynth has code to detect a non-normalized rate and throw an error, but not to normalize it? Vapoursynth can't call vs_normalizeRational() itself on the incoming frame rate? That is bizarre.

And what if a stream actually carries a non-normalized framerate? The source filter has to lie about it? I'm not just talking about multiples but also small deviations from exact rates.

Speaking for myself, I have no intention of modifying DGDecNV this way, so if things stand then DGDecNV will be unusable in Vapoursynth (and I'll have a bad taste in my mouth about spending my time supporting Vapousynth). At least I'll save some time by not having to do it again for DGDecIM.
Oh, come on. It's not the end of the world.

This isn't about small deviations from "exact" rates. You simply need to pick the smallest pair of numbers that represent your frame rate, e.g. 24000/1001 rather than 120000/5005. That's all there is to it.

It's one additional line in the VapourSynth filter, and maybe 10 in the indexer, if you copy vs_normalizeRational..
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:22.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.