View Full Version : avisynth scripts as avidemux2 video filter in Linux
fahr
2nd December 2008, 22:26
Hello!
I'm write external video filter for avidemux2 for Linux. This filter is used for load avisynth script as native avidemux2 video filter. Filter supports external binary Windows dll in avisynth script (thanks wine), several AvsFilter instance with different avisynth script and many other features.
Filter, description, sources, usage tips and tutorial here:
http://avsfilter.berlios.de/index.html
Thanks,
fahr
sl1pkn07
3rd December 2008, 07:32
uoho!!
great work!
disturbed1
3rd December 2008, 13:42
Cool. But, what if any advantage over the included and built in avsproxy that already comes with Avidemux?
http://img366.imageshack.us/img366/4631/avidemuxwg0.th.png (http://img366.imageshack.us/my.php?image=avidemuxwg0.png)
fahr
3rd December 2008, 23:19
Cool. But, what if any advantage over the included and built in avsproxy that already comes with Avidemux?
1. You use native avidemux2 parser for videofiles instead ffdshow/xvid/other windows codecs/container parser under wine
2. You use avisynth script in depth of videofilters of avidemux2 (after equalizer or other prefiltering).
3. You can use several scripts in any point between avidemux2 filters. Each script work independently.
4. Do not need restart avidemux2 if you change avisynth script, simple store script with other filename and change avsfilter scriptname parameter in avidemux2 filter list.
5. You can use several avidemux2 with various avisynth scripts for video processing simultaneously.
6. Avidemux2 sheduler(joblist) work normally (project file contain avsfilter parameters), but if you use avsproxy, we cannot work with differents input video and need to start avsproxy before start avidemux2.
7. To work with video, we could open it with avidemux2 and add avisynth script (with avsfilter) at any stage of video processing. If you use avsproxy, we should be open video with proxy before edit or any other stage of video processing.
If all video processing work only in avisynth script, then no advantages over avsproxy.
defaulk9
19th January 2009, 05:56
Your instructions say to patch sources using "patch.prefs.in", but I don't see that in the download. Did you forget to add it?
defaulk9
19th January 2009, 07:05
I went on ahead and just removed the -DPREFSINCHANGE and did it that way. It doesn't work though. I go to add AvsFilter to the Active Filters list, fill in the information and click OK. It never gets added.
This is what I get in the console when attempting to add:
01:01:49 Create AVSfilter
01:01:49 avsfilter : before dialog init
01:01:56 avsfilter : configure before SetParameters
01:01:56 avsfilter : SetParameters try to start new loader and script
01:01:56 avsfilter : good tmpdirname /home/dan/.wine/dosdevices/c:/windows/temp/
01:01:56 avsfilter : precreate thread time Mon Jan 19 01:01:56 2009
01:01:56 avsfilter : new.flags 1, old.flags 0
01:01:56 avsfilter : preopen time Mon Jan 19 01:01:56 2009
01:01:56 avsfilter : try to open /home/dan/.wine/dosdevices/c:/windows/temp/plr7f.tmp fifo
01:01:56 avsfilter : new.flags 0, old.flags 1
01:01:56 avsfilter : new.flags 0, old.flags 1
01:01:56 avsfilter : pthread time Mon Jan 19 01:01:56 2009
01:01:56 pthread start ok
avsloader : Mon Jan 19 01:01:56 2009
C:\windows\temp\plr7f.tmp C:\windows\temp\plw7f.tmp C:\windows\temp\pfw7f.tmp
01:01:57 avsloader : pipe_timeout is 10, pipe handles 01:01:57 3 01:01:57 4
01:01:57 avsload : start load source filter dll and test filter pipe
01:01:57 avsfilter : try to open /home/dan/.wine/dosdevices/c:/windows/temp/plw7f.tmp fifo
01:01:57 avsfilter : try to open /home/dan/.wine/dosdevices/c:/windows/temp/pfw7f.tmp fifo
01:01:57 failed to load pipe_source.dll
01:01:57 avsload : cannot call SetPipeHandle
01:01:57 avsload : try exit
01:01:57 avsload : really exit
01:01:57 End parse
01:01:57 avsfilter : loader down, try to close waiting (for open) main thread
01:01:57 avsfilter : try to open /home/dan/.wine/dosdevices/c:/windows/temp/plr7f.tmp fifo
01:01:57 avsfilter : try to open /home/dan/.wine/dosdevices/c:/windows/temp/plw7f.tmp fifo
01:01:57 avsfilter : try to open /home/dan/.wine/dosdevices/c:/windows/temp/pfw7f.tmp fifo
01:01:57 all pipes open ok
01:01:57 open_pipes failed
01:01:57 avsfilter : deinit_pipe 50FEFB0
01:01:57 avsfilter : deinit_pipe /home/dan/.wine/dosdevices/c:/windows/temp/plr7f.tmp
01:01:57 avsfilter : deinit_pipe 5BB39C0
01:01:57 avsfilter : deinit_pipe /home/dan/.wine/dosdevices/c:/windows/temp/plw7f.tmp
01:01:57 avsfilter : deinit_pipe 5BD0820
01:01:57 avsfilter : deinit_pipe /home/dan/.wine/dosdevices/c:/windows/temp/pfw7f.tmp
01:01:57 avsfilter : delete AVSFilter
01:01:57 avsfilter : partially UNLOAD check-> 0 0
01:01:57 all pipes open ok
01:01:57 avsfilter : open ok, try to deinit
01:01:57 avsfilter : deinit done
fahr
22nd January 2009, 00:35
Your instructions say to patch sources using "patch.prefs.in", but I don't see that in the download. Did you forget to add it?
http://avsfilter.berlios.de/src/patch.prefs.in
sorry, I'm forget add it to archive
fahr
22nd January 2009, 00:40
01:01:57 failed to load pipe_source.dll
01:01:57 avsload : cannot call SetPipeHandle
Your script is not contain string
LoadPlugin ("pipe_source.dll")
OR
pipe_source.dll is not find inside call LoadLibrary()
What path for pipe_source.dll?
Try store pipe_source.dll to script directory.
defaulk9
22nd January 2009, 10:39
That put me on the right track. My path to avsload.exe had spaces in it, so I had to quote it. Just the opposite with the path to the script. That seemed to want an unquoted path.
Thanks for the assistance. And thanks for the patch too. I'll try it out.
One other question: is there a way to reload the script without having to restart avidemux? I seem to have to restart every time I change it in order for the changes to take effect.
Thanks again.
fahr
22nd January 2009, 15:35
One other question: is there a way to reload the script without having to restart avidemux? I seem to have to restart every time I change it in order for the changes to take effect.
You may save script with other filename and change filename in filter properties. No need to restart, but in future, I planned some improvement for this happened. Unfortunately, reload script after each filterobject creation get many processing time.
What binary filters(dll's) you use with avsfilter?
defaulk9
22nd January 2009, 18:22
You may save script with other filename and change filename in filter properties. No need to restart, but in future, I planned some improvement for this happened. Unfortunately, reload script after each filterobject creation get many processing time.
I thought about that. The only solution I can think of is to first test if a significant amount of time has passed since the processing of the last frame (I'm unfamiliar with avidemux's filter API, so that may be off base), and if the time interval is large enough, do a check against the script's file date, and finally if that has changed, reload.
What binary filters(dll's) you use with avsfilter?
I don't have a set list. Currently I'm doing some film restoration, so I'm using deflicker and a conditional temporal median filter and trying out some others as well. I'm experimenting with different plugins and approaches here, so that's why the reloading helps.
fahr
2nd February 2009, 22:38
One other question: is there a way to reload the script without having to restart avidemux? I seem to have to restart every time I change it in order for the changes to take effect.
I implemented script change feat:
============================================
In this version, avsfilter checked timestamp of script. If timestamp of script change, avsfilter reload fresh script to avisynth. For use this feature, you can remove avsfilter from videofilter list, change script and reload avsfilter again to videofilter list with the same script name. No need to rename script and reload them with changed filename.
=============================================
fahr
3rd March 2009, 22:54
04 March 2009
Fixed serious bug in the time of encode frames span(A - B in avidemux2). At the moment of processing frame with number > (B - A), frame replace by frame 0. All following frames also replace by frame 0. This is no happens, if you encode whole input video.
05 March 2009
Stupid (but serious) bug was fixed. These bug inserted by 04 March of 2009. Under processing video with complex binary avisynth filter (like fft3dfilter), several frames need to render one frame. This bug (before it fixed) breaks normal frame sequence. Version 0.4a is out.
Update linux/wine sources
http://avsfilter.berlios.de/src/filter.src.05.03.2009.tar.bz2
and wine binaries (who not compile it from sources)
http://avsfilter.berlios.de/src/avsload_pipe_binary.tar.bz2
fahr
17th April 2009, 23:09
18 Apr 2009
Update compile and build docs, add FAQ for use .avs with VDF-filters from Donald's Graft VirtualDub. Add example script what is load external VDF-filter (_VD_Logo) in .avs script for use with avidemix2. Fix error with span start/end framenumber for preview mode. This error is show only in framenumber-specific filters (like ShowFrameNumber()). Update linux sources
shevegen
23rd April 2009, 19:05
Can this link be added to avisynth homepage (the wiki)?
I think not everyone reads this forum here, although of course this forum is the biggest I know of :)
I think I am here since 6 years hehe
Wilbert
23rd April 2009, 21:10
Can this link be added to avisynth homepage (the wiki)?
Yes of course. It would be nice if there would be a section about AviSynth & Wine and stuff like this. The problem is that i never have used Wine, so i'm not the most suitable person to write something about this. Could you volunteer to write such a section?
17 May 2009
Version is 0.5a. Fix other error with span start/end framenumber for encode and preview mode. Update linux sources
http://avsfilter.berlios.de/src/filter.src.17.05.2009.tar.bz2
and wine binaries
http://avsfilter.berlios.de/src/avsload_pipe_binary.tar.bz2
sl1pkn07
22nd June 2009, 21:02
hello. is possible compiling this filter for QT avidemux version?
this filter only appears in GTK version, no in QT version
thanks
fahr
29th June 2009, 21:33
hello. is possible compiling this filter for QT avidemux version?
this filter only appears in GTK version, no in QT version
thanks
Hello!
This filter not intended for avidemux GTK version only, but this happen is not checked. You can compile and it is difficult, write me (fahr at inbox dot ru).
In avsfilter no any GTK parts, no interface part. In fact, avsfilter is skeleton of avidemux video filter (with some code for start loader in wine environment, pipe read/write and other smallest helpers/routines).
Bye
sl1pkn07
29th June 2009, 23:32
hi!
the plugins not compile in the latest Avidemux 2.5
greetings
fahr
30th June 2009, 16:15
hi!
the plugins not compile in the latest Avidemux 2.5
greetings
avsfilter compile in Linux, is not use any avisynth parts.
avisynth sources is used to compile pipe_source.dll and avsload.exe
You compile pipe_source.dll and avsload.exe?
Latest version of avisynth, what I tested - is 2.57
Send me compiling instruction and error log (to email or in this forum thread).
sl1pkn07
30th June 2009, 23:23
no, not compile the avidemux part (filter or plugin for avidemux (avsfilter.so)
i'm use avsload.exe/pipe_source.dll binary, and avsfilter source
the log is this
no, not compile the avidemux part (filter or plugin for avidemux (avsfilter.so)
i'm use avsload.exe/pipe_source.dll binary, and avsfilter source
the log is this
Cannot read your error.txt file because attachments is not clickable. Resend again (and check download) or send to my email
sl1pkn07
1st July 2009, 13:52
http://pastebin.com/m1b822dbb
http://pastebin.com/m1b822dbb
Okay, latest checked avidemux version is 2.4.4 Sources tree and filenames is changed.
Sources for compile filter with 2.5.0 coming soon. I'm annonced these version here.
fahr
14th July 2009, 16:19
http://pastebin.com/m1b822dbb
I'm overcome compiling issue with avidemux 2.5
New version is posted here
http://avsfilter.berlios.de/src/filter.src.14.07.2009.tar.bz2
Nothing changes, only compile fix. To make use "Makefile.2.5" instead "Makefile" :
make -f Makefile.2.5
You also make changes in "Makefile.2.5" likewise "Makefile"
In the last time I'm optimize avsfilter to decrease filter CPU/resources payload at the starttime. I'm posted new version (0.6a) at the nearest time.
mean
14th July 2009, 21:18
I've merged the prefs change so that it should work with stock avidemux from now on (i.e. > 2.5.0)
fahr
15th July 2009, 09:20
I've merged the prefs change so that it should work with stock avidemux from now on (i.e. > 2.5.0)
Send me (or post here), corrected prefs.in
lych_necross
16th July 2009, 08:05
Please post it here.
Dinominant
24th July 2009, 03:33
Hello fahr, is it possible to use PipeSource() in an AviSynth script to read from a fifo instead of a typical file? It would be a very handy plugin for AviSynth as I havn't found any way of reading from a fifo.
Ultimately I would like to dump some content with mencoder into a fifo.
Then use avs2yuv.exe to open an AviSynth script to process the content and pipe the result to another instance of mencoder.
Example AVS file "fancy-filters.avs":
PipeSource("myfifo")
SomeFancyFilters()
Command sequence:
mkfifo myfifo
mencoder -dvd-device Babylon5.iso dvd://1 -nosound -ovc raw -of raw -o myfifo &
wine avs2yuv.exe fancy-filters.avs - | mencoder ...
This way I could use avisynth and mencoder to encode VFR material without having to create any large (multi-gigabyte) temporary files.
Dinominant
24th July 2009, 03:36
It played around a little with avsload.exe but was unable to read/write to the fifo's it created:
$ wine avsload.exe video.vfr.avs
/home/dinominant/.wine/dosdevices/c:/windows/temp/
/home/dinominant/.wine/dosdevices/c:/windows/temp/plr2e.tmp
/home/dinominant/.wine/dosdevices/c:/windows/temp/plw2e.tmp
/home/dinominant/.wine/dosdevices/c:/windows/temp/pfw2e.tmp
avsloader : Thu Jul 23 20:06:46 2009
C:\windows\temp\plr2e.tmp C:\windows\temp\plw2e.tmp C:\windows\temp\pfw2e.tmp
20:06:47 avsloader : pipe_timeout is 10, pipe handles 20:06:47 3 20:06:47 4
20:06:47 avsload : start load source filter dll and test filter pipe
20:06:47 pipe_source : pipe name C:\windows\temp\pfw2e.tmp, pipe_timeout is 10
20:06:47 pipe_source : try read 1
20:06:48 pipe_source : try read 2
20:06:48 pipe_source : try read 3
20:06:49 pipe_source : try read 4
20:06:49 pipe_source : try read 5
20:06:50 pipe_source : try read 6
20:06:50 pipe_source : try read 7
20:06:51 pipe_source : try read 8
20:06:51 pipe_source : try read 9
20:06:52 pipe_source : try read 10
20:06:52 pipe_source : try read 11
20:06:53 pipe_source : try read 12
20:06:53 pipe_source : try read 13
20:06:54 pipe_source : try read 14
20:06:54 pipe_source : try read 15
20:06:55 pipe_source : try read 16
20:06:55 pipe_source : try read 17
20:06:56 pipe_source : try read 18
20:06:56 pipe_source : try read 19
20:06:57 pipe_source : try read 20
20:06:57 pipe_source : cannot read test data - read 0
20:06:57 avsload : cannot call SetPipeHandle
20:06:57 avsload : try exit
20:06:57 avsload : really exit
sl1pkn07
24th July 2009, 20:35
not works on 2.5 final (and 2.5 SVN)
http://pastebin.com/m6ae3ebd0
fahr
28th July 2009, 22:54
Hello fahr, is it possible to use PipeSource() in an AviSynth script to read from a fifo instead of a typical file?
This pseudofilter is not work without avsfilter core. Pipe_source.dll interact with avsfilter.so through pipe (it send-receive picture info and other avisynth-avidemux specific infos).
It would be a very handy plugin for AviSynth as I havn't found any way of reading from a fifo.
Ultimately I would like to dump some content with mencoder into a fifo.
Then use avs2yuv.exe to open an AviSynth script to process the content and pipe the result to another instance of mencoder.
This line (with pipe)
# wine avs2yuv.exe subtitle1.avs - | mencoder - -o hfyu.avi -demuxer y4m -ovc lavc
work perfectly
Subtitle1.avs is
BlankClip(length=500,width=720,height=576,color=$000000,pixel_type="RGB24").ConvertToYV12().Subtitle("Avisynth#1",size=32,text_color=$ff0000)
Bye
fahr
28th July 2009, 22:56
not works on 2.5 final (and 2.5 SVN)
http://pastebin.com/m6ae3ebd0
You use
make -f Makefile.2.5
and sources from
http://avsfilter.berlios.de/src/filter.src.14.07.2009.tar.bz2
?
sl1pkn07
29th July 2009, 07:33
You use
make -f Makefile.2.5
and sources from
http://avsfilter.berlios.de/src/filter.src.14.07.2009.tar.bz2
?
yes, i'm use this link and the avidemux 2.5 (official and SVN, but both failed)
fahr
29th July 2009, 14:43
yes, i'm use this link and the avidemux 2.5 (official and SVN, but both failed)
Sorry, I'm forget replace avsfilter.cpp
Get corrected version from here:
http://avsfilter.berlios.de/src/filter.src.29.07.2009.tar.bz2
Bye
fahr
20th December 2009, 13:19
20 Dec 2009
Version is 0.6a. Many changes. Adopted sources to avidemux version 2.5.1 (previous version also supported). Improvement of performance, optimize memory usage and wine-worked threads. Update all docs, linux/wine sources (http://avsfilter.berlios.de/src/filter.src.20.12.2009.tar.bz2) and wine binaries (http://avsfilter.berlios.de/src/avsload_pipe_binary.tar.bz2).
fahr
7th February 2010, 22:20
7 Feb 2010
Version is 0.7a (linux sources (http://avsfilter.berlios.de/src/filter.src.07.02.2010.tar.bz2)). Fixed serious bug with first (sic!) start of filter without filter parameter in ~/.avidemux/config file (what stored after success load filter/loader/script). Some people report me about successful tested (gorgerous mega) avisynth cleaner such as MCTemporalDenoise (http://avisynth.org/mediawiki/MCTemporalDenoise) with avsfilter/avidemux under Linux. It is good news
sl1pkn07
10th April 2010, 20:46
oks. working well on 2.5.2.
is possible writting plugin in QT? for QT GUI
thanks
oks. working well on 2.5.2.
is possible writting plugin in QT? for QT GUI
thanks
It work as well, as gtk version.
DarkZell666
4th May 2010, 16:21
Wow, this looks great ! Is there any reason you didn't post it in the official avidemux forum (http://avidemux.org/admForum/) ?
How much extra work would it take to make a windows-compatible version of your plugin (not necessarily by you) ?
Wow, this looks great ! Is there any reason you didn't post it in the official avidemux forum (http://avidemux.org/admForum/) ?
This news already annonced in avidemux forum in sticky theme Using avisynth filters with avidemux and linux (http://avidemux.org/admForum/viewtopic.php?id=7416)
How much extra work would it take to make a windows-compatible version of your plugin (not necessarily by you) ?
This is not complex, but you - first man, who is interested by this feature. In fact, need to fix some compile and add some windows-specific code, but I'm still not sure, that this feature for many people is needed. Source of filter is not linux-specific, several part of code compile by MSVC.
In future, I'm planned to integrate this filter in avidemux filter core and compile it as part avidemux src (without wine sources, who compile with msvc compiler). At this stage filter sources may be fix to work in windows.
DarkZell666
6th May 2010, 12:00
Oh right, thanks ;)
The feature is great since avidemux doesn't have too powerful denoising filters at the moment, and I don't know how complicated it is to port avisynth filters to avidemux.
From build r6197 avsfilter is a part of avidemux sources and you can compile avidemux with avsfilter. Sources and precompiled binary dll/loader stored in addons/avsfilter of avidemux source tree. Alternative forum (http://avidemux.org/admForum/viewtopic.php?id=7100) about avsfilter(with script samples and my answer). FAQ update.
fahr
10th November 2010, 11:36
Release version 0.8a, get it together with avidemux SVN (http://www.avidemux.org/admWiki/doku.php?id=build:compiling_avidemux#general_compilation_instructions). Add wine pathname to dialog filter. Messages (debug/info/error) are colored with different colors.
After install avidemux2, "libADM_vf_avsfilter.so" is stored to "/usr/lib/ADM_plugins/videoFilter" and "avsload.exe", "pipe_source.dll" in "/usr/share/ADM_addons/avsfilter". Filter dialog (if filter is previously not configured) is tuned to default after install (path to avsload.exe).
sl1pkn07
11th November 2010, 04:21
thanks man!
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.