avsfilter : how to use, question and so on

Started by fahr, January 24, 2017, 10:27:55 AM

Previous topic - Next topic

fahr

Hello!
I would like in this topic to place the materials that were once posted on the Berlioz few time ago(with corrections by changes in current version of avidemux). I would also able to answer on questions that arise when using the filter.

What is avsfilter?
It is external video filter for avidemux in Linux. Is used for load avisynth script as native avidemux video filter. Filter supports external binary Windows dll in avisynth script (thanks wine), several AvsFilter instance with different avisynth script and many other features.

fahr

#1
Initialize stage

At the stage of video filter initialization, each copy of avsfilter start wine separately with corresponding arguments - path/filename to avsload.exe and script name. Avsload.exe is being started by wine, gets wine path to temporary filenames and generates temporary pipe names. Pipe pathnames are printed to stdout. Avsfilter reads this names, converts wine-like pathnames to Linux-like pathnames, creates fifo's and opens pipe's. Avsload.exe loads avisynth.dll, pipe_source.dll and sends script name to avisynth.dll. Avsfilter sends clip parameters to pipe_source.dll and reads output clip parameters from avisynth.dll/avsload.exe.

Work stage

Avsfilter (function getFrameNumberNoAlloc) sends command (via communication pipe) to avsload.exe for getting filtered frame, avsload.exe calls avisynth.dll for getting filtered frame. Pipe_source.dll calls avsfilter for getting source frame (or several frames in the case temporal denoiser/framerate convertor/etc). Avisynth.dll makes frame from filters chain and returns them to avsload.exe Avsload.exe returns frame to avsfilter.

Script modify note

Each avisynth script must be used PipeSorce() instead of AVISource()/MpegSource() etc. It needs for getting frame data from avidemux2/avsfilter to avisynth script entity. You can use several alternate video sources in script with various combination, but use PipeSource() is important. Each alternate video sources must be free from audio part (use AVISource().KillAudio() etc) because AvsFilter is Video Filter. PipeSource() not contain audio part.

Multisource note

Each avisynth script allows to use multiple sources, such as PipeSource() (main avidemux2 stream, which loaded), AVISource(), MPEGSource(), BlankClip(), MessageClip() and so on, load directly from script (these sources need installed directshow codecs, such as ffdshow.exe). Important!!! In one avisynth script may be only one PipeSource()!

fahr

Requirements to work

fahr

#3
First two filters
Create empty avs script:


LoadPlugin ("pipe_source.dll")
PipeSource()


Start avidemux and load video, than add filter as in screenshot below (load empty.avs to filter and press "Ok"):

Set view mode to "Output" (or set checkbox "Play filtered" in newest versions) and start play. Source clip should be view. Check play mode, seek on clip to begin/end and so on.

Create following script :


LoadPlugin ("pipe_source.dll")
PipeSource().TurnLeft()


Save it to the other script file and load file to new avsfilter. Source clip is rotate to Left side.

lamky

Hello,

I have problems with avsload.exe
I tried the following, but got error:

wine /usr/share/ADM6_addons/avsfilter/avsload.exe test.avs
002f:err:seh:setup_exception_record stack overflow 928 bytes in thread 002f eip 7bc45056 esp 00230f90 stack 0x230000-0x231000-0x330000

I already posted similar question on Avidemux forum, but there is no reply:
http://avidemux.org/smif/index.php/topic,18112.0.html

Where can I download avsload.exe and pipe_source.dll sources.
I will try to debug myself, because it seems there is little interest in avsfilter.

Thank you