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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd April 2016, 19:14   #41  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by ddubya View Post
I have fixed a bunch of bugs in vsrawsource and almost done adding tests. Also I have added capability to read from a pipe (not tested on windows yet).

I have not compiled or tested on windows yet, if you want to help go for it.

https://github.com/walisser/vsrawsource
I've had a go at making it compile on windows. Btw, snprintf works just fine in vs2015 so don't just mindlessly copy and paste compatibility stuff.

I'm going to test my changes and then make a pull request I guess.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd April 2016, 19:27   #42  |  Link
Efenstor
Registered User
 
Join Date: Aug 2008
Location: Krasnoyarsk, Russian Federation
Posts: 90
Quote:
Originally Posted by jackoneill View Post
Code:
video = core.raws.Source("/dev/stdin", 1920, 1080, 30000, 1001)
Ouch. Never though it would be that simple and obvious.
Efenstor is offline   Reply With Quote
Old 4th April 2016, 02:54   #43  |  Link
ddubya
Registered User
 
Join Date: Jan 2016
Posts: 8
Use "/dev/stdin" as the file path (it needs to be a path) instead of sys.stdin
ddubya is offline   Reply With Quote
Old 29th July 2016, 19:31   #44  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Here are compiled windows binaries.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th July 2016, 15:50   #45  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843


Going to try.
kolak is offline   Reply With Quote
Old 30th July 2016, 23:27   #46  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
import vapoursynth as vs
import sys
core = vs.get_core()

clip = core.raws.Source("/dev/stdin")
clip = core.fmtc.bitdepth (clip, bits=10)
clip.set_output()
enable_v210 = True


with:
ffmpeg -i C:\Users\Andy\Desktop\50i.avi -f yuv4mpegpipe - | "C:\Program Files (x86)\VapourSynth\core64\vspipe.exe" --y4m C:\Users\Andy\Desktop\rr.vpy - | C:\ffmpeg.exe -i - -c:v v210 C:\Users\Andy\Desktop\vv.mov

doesn't work, giving error:

Output #0, yuv4mpegpipe, to 'pipe:':
Metadata:
encoder : Lavf57.44.100
Stream #0:0: Video: wrapped_avframe, yuv422p, 1920x1080, q=2-31, 200 kb/s, 2
5 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.51.100 wrapped_avframe
Stream mapping:
Stream #0:0 -> #0:0 (utvideo (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Script evaluation failed:
Python exception: raws: source does not exist.
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScrip
t (src\cython\vapoursynth.c:26897)
File "C:\Users\Andy\Desktop\rr.vpy", line 5, in <module>
clip = core.raws.Source("/dev/stdin")
File "src\cython\vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__
(src\cython\vapoursynth.c:25204)
vapoursynth.Error: raws: source does not exist.


looks like /dev/stdin doesn't work.

Last edited by kolak; 30th July 2016 at 23:34.
kolak is offline   Reply With Quote
Old 30th July 2016, 23:47   #47  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
/dev/stdin sounds a linux
__________________
[AUR] Vapoursynth Stuff
[AUR] Avisynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 30th July 2016, 23:55   #48  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Yes, but been told it should work here also I've read it won't on Windows.


More issues:

clip = core.raws.Source("C:\Users\Andy\Desktop\vv.raw", 1920, 1080, 30000, 1001, src_fmt='YUV422P10')

gives strange error:

Script evaluation failed:
Python exception: (unicode error) 'unicodeescape' codec can't decode bytes in po
sition 2-3: truncated \UXXXXXXXX escape (rr.vpy, line 4)
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1490, in vapoursynth.vpy_evaluateScrip
t (src\cython\vapoursynth.c:26883)
File "C:\Users\Andy\Desktop\rr.vpy", line 4
clip = core.raws.Source("C:\Users\Andy\Desktop\vv.raw", 1920, 1080, 30000, 1
001, src_fmt='YUV422P10')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in positio
n 2-3: truncated \UXXXXXXXX escape


Is this complaining about actual video data?
kolak is offline   Reply With Quote
Old 31st July 2016, 01:09   #49  |  Link
ddubya
Registered User
 
Join Date: Jan 2016
Posts: 8
Quote:
Originally Posted by kolak View Post

Is this complaining about actual video data?
No, if you want to use a literal backslash in a string, you must escape it with another backslash.

You can use forward slash instead or format like this

"C:\\folder1\\folder2\\file.raw"

etc.
ddubya is offline   Reply With Quote
Old 31st July 2016, 01:19   #50  |  Link
ddubya
Registered User
 
Join Date: Jan 2016
Posts: 8
Quote:
Originally Posted by kolak View Post

looks like /dev/stdin doesn't work.
Yes, it needs the hack that treats the empty dash (-) as stdin, as is the usual convention.

In theory, you could run a pipe server and use names pipes as the ffmpeg ouput / vs input. I don't know of any command offhand that provides this.
ddubya is offline   Reply With Quote
Old 31st July 2016, 01:52   #51  |  Link
ddubya
Registered User
 
Join Date: Jan 2016
Posts: 8
Changes pushed for opening from stdin, using "-"
ddubya is offline   Reply With Quote
Old 31st July 2016, 12:31   #52  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Quote:
Originally Posted by ddubya View Post
No, if you want to use a literal backslash in a string, you must escape it with another backslash.

You can use forward slash instead or format like this

"C:\\folder1\\folder2\\file.raw"

etc.
OK, but this is related only to raw reader. Other plugins are fine with "normal" paths.
kolak is offline   Reply With Quote
Old 31st July 2016, 12:33   #53  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Quote:
Originally Posted by ddubya View Post
Changes pushed for opening from stdin, using "-"
Cool, need to wait for myrsloik to compile new version.

How I meant to use it after this change? Still:

clip = core.raws.Source("/dev/stdin")

?
kolak is offline   Reply With Quote
Old 31st July 2016, 20:15   #54  |  Link
ddubya
Registered User
 
Join Date: Jan 2016
Posts: 8
Quote:
Originally Posted by kolak View Post
OK, but this is related only to raw reader. Other plugins are fine with "normal" paths.
It isn't the plugin, its python. The backslash by itself is the escape character.
ddubya is offline   Reply With Quote
Old 31st July 2016, 20:15   #55  |  Link
ddubya
Registered User
 
Join Date: Jan 2016
Posts: 8
Quote:
Originally Posted by kolak View Post
Cool, need to wait for myrsloik to compile new version.

How I meant to use it after this change? Still:

clip = core.raws.Source("/dev/stdin")

?
clip = core.raws.Source("-")
ddubya is offline   Reply With Quote
Old 31st July 2016, 20:59   #56  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Quote:
Originally Posted by ddubya View Post
It isn't the plugin, its python. The backslash by itself is the escape character.
Ok, but other filters (ffms2, avi source) handle "normal" paths fine without any workaround (at least form the end user).
kolak is offline   Reply With Quote
Old 31st July 2016, 20:59   #57  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Quote:
Originally Posted by ddubya View Post
clip = core.raws.Source("-")
Easy enough
kolak is offline   Reply With Quote
Old 2nd August 2016, 12:56   #58  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Updated binaries
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd August 2016, 15:03   #59  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Thanks, but still no luck:

Python exception: raws: failed to open source file stdin in binary mode (for both rawvideo and y4m)
kolak is offline   Reply With Quote
Old 4th August 2016, 10:40   #60  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
I have a vague memory the code has to do it the windows api way. Using portable stuff won't work.

Or that it works often enough if you simply skip it on windows. That's what x264 seems to do anyway.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 4th August 2016 at 10:57.
Myrsloik is offline   Reply With Quote
Reply


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 20:39.


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