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. |
14th January 2017, 20:05 | #1 | Link |
Registered User
Join Date: Jan 2017
Posts: 5
|
Applying HLSL Shaders To Video With Avisynth?
I have read that avisynth can do the following:
1. Load a video. 2. Apply an HLSL shader to the video frames. 3. Save the video. This plugin down below is supposed to make this possible: https://github.com/mysteryx93/AviSynthShader I have never used avisynth before, so I'm a bit lost. Can anyone tell me how to do this? I need an example script that tells Avisynth to: 1. Load video 2. Apply HLSL shader(s) 3. Save result Also, is there any another software that can apply HLSL shaders to video frames and save the result to a video file? Thank you all very much! |
15th January 2017, 06:38 | #3 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,019
|
FFMpegSource2("yourvideo.mkv" fpsnum=24000, fpsden=1001, atrack=-1)
Converttoyv12() SuperRes(Input, Passes=1, Str=1, Soft=0, Upscale="""nnedi3_rpow2(2, cshift="Spline16Resize")""", lsb_upscale=false, PlanarOut=true, MatrixIn="Rec709", MatrixOut="Rec709", fWidth=1920, fHeight=1080) _________________ That is the avs. Basically you use an indexer like ffms2 to open both audio and video and then you filter it using the plugin you posted about. Please note that you need the plugin to be in your plugins folder and/or to load it and its dependencies when you call it. Then, just download virtual dub and drop the avs in that program; you will see the result of the avs and you will be able to encode it. |
15th January 2017, 10:09 | #5 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,405
|
Looking at AvisynthShader page:
Assuming you installed Avisynth and placed the AvisynthShader and the FFmpegSource plugin inside the plugins folder: Code:
ConvertToShader(1) FFMpegSource2("yourvideo.mkv") Shader("bloom.hlsl", Output=2) Shader("sharpen.hlsl", Output=3) Shader("anglecorrect.hlsl", Clip1=2, Clip2=3, Output=1) ShaderExecute(last, Input, Clip1Precision=1, Precision=3, OutputPrecision=1) ConvertFromShader(1) -> you might want to get accustomed with Avisynth in general and start with the link TheFluff posted to understand the whole thing,.. |
15th January 2017, 21:21 | #7 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,706
|
You not only posted this same exact thing at VideoHelp, which is OK, but now you've cross posted this exact same thing elsewhere in this forum (in the General section). That is against the rules of this forum. You should delete that other post.
|
16th January 2017, 00:53 | #8 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,019
|
@pixel... I used SuperRes because it was the first function of the Shader.avsi you linked (I was in a hurry as I had to go to work; morning shift, sadly). Anyway, using HLSL it's pretty much the same as Selur wrote.
|
16th January 2017, 17:54 | #9 | Link |
Registered User
Join Date: Jan 2017
Posts: 5
|
@JohnMeyer
An inventor has brought us a video-processing prototype which is basically 4 custom-developed HLSL shaders that run in realtime inside Media Player Classic. The results are great in MPC, but we need to find a way to process 20 - 30 test videos a day with this, and SAVE the result to a pixel-accurate video file each time. This Avisynth plugin seems to be the only technology that can do this. I'm trying very hard to get Avisynth/Shader Plugin/Virtualdub to work together, but I'm completely new to Avisynth. So please have some patience with me. =) |
16th January 2017, 18:04 | #10 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,706
|
You completely misunderstood my post: I was simply trying to help you to avoid violating the rules of this forum so that one or both of your threads don't get closed. I was not being "inpatient" with you.
|
Tags |
avisynth, hlsl, script, shader |
Thread Tools | Search this Thread |
Display Modes | |
|
|