Sunday, January 12, 2020

warping on Linux - filter on avisynth and virtualdub - OK

While exploring ffmpeg and the Remap filter for warping videos, noticed that this filter is not GPU optimized, it does not use OpenGL. So, if avisynth works on Linux, even the avisynth filter made for warping should do the job just as well.
http://www.avisynth.nl/users/vcmohan/Planetarium/Planetarium.html
http://www.avisynth.nl/users/vcmohan/index.html


For this, would need to get avisynth working on Linux under wine.

This link
https://forums.opensuse.org/showthread.php/429428-howto-install-virtualdub-under-wine-deshaker-plugin
gave hope for getting Virtualdub working under Wine.

In my case, I downloaded
VirtualDub-1.10.4,
ffdshow_beta7_rev3154_20091209.exe
(the latest one, ffdshow_rev4532_20140717_clsid did not work)
Installed winetricks with apt and mfc42 using winetricks
vcredist_x86.exe
Xvid-1.3.2-20110601 (Xvid-1.3.5-20171208 did not work)
installing ffdshow, the vcredist and xvid using
wine ffdshow_beta7_rev3154_20091209.exe
and so on. Mostly choosing the defaults. In my case, running the setup for vfw, video and audio after installing ffdshow, I ran into errors in the MS runtimes. But things seem to work anyway.

Avisynth works, except that DirectShowSource doesn't work, we need to use FfMpegSource.
Avisynth can be used with mencoder

and avs2yuv may be an easier way to do piping.
"There is no function called FFMS2" - found that I was running Avisynth 2.5, while the plugin was was Avisynth 2.6 - "This is not an avisynth 2.5 plugin".
Had to install older version, 2.1 of ffms2 - trying 2.18rc1 worked. Installation is by copying the dll to the plugins folder.
Syntax for old version is different from the latest version -
Loadplugin("/home/myusername/.wine/drive_c/Program Files/AviSynth 2.5/plugins/ffms2.dll")
FFvideosource("in.mp4")
If I make any changes to codec settings inside Virtualdub, then rendering crashes. Must close and open vdub again. Also, need to set DirectX rendering Off, otherwise does not proceed beyond the first few frames, and garbage is rendered. This is in VirtualDub Options -> Preferences



Also, vdub on Wine does not work as frameserver. 
My machine renders Xvid videos with simple profile, as needed by my BluRay player, at around 20 fps, and drops to 8 fps when using the avisynth warping filter Planetarium.dll. The rendering only works for me with the ffvfw MPEG-4 codec and not with the Xvid codec - probably some installation glitch. Settings for simple profile and high quality like the screenshot below.

Testing of avisynth scripts is easily done in Virtualdub. As in the link mentioned above, can explore mencoder and or other rendering options using pipes.

No comments:

Post a Comment