News:

--

Main Menu

AviDemux/VapourSynth

Started by yami, March 30, 2015, 09:11:25 AM

Previous topic - Next topic

yami

I know, this is a bit... a lot XD. But maybe, it is worth a thought, maybe an even an inspiration for future developments of AviDemux.
Mean and everyone involved - did you ever think about the possibilities of adding an intersection or module that can communicate and interact with a preinstalled VapourSynth in Avidemux?  I could guess that this is a bit difficult as VS is framebased, AviDemux by now timebased. But honestly, if AviDemux could use the filters there (even if only scripting based) and be used as some kind of GUI for display (besides what AviDemux can already do on its own) as advanced option ... it would be the killer ^^

YAFU

We are using scripts with combination of plugins in VapourSynth to reduce noise in Blender/Cycles renders:
http://blenderartists.org/forum/showthread.php?378736-Cycles-noise-reduction-with-VapourSynth

It's amazing how good are these filters to reduce noise. It really would be great if we could load these VapourSynth scripts in Avidemux.

mean

It should not be too complicated to do
(This is Not a promise)

mean

There is a small vsProxy preliminary test program
It is similar to avsProxy :
* Install VapourSynth (linux only at the moment)
* export PYTHONPATH=/usr/lib/python3.4/site-packages/   (3.5 if you use python 3.5) <<<= This is important, else you might get Cannot setup vapoursynth or similar
* ./vsProxy  blahblah.py (the file must have a .py extension for now)
* Avidemux -> connect to avsProxy

This is the test script i'm using, it 's just a black frame

import vapoursynth as vs
# get the core instance
core = vs.get_core()
clip = core.std.BlankClip(format=vs.YUV420P8)
# flip the video a bit
ret = core.std.Transpose(clip)
# set the clip to be output
ret.set_output()


Be sure to have the commit from monday morning , else you'll have a green video

AQUAR

Interesting topic.

I use Avisynth/ADM on windows but wouldn't mind trying the more modern Vapoursynth/ADM on windows.


mean

VS is multiplatform, so it's easier for me do developp around it
On the other hand, it seems pulling the whole python stuff is creating internal symbol clash, that's why it's not opened directly by avidemux but through a proxy

YAFU

Hi mean.
For Ubuntu users you can install VapourSynth and plugins from this PPA:
https://launchpad.net/~djcj/+archive/ubuntu/vapoursynth

I've tried vsProxy and it is working with this script that you have posted.
What is possible to do for now with vsProxy? I never used avsProxy, so I do not know much about it. Is it possible to load videos? Does the video to be loaded must be specified into the script?

mean

Basically, you write your vapoursynth script i.e. foo.py
start
vsProxy foo.py
And then it can be processed by avidemux (File->Connect to proxy), as if loaded directly by it

YAFU

Ok, but for example I use KNLMeansCL to reduce noise with OpenCL/GPU:
https://github.com/Khanattila/KNLMeansCL/releases
with this script:
import vapoursynth as vs
core = vs.get_core()
##
##ffmpeg with ffms2
clp = core.ffms2.Source(source='/PATH_TO_VIDEO_HERE/input.mp4')
##

clp = core.knlm.KNLMeansCL(clp, d=3, a=2, s=4, h=4.2, device_type="GPU")
clp.set_output ()

If I run:
./vsProxy script.py
I get:
$ ./vsProxy script.py
[run]  Opening script.py as VapourSynth file
  [run]  VapourSynth init ok, opening file..
  [run]  Format    : YUV444P8
  [run]  FrameRate : 24 / 1
  [run]  Width     : 1280
  [run]  Height    : 720
  [run]  Frames    : 200
  [run]  Flags     : 0x3
  [fillInfo]  Format    : YUV444P8
  [fillInfo]  FrameRate : 24 / 1
  [fillInfo]  Width     : 1280
  [fillInfo]  Height    : 720
  [fillInfo]  Frames    : 200
  [fillInfo]  Flags     : 0x3
Only YUV420P8 supported!
Unsupported settings in script files
Failure


I really do not know if the video should be loaded from the script, or from avidemux.

mean

you need to  convert to yuv420 (planar , 8 bits)

AQUAR

Thanks mean - I see there is already a win64 binary for vsproxy.

mean

Not complete yet, will not work
The socket initialization is missing

mean

64bits windows attached

* Important *
1- unzip the nightly 7zip file, dont use the installer
2- Copy the vsProxy.exe in the same folder as avidemux.exe
3- If it fails, wait a bit (3 mn) before retrying

This is still work in progress....

YAFU

This is really hard when one does not know about programming/scripting and not know about video technical aspects...
However, looking at other scrips I have done this:
import vapoursynth as vs
core = vs.get_core()
##
##ffmpeg with ffms2
src = core.ffms2.Source(source='/PATH_TO_VIDEO_HERE/input.mp4')
##
input = core.fmtc.matrix(clip=src, mat="601", col_fam=vs.RGB)

YUV = core.fmtc.matrix(clip=input, mat="601", col_fam=vs.YUV)
YUV = core.fmtc.resample(clip=YUV, css="420")
YUV = core.fmtc.bitdepth (clip=YUV, bits=8)

clip = core.knlm.KNLMeansCL(YUV, d=3, a=2, s=4, h=4.2, device_type="GPU")

clip.set_output()


Avdiemux open the video correctly, but the colors are exchanged (red by blue, blue by red). I'm pretty sure I've done things wrong. Any hints on what the problem is?

mean

Probably a mistake from me
You can try the "Swap U & V " filter, it should make everything alright