Log in

View Full Version : Encoding a Raw Source in Vapour Synth


Jindadil007
6th February 2017, 02:10
Hi,

I imported a raw file (RGB) in Vapoursynth and now need to denoise it.

Original video is 720*460 FPS = 23.976.

I used this script :
import vapoursynth as vs
core = vs.get_core()
video = core.raws.Source(r'C:\DVD\Vspipe\Sample.raw',720,480,src_fmt="RGB")
video.set_output()

This gives me 29.970 fps and further I see a tile of 9 pics all in grey...

Pl. let me know how to correct this for script to work properly.

Thanks !!!

poisondeathray
6th February 2017, 03:09
I see from the rawsource vapoursynth thread that you started with a DVD

Are you just doing this for fun / testing /learning purposes ?

Because there is no reason to convert to raw RGB first; in fact it's slower and you lose quality from the original

Jindadil007
6th February 2017, 09:47
I see from the rawsource vapoursynth thread that you started with a DVD

Are you just doing this for fun / testing /learning purposes ?

Because there is no reason to convert to raw RGB first; in fact it's slower and you lose quality from the original

Hi...actually i am using heavy filter which encode @<1 fps. THat coupled with 2 pass encode means that for encoding one movie machine should be running for a week. therefore i wanted to apply the filter step by step. one such filter also require input as RGBs. Hope I have clarified why it need to be converted to raw format.

Thanks

sneaker_ger
6th February 2017, 15:38
Try different formats than "RGB" (format list (https://github.com/chikuzen/vsrawsource/blob/master/format_list.txt#L75)). For those with "A"(lpha) in it you may need to change "video.set_output()" to "video[0].set_output()" to access just the non-alpha channels. If you cannot get it to work upload a sample and tell us how you are viewing the script.

Hi...actually i am using heavy filter which encode @<1 fps. THat coupled with 2 pass encode means that for encoding one movie machine should be running for a week. therefore i wanted to apply the filter step by step. one such filter also require input as RGBs. Hope I have clarified why it need to be converted to raw format.
Many VapourSynth filters can run with >8 bit precision. Be careful as to not reduce to 8 bit RGB after every filter. Separating filtering and encoding for multi-pass encoding can make sense if filtering is slow but splitting up into multiple filtering steps .. not so much.

poisondeathray
6th February 2017, 16:05
Hi...actually i am using heavy filter which encode @<1 fps. THat coupled with 2 pass encode means that for encoding one movie machine should be running for a week. therefore i wanted to apply the filter step by step. one such filter also require input as RGBs. Hope I have clarified why it need to be converted to raw format.

Thanks


But that doesn't necessarily require "RAW" headerless 8bit RGB - there are other RGB formats you could have used (uncompressed RGB, losslessly compressed RGB such as lagarith, utvideo, ffv1) such that you wouldn't need any special source filters or treatment in other programs, and the filesize would be roughly 1/2 or less


But to answer the questions, the documentation tells you about framerates in the options

https://github.com/chikuzen/vsrawsource

(hint...fpsnum=24000,fpsden=1001)

(But if you were coming from a DVD, you'd need to IVTC to get 23.976 fps before the "RAW" RGB )



To use vspipe for RGB24 to something like ffmpeg , there used to be 2 ways . It might have changed in newer vpy versions, but both these solutions by jackoneill worked for me a while back when piping 8bit RGB

http://forum.doom9.org/showthread.php?p=1756549#post1756549

I verified that the output was indeed lossless from a raw RGB input with other methods (avisynth rawsource, difference testing) . I didn't test speed, but he said the 2nd method was slower

Jindadil007
6th February 2017, 17:49
Hi...Many Thanks for a detailed explanation...I'll test and revert in case I need further help...

feisty2
7th February 2017, 09:47
but splitting up into multiple filtering steps .. not so much.

no no no no no no no, it DOES make sense!!

if you do v-bm3d(vbasic + vfinal) within one script, you'll find yourself running out of memory even before the first frame gets processed, and the problem could simply be solved by separating vbasic and vfinal into 2 scripts and creating an intermediate raw file for vbasic