View Full Version : vsrawsource - Raw Video Reader for VapourSynth


Chikuzen
11th October 2012, 15:10
I wrote a VapourSynth plugin named vsrawsource.
vsrawsource-0.3.2.zip (http://www.mediafire.com/download/dxsb99ttb4qwp6e/vsrawsource-0.3.2.zip)

source code repository
https://github.com/chikuzen/vsrawsource

This plugin is the rewrited version of avisynth's rawsource.dll (http://forum.doom9.org/showthread.php?t=39798) to for VS from scratch.

I am inviting the patch for MacOS X build now.

EDIT:
2013/07/31
updated to 0.3.2

active1
12th October 2012, 00:34
cool! thank you Chikuzen :)
i compiled it successfully on linux, but why does the configure script will work only when i run it as root? (sudo sh configure)

Chikuzen
12th October 2012, 01:08
cool! thank you Chikuzen :)
i compiled it successfully on linux, but why does the configure script will work only when i run it as root? (sudo sh configure)

because I forgot to 'chmod +x' to configure :p

kolak
12th October 2012, 19:21
Which formats are supported?

SassBot
12th October 2012, 19:23
To query the list of formats:

supported color formats:
see core.raws.FormatList()

Chikuzen
13th October 2012, 01:41
or see source code.
https://github.com/chikuzen/vsrawsource/blob/master/format_list.c

kolak
13th October 2012, 16:15
Thanks-all clear now:)

Myrsloik
13th October 2012, 23:24
I looked at the source. It's a bad idea to write to stdout directly. If you want to return text you really should return it as a string value from the function because as it is it won't even interact with the python interpreter nicely.
My personal opinion is that this kind of stuff belongs in the documentation but that's up to you.

Chikuzen
17th October 2012, 12:35
Update to 0.2.0

* new option 'rowbytes_align'.
* support Windows Bitmap(.bmp)

BMP support is only for 24bit/32bit uncompressed RGB (palette,RLE and the others are not supported).

Chirico
2nd November 2012, 13:24
OS X compiled version can be grabbed from here (http://www.sendspace.com/file/okjpi7).

Robert Martens
14th November 2012, 20:56
Just a quick note, it seems that your function registration is looking for parameters named "header_off" and "frame_off":

...

VS_EXTERNAL_API(void) VapourSynthPluginInit(
VSConfigPlugin f_config, VSRegisterFunction f_register, VSPlugin *plugin)
{
f_config("chikuzen.does.not.have.his.own.domain.raws", "raws",
"Raw-format file Reader for VapourSynth " VS_RAWS_VERSION,
VAPOURSYNTH_API_VERSION, 1, plugin);
f_register("Source", "source:data;width:int:opt;height:int:opt;"
"fpsnum:int:opt;fpsden:int:opt;src_fmt:data:opt;"
"header_off:int:opt;frame_off:int:opt;rowbytes_align:int:opt",
create_source, NULL, plugin);
}

Whereas the readme, and your argument setting code, use "off_header" and "off_frame":

...

vs_args_t va = { in, out, core, vsapi };

if (header > 0) {
set_args_int(&rh->vi.width, 720, "width", &va);
set_args_int(&rh->vi.height, 480, "height", &va);
set_args_int(&rh->off_header, 0, "off_header", &va);
set_args_int(&rh->off_frame, 0, "off_frame", &va);
set_args_int(&rh->row_adjust, 1, "rowbytes_align", &va);
set_args_data(rh->src_format, "I420", "src_fmt", FORMAT_MAX_LEN, &va);
}

...

In my quest to get my hands on planar RGB input to test my own plugin, I found the need to use those options, but they don't seem to work as expected, and it looks like it's just a mixup of the names.

Chikuzen
14th November 2012, 21:06
oops, sorry.
I didn't notice that typo.

It seems that VS-r15 is coming soon and API version is bumped up.
so i'll release new version with fixed it as soon as r15 is come.

Robert Martens
14th November 2012, 21:10
That's great, thank you! I'm in no rush, mind you, I just wanted to make sure I mentioned it. In the meantime, I've written a little command line application that strips out the headers of the files I'm working with, so I can work around it for as long as I need to. I appreciate your work on this plugin, it's proving to be very useful!

Chikuzen
16th November 2012, 02:15
updated to 0.3.0

* Alpha channel support
* fix typo

All alpha channel data will be stored in "_Alpha" prop.
You can extract it with 'alpha = core.std.PropToClip(clip)' as a Gray clip.

Chikuzen
11th January 2013, 17:52
updated to 0.3.1

* change alpha support method.

Chikuzen
31st July 2013, 10:54
update to 0.3.2

* fix memory leak
* cope with the filename which includes non-ASCII characters

Myrsloik
2nd December 2013, 16:55
New compiles for 64 bit are available here (https://dl.dropboxusercontent.com/u/73468194/vsrawsource-64.7z).

feisty2
19th June 2015, 10:41
how do I compile this thing exactly?
I followed the instructions

$ cd ./vsrawsource
$ ./configure
$ make

and everything went okay actually, no error occurred, I got a 22kb .dll file
and I copied that file along with cygwin1.dll to the plugin directory and tried to run it
and vaporsynth just crashed without any warning

jackoneill
19th June 2015, 10:50
how do I compile this thing exactly?
I followed the instructions

and everything went okay actually, no error occurred, I got a 22kb .dll file
and I copied that file along with cygwin1.dll to the plugin directory and tried to run it
and vaporsynth just crashed without any warning

Maybe your changes are incorrect and that's why it crashed. (If you're not making any changes, just use the existing DLLs.) Since you have Cygwin, you can probably install gdb and find out more about the crash.

There are no secret compilation instructions that make it not crash. Probably.

feisty2
19th June 2015, 10:57
I don't know, after failed to run that modified version, I tried to compile Chikuzen's original code, and it still crashed
I'll get gdb and report back soon

feisty2
19th June 2015, 12:36
okay, I been messing with gdb for the last 1.5 hours and still got no clue about how to get it to debug, literally.
so I made a broken binary of Chikuzen's original code
here: https://github.com/IFeelBloated/vsrawsource/releases/tag/test
a little help here, tell me what I'm doing wrong plz?

jackoneill
19th June 2015, 12:49
Make sure to add -ggdb -g3 -O0 to the CXXFLAGS and don't let it strip the DLL.


gdb --args <command that crashes>
run
bt full

This prints the sequence of function calls that led to the crash, with the most recent at #0. It should give you the location of the crash as a file name and line number.

feisty2
19th June 2015, 14:04
sorry for the dumbness but, I'm still confused with gdb, like, what kind of command do I have to put in "<command that crashes>", sure it can't be that core.raws.Source.... vaporsynth command, right? it crashes vaporsynth if you try to load any file with core.raws.Source (...)
I updated a new broken x64 binary with debug symbols, someone kind plz, help me do the gdb test.

Are_
19th June 2015, 14:40
Something like "vspipe.exe something.py -"

feisty2
19th June 2015, 15:25
http://i.imgur.com/yixUMDT.png
okay, it got stuck like this for, 15 minutes.
what does it mean?

1.vpy
import vapoursynth as vs
core = vs.get_core()
clp = core.raws.Source("1.rgb",720,576,src_fmt="GRAY16")
clp.set_output ()

jackoneill
19th June 2015, 16:00
It means there was no crash.

feisty2
19th June 2015, 16:15
but 1.rgb is only about 30MB, vspipe should've done the work within seconds, not stuck for 15 minutes, and when I terminated vspipe.exe in taskmgr, t.rgb was still 0kb
http://i.imgur.com/cdqKiGB.png
and I loaded 1.vpy in vseditor and tried to preview it, it got stuck as well and taskmgr told me it stopped responding

captainadamo
19th June 2015, 16:21
Can you host your sample file somewhere and post exactly what your script is? I can try to help you diagnose your issues.

feisty2
19th June 2015, 16:43
1.rgb https://mega.nz/#!FxIRHZRS!l_Vu7N_0ASSccLv0KFHJLqmiY1CtaBSyK0pemTgDDtY
1.vpy

import vapoursynth as vs
core = vs.get_core()
clp = core.raws.Source("1.rgb",720,576,src_fmt="GRAY16")
clp.set_output ()


1.vpy vspipe.exe are in the same folder with 1.rgb

edit:
and broken x64 binary with debug symbols https://github.com/IFeelBloated/vsrawsource/releases/tag/test
in case you missed #21

sl1pkn07
19th June 2015, 17:46
works for me in linux (64 bits) with original code, with vsedit and pipe method

you clip is only 35frames?

feisty2
19th June 2015, 17:50
Yeah, 35 frames just for test

sl1pkn07
19th June 2015, 17:52
then works ok for me

EDIT: oh. wait. i use this fork https://github.com/myrsloik/vsrawsource

sorry :S

feisty2
19th June 2015, 17:57
Maybe I should uninstall windows and take Linux instead?
Okay, I'm joking...
But I can't get it to work on windows with gcc

sl1pkn07
19th June 2015, 17:58
and with clang?

feisty2
19th June 2015, 18:02
Didn't test with clang, but it's 10am now and I'm going out and I will test it and report back when I get home

feisty2
20th June 2015, 04:29
@HolyWu
still not working, I think my gcc might be corrupted, I'll reinstall it and report back

feisty2
20th June 2015, 05:21
reinstalled gcc and things worked out alright, finally
so, new version here
v0.3.3
update: added support to GrayS (tested) and GrayH (not tested, cuz I can't find any float16 clip and fmtc got no support for GrayH so no way to test)
https://github.com/IFeelBloated/vsrawsource/releases/tag/0.3.3

ddubya
28th January 2016, 03:29
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

Efenstor
2nd April 2016, 15:17
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

Can you please give me a hand on the shell pipes (in Linux)? Surfed through a whole lot of sites and still unsuccessful. Here is what I try to do and it doesn't work.
video = core.raws.Source(sys.stdin, 1920, 1080, 30000, 1001)
# Here goes some processing
video.set_output()
Command line:
ffmpeg -i input.mts -pix_fmt yuv420p -f rawvideo - | \
env PYTHONPATH=/usr/local/lib/python3.4/site-packages vspipe --y4m proc_vs.py - | \
ffmpeg -i pipe: output.mkv
The error I get:
Script evaluation failed:
Python exception: 'utf-8' codec can't decode byte 0x80 in position 7291: invalid start byte

jackoneill
2nd April 2016, 19:12
video = core.raws.Source(sys.stdin, 1920, 1080, 30000, 1001)
# Here goes some processing
video.set_output()

Script evaluation failed:
Python exception: 'utf-8' codec can't decode byte 0x80 in position 7291: invalid start byte

video = core.raws.Source("/dev/stdin", 1920, 1080, 30000, 1001)

Myrsloik
2nd April 2016, 19:14
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.

Efenstor
2nd April 2016, 19:27
video = core.raws.Source("/dev/stdin", 1920, 1080, 30000, 1001)


Ouch. Never though it would be that simple and obvious.:thanks:

ddubya
4th April 2016, 02:54
Use "/dev/stdin" as the file path (it needs to be a path) instead of sys.stdin

Myrsloik
29th July 2016, 19:31
Here are compiled windows binaries (https://dl.dropboxusercontent.com/u/73468194/rawsource_binaries.7z).

kolak
30th July 2016, 15:50
:thanks:

Going to try.

kolak
30th July 2016, 23:27
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.

sl1pkn07
30th July 2016, 23:47
/dev/stdin sounds a linux

kolak
30th July 2016, 23:55
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?

ddubya
31st July 2016, 01:09
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
31st July 2016, 01:19
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
31st July 2016, 01:52
Changes pushed for opening from stdin, using "-"

kolak
31st July 2016, 12:31
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
31st July 2016, 12:33
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")

?

ddubya
31st July 2016, 20:15
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
31st July 2016, 20:15
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("-")

kolak
31st July 2016, 20:59
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
31st July 2016, 20:59
clip = core.raws.Source("-")

Easy enough :)

Myrsloik
2nd August 2016, 12:56
Updated binaries (https://dl.dropboxusercontent.com/u/73468194/rawsource_binaries2.7z)

kolak
2nd August 2016, 15:03
Thanks, but still no luck:

Python exception: raws: failed to open source file stdin in binary mode (for both rawvideo and y4m)

Myrsloik
4th August 2016, 10:40
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.

ddubya
4th August 2016, 16:47
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.

x264 does this:

_setmode( _fileno( stdin ), _O_BINARY );


I just committed change to do the same instead of freopen(). I'm pretty sure windows defaults to text mode on open which would likely mess up y4m header parsing.

Myrsloik
4th August 2016, 21:31
Again (https://dl.dropboxusercontent.com/u/73468194/rawsource_binaries3.7z)

You really should test your code...

kolak
5th August 2016, 11:38
Yep, this code needs some work/debugging.

New error:

raws: check_header: fail to read file magic

vspipe crashes.

Jindadil007
30th January 2017, 03:19
Hi While Loading Raw source, I get this error : vapoursynth.Error: LoadLibraryEx failed with code 87: update windows and try again

Here is my script :

core.std.LoadPlugin('vsrawsource.dll')
video = core.raws.Source(r'C:\DVD\Vine.raw')

Input raw file is RGB48. Pl. help. Thanks. Also would appreciate if some one compile vsrawsource.dll (v 0.33) for windows for non programmers. I am on Win10.

Sent from my GT-N8000 using Tapatalk

jackoneill
30th January 2017, 12:53
Hi While Loading Raw source, I get this error : vapoursynth.Error: LoadLibraryEx failed with code 87: update windows and try again

Here is my script :

core.std.LoadPlugin('vsrawsource.dll')
video = core.raws.Source(r'C:\DVD\Vine.raw')

Input raw file is RGB48. Pl. help. Thanks. Also would appreciate if some one compile vsrawsource.dll (v 0.33) for windows for non programmers. I am on Win10.

Sent from my GT-N8000 using Tapatalk

You're missing some Windows update. Thus,

update windows and try again

Jindadil007
30th January 2017, 15:12
You're missing some Windows update. Thus,

Hi My win10 is upto date. Maybe the vswarsource.dll is corrupt. Can i get a new updated dll ?

Thanks

Jindadil007
30th January 2017, 16:57
Updated binaries (https://dl.dropboxusercontent.com/u/73468194/rawsource_binaries2.7z)

Hi. Link is not working. Can you please upload and share vsrawsource.dll since I do not know how to compile...Thanks

Jindadil007
1st February 2017, 06:01
Hi...I am looking for a resolution to my problem stated in above post...

Jindadil007
1st February 2017, 18:04
Hi While Loading Raw source, I get this error : vapoursynth.Error: LoadLibraryEx failed with code 87: update windows and try again

Here is my script :

core.std.LoadPlugin('vsrawsource.dll')
video = core.raws.Source(r'C:\DVD\Vine.raw')

Input raw file is RGB48. Pl. help. Thanks. Also would appreciate if some one compile vsrawsource.dll (v 0.33) for windows for non programmers. I am on Win10.

Sent from my GT-N8000 using Tapatalk

Hi Myrsloik,

You resolved this issue at https://github.com/vapoursynth/vapoursynth/issues/210

How can I get away with this error on my Win10 where installing KB2533623 is not possible ? Pl. help...

Myrsloik
1st February 2017, 19:51
The windows compile never worked well and nobody bothered to debug it. That's why it's unavailable. That error has only happened on windows 7 or older before. I have no idea how you managed to trigger it on windows 10. Are you really using windows 10?

Jindadil007
2nd February 2017, 05:44
The windows compile never worked well and nobody bothered to debug it. That's why it's unavailable. That error has only happened on windows 7 or older before. I have no idea how you managed to trigger it on windows 10. Are you really using windows 10?

Thanks Myrsloik. Yes I am using Win10HomeOEM (Anniversary Update).

I am not a programmer so would wait till someone attempts to get this working in windows. Would try it on Mac this weekend.

dipje
3rd February 2017, 15:54
I used a compile from feisty2, x64 dll which works fine on my Win10, but it's from somewhere june 2015. No clue what has changed since then and if that's crucial for you, but at least you know of it's existence now :)

https://github.com/IFeelBloated/vsrawsource/releases

Jindadil007
4th February 2017, 08:11
I used a compile from feisty2, x64 dll which works fine on my Win10, but it's from somewhere june 2015. No clue what has changed since then and if that's crucial for you, but at least you know of it's existence now :)

https://github.com/IFeelBloated/vsrawsource/releases

Thanks Dipje...This works well on Win10 :)

Jindadil007
5th February 2017, 05:59
Hi...I converted a clip from YUV to RGBS with using vspipe with this script :

import vapoursynth as vs
core = vs.get_core()
video = core.d2v.Source(r'C:\DVD\Sample.d2v')
video = core.resize.Point(video, matrix_in_s="170m", format=vs.RGB24)
video = core.fmtc.bitdepth(video,bits=32,fulls=False,fulld=True)
video.set_output()

While the preview was good, but the actual raw video I get after loading in VSeditor is having a grainy look...

Where I am Wrong ?

feisty2
5th February 2017, 08:46
Where I am Wrong ?

short answer: everywhere
long answer: you need to learn some very basic stuff about video processing before messing around very advanced filters like V-BM3D or Vine or Plum
a raw file(excluding y4m) = nothing but the binary data of the image/video
you need to manually specify the following properties at least
- resolution(width, height)
- colorspace
and probably some extra properties
- packed/planar(if the raw contains multiple channels)
- little endian/big endian(if the raw has a bitdepth more than 8bpc)
- decompressing algorithm(if the raw is not uncompressed)
- framerate(not necessary cuz it won't affect the processing anyways)

now google all these things and stop expecting to be spoon-fed

Jindadil007
5th February 2017, 09:14
short answer: everywhere
long answer: you need to learn some very basic stuff about video processing before messing around very advanced filters like V-BM3D or Vine or Plum
a raw file(excluding y4m) = nothing but the binary data of the image/video
you need to manually specify the following properties at least
- resolution(width, height)
- colorspace
and probably some extra properties
- packed/planar(if the raw contains multiple channels)
- little endian/big endian(if the raw has a bitdepth more than 8bpc)
- decompressing algorithm(if the raw is not uncompressed)
- framerate(not necessary cuz it won't affect the processing anyways)

now google all these things and stop expecting to be spoon-fed


You can stop responding to my posts...Your tone and tanor is not something which i like...If everything is on google...what for we are here ? We are here to ask experts like you but don't show your attitude...nobody gives a damn to your skills if your attitude is not good...

feisty2
5th February 2017, 09:22
You can stop responding to my posts...Your tone and tanor is not something which i like...If everything is on google...what for we are here ? We are here to ask experts like you but don't show your attitude...nobody gives a damn to your skills if your attitude is not good...

I don't know where you're from and how you define a "nice attitude", but I'm speaking with a perfectly normal and non-aggressive attitude in the English world, get used to it.

dipje
5th February 2017, 15:07
Although I do get how feisty comments may come over as rude, that also means you don't need to take everything as an offensive comment (and let me be clear that I'm absolutely neutral in all of this).

That being said, in this thread and others you are asking (repeatedly and sometimes seemingly impatiently) basic things that are out of the scope of the thread.
If the thread is about an avisynth plugin and you ask basic avisynth-principles, it's normal to receive an answer 'learn avisynth first'. That's not offensive, that's just a redirection that the question your asking belongs somewhere else.

You seem to be going to a school for 'learning to drive rally race cars at high speed' and you keep asking your instructor 'where is the brake pedal'.. that's not how it works. First basics, then the next step up.

If you use the plugin 'vsrawsource' and you think it's ok to just specify the filename and nothing more, you're clearly not really knowing what you're doing and people with very little spare time don't always want to answer basics like that. So go learn what the plugin is actually doing / supposed to do seems like a valid answer here.
And in case you want to take the shortcuts and say "I don't need to know what it is I'm doing or who it works, I just want it working" well, feisty did give you the answers to what you were missing. You need to specify all you know about the file file, because there is zero information in the file itself. Width, height and pixel-format is the minimum.

_that_ being said, I do find it weird that you're opening a .D2V file inside of Vapoursynth only to convert it to a raw floating-point rgb file-dump, which you're then trying to open up back into Vapoursynth. But good luck at whatever you're trying.

Jindadil007
5th February 2017, 17:13
Although I do get how feisty comments may come over as rude, that also means you don't need to take everything as an offensive comment (and let me be clear that I'm absolutely neutral in all of this).

That being said, in this thread and others you are asking (repeatedly and sometimes seemingly impatiently) basic things that are out of the scope of the thread.
If the thread is about an avisynth plugin and you ask basic avisynth-principles, it's normal to receive an answer 'learn avisynth first'. That's not offensive, that's just a redirection that the question your asking belongs somewhere else.

You seem to be going to a school for 'learning to drive rally race cars at high speed' and you keep asking your instructor 'where is the brake pedal'.. that's not how it works. First basics, then the next step up.

If you use the plugin 'vsrawsource' and you think it's ok to just specify the filename and nothing more, you're clearly not really knowing what you're doing and people with very little spare time don't always want to answer basics like that. So go learn what the plugin is actually doing / supposed to do seems like a valid answer here.
And in case you want to take the shortcuts and say "I don't need to know what it is I'm doing or who it works, I just want it working" well, feisty did give you the answers to what you were missing. You need to specify all you know about the file file, because there is zero information in the file itself. Width, height and pixel-format is the minimum.

_that_ being said, I do find it weird that you're opening a .D2V file inside of Vapoursynth only to convert it to a raw floating-point rgb file-dump, which you're then trying to open up back into Vapoursynth. But good luck at whatever you're trying.

Got it ... No Offence... Yes I got good results by using :
video = core.raws.Source(r'C:\DVD\Vspipe\Sample.raw',720,480,src_fmt="RGB")
Anyways...Can you suggest a good link/forum where I can learn the basics...this looks for advanced programmers...

Mystery Keeper
5th February 2017, 18:04
Got it ... No Offence... Yes I got good results by using :
video = core.raws.Source(r'C:\DVD\Vspipe\Sample.raw',720,480,src_fmt="RGB")
Anyways...Can you suggest a good link/forum where I can learn the basics...this looks for advanced programmers...This forum has Newbies section (https://forum.doom9.org/forumdisplay.php?f=6).

KingLir
21st February 2017, 00:28
Anyone was able to build this for macOS ? I am getting:

$ ./configure

generating config.mak ...

error: patches welcome

KingLir
23rd February 2017, 00:52
I was able to build on macOS with this. Anyone able to do a commit with this patch - please do.


gcc -c -fPIC ${CFLAGS} ${CPPFLAGS} -I. $(pkg-config --cflags vapoursynth) -o main.o rawsource.c
g++ -dynamiclib -undefined suppress -flat_namespace *.o -o libraws.dylib

ifb
23rd February 2018, 04:59
Is there some trick to making a working windows build? I can usually preview a frame or two in VS Editor before it dies. vspipe also crashes and I can't get a backtrace with gdb. I messed with this a few weeks ago and gdb pointed at history_add(), but I've since changed something and I can't even get that far anymore.

I haven't tried building with visual studio yet. The same script works fine in a Linux VM.

import vapoursynth as vs
core = vs.get_core(threads=1)
# https://media.xiph.org/video/derf/Chimera/Netflix_WindAndNature_4096x2160_60fps_10bit_420.yuv
c = core.raws.Source('Netflix_WindAndNature_4096x2160_60fps_10bit_420.yuv',4096,2160,60000,1001,src_fmt='YUV420P10')
c.set_output()
vspipe script.vpy output.raw

Ultimately, I'd like to use walisser's vsrawsource repo (https://github.com/walisser/vsrawsource) with pipe input, but it's only a few commits ahead of Myrsloik's tree which doesn't work either so I don't know what I've screwed up here.

Myrsloik
23rd February 2018, 12:22
Use this repo (https://github.com/maki-rxrz/vsrawsource) which has fixed the crash and other issues.

Windows binaries (http://www.mediafire.com/file/w8ha7gvvehvebj5/vsrawsource_vs2017.7z).

How many forks are there now? Which one should I point to?

ifb
23rd February 2018, 18:18
Use this repo (https://github.com/maki-rxrz/vsrawsource) which has fixed the crash and other issues.

Windows binaries (http://www.mediafire.com/file/w8ha7gvvehvebj5/vsrawsource_vs2017.7z).
Thanks. I did manage to debug it with vs2017 last night and find the crash, but it was late and the fix (https://github.com/maki-rxrz/vsrawsource/commit/688e6fbea73660a7937b9887b1501f458072a8ab) wasn't immediately obvious to me.

I didn't know there was yet another fork and the work had already be done for me. :rolleyes:

logicom
2nd November 2019, 18:00
I am experiencing dificulties to make this working:

ffmpeg -y -re -f lavfi -i testsrc=duration=30:size=720x576:rate=25 -c:v rawvideo -pix_fmt yuv420p -r 25 -an -f rawvideo - | vspipe --y4m live.vpy - | ffplay -f rawvideo -pix_fmt yuv420p -s 720x576 -i -

where live.vpy is:

import vapoursynth as vs
core = vs.get_core()
clip = core.raws.Source("-",720,576,src_fmt="YUV420P8")
clip.set_output()

could someone provide win binary that accepts input from "-"

:thanks:

Myrsloik
2nd November 2019, 18:58
It's been a long time since I looked at this but I think reading from stdin on windows never worked well.

logicom
2nd November 2019, 19:44
Any advice on how to move on from this point?

DJATOM
4th November 2019, 12:30
Looks like it works, thx.

poisondeathray
4th November 2019, 16:51
Awesome, works well, thanks

Is raw pipe (or yuv pipe) in, or anything like that possible with avisynth ?

logicom
4th November 2019, 23:53
Try this (https://github.com/HolyWu/vsrawsource/releases/download/20191104/vsrawsource-20191104.7z). I think it should work.

Thank you for looking into this. I tested 64 bit version
and piping was working. But I was wondering why I could not have any influence on framerate.

whithout vsrawvideo pipe: 25 tbr, 25 tbn, 25 tbc

with vsrawvideo pipe: 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc

I tested with yuv420p yuv422p and yuv444p

Kind Regards.

poisondeathray
5th November 2019, 00:01
@logicom -

core.raws.Source(fpsnum=25, fpsden=1)

If you add --y4m headers for vspipe , the receiving application should take that information

logicom
5th November 2019, 01:04
:)

Thank you!

DJATOM
5th November 2019, 13:05
@poisondeathray
you can wrap core.raws.Source call with AVS plugin VapourSource (function VSEval), it should work as intended.