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. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
AssRender: inappropriately named libass-based subtitles renderer
One fine day a friend of mine wanted to encode something with Avisynth under Wine, on Linux. It went fairly well until he wanted to render subtitles, because Ye Olde VSFilter doesn't work under Wine (too GDI-ish or something, idk).
This gave me an idea and after some false starts I succeeded in cross-compiling libass and its dependencies, and the result is this filter. It renders .asses, the end. EDIT: I do not maintain this plugin anymore; lachs0r has taken over development and convered it to a C plugin. See his posts at the bottom of this page and the new homepage at http://srsfckn.biz/assrender. The old OP follows below. Download AssRender 0.11 NOTE: the included fontconfig directory MUST be in the same folder as the .dll, or it'll crash! Note 2: loading something the first time can be pretty slow, especially if you have a lot of fonts installed, because fontconfig needs to cache all your system fonts. Source code (under MIT license, binaries are under GPL for obvious reasons): assrender_0.11-src.7z Syntax: Code:
assrender(clip c, string file, int "hinting"=2, float "scale"=1.0, string "charset"="UTF-8", int "loglevel"=-1, string "logfile"="")
Regarding hinting:
Advantages and disadvantages This filter should mainly have two advantages over VSFilter, namely: a) it works under wine, and b) it's probably a lot faster. On the other hand it has a few limitations, most notably it only supports RGB32 input so far. If someone is sitting on a fast (preferably assembly optimized) routine that can overlay RGBA on YV12/YUY2, feel free to speak up. Furthermore, libass isn't really bug-for-bug compatible with VSFilter, so it might render stuff a bit differently compared to what you're used to. Todo
Other stuff It's compiled against a fairly recent libass, this one unless I misremember. I know that technically I'm probably not GPL-compliant because I'm not distributing the source code of the exact versions of freetype/fontconfig/expat/zlib it's linked against (Debian Squeeze's versions including their patches as of three days ago, apt-get source if you want them), but you know, I really don't give a darn. If you want to compile the source code you need a working mingw32 environment. If you don't want to compile libass and its deps yourself (afaik it's incredibly hard to get libass to build on msys-mingw32 because of the permanent state of autotools hell it is in; personally I didn't bother and just crosscompiled on linux), you can get my compiles. Oh, and you need stdint.h for Visual Studio too just to make it even more annoying to compile. Last edited by Guest; 9th June 2012 at 00:11. Reason: rule 4 |
![]() |
![]() |
![]() |
#4 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,598
|
Quote:
If you for some reason want to implement it anyway do something like this in AvisynthPluginInit2: Code:
return new MyFilter(Env->Invoke("ConvertToRGB32", Args[0]), all other filter args go here));
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet Last edited by Myrsloik; 15th August 2009 at 20:54. |
|
![]() |
![]() |
![]() |
#5 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,437
|
Instead of constructor, I should have said the 'create' function that calls the constructor. In outline,
Code:
static AVSValue Create(AVSValue args, ...) { PClip child = args[0]; child = env->Invoke("ConvertToRGB32", child); PClip result = new MyFilter(child, ...); return env->Invoke("ConvertToXXX", result); } Whether you should do it or not is a separate issue. Last edited by Gavino; 15th August 2009 at 17:01. |
![]() |
![]() |
![]() |
#8 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
There wasn't much interest in this filter so I was like :effort: and never did anything with it. The MKV parsing should be fairly easy to implement actually, but it's of limited use as long as the filter can only be used on RGB32.
|
![]() |
![]() |
![]() |
#14 | Link | |
契約者
Join Date: Jun 2008
Posts: 1,576
|
Quote:
Well, I don't know where ffdshow's code came from and actually ffdshow seems to be faster. I do use it sometimes but unfortunately it still gives me some errors like text shown in wrong direction (already reported/confirmed), total corruption in some cases (reported/confirmed) or some characters misplaced a bit so they overlapping with other ones (not reported by me yet, but probably known) Last edited by Keiyakusha; 2nd June 2010 at 22:44. |
|
![]() |
![]() |
![]() |
#16 | Link | ||
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
Quote:
If you by SSA mean old SSA v4 (not v4+) I'm not sure if libass supports that. Try converting it to ASS, and if that doesn't work either post the script and I'll take a look. I'm not going to put a lot of effort into debugging it though since this filter is in limbo until I get around to it again and fix the rgb32 limitation. |
||
![]() |
![]() |
![]() |
#17 | Link |
eccentric
Join Date: Jan 2011
Posts: 24
|
So, a lot of things happened in the past few days.
Within two days, I had learned a bit of C and reimplemented AssRender as an Avisynth C Plugin, so it no longer required building with MSVC. Then, with my limited knowledge, I started working on Fluff’s TODO-list:
See the ChangeLog for further details. It’s available here: http://luck3r.phicode.de/assrender/ I’ll continue working on it, and maybe we’re also gonna see a working DirectShow transform filter this year so VSFilter can finally rest in peace. |
![]() |
![]() |
![]() |
#18 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
nice one.
it might be worth adding on your site that you need to call it with "load_stdcall_plugin"... if it's there and i missed it, i apologise. it's working with ssa now. i'm happy ![]()
__________________
sucking the life out of your videos since 2004 |
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: May 2006
Posts: 2
|
assrender is very, very fast. I'm impressed. With assrender now I can see softsubbed karaoke and typesetting on 720p videos without lagging on a C2D E2160 using GMA950 onboard video. I have some complex karaoke scripts with two thousand lines of code that now runs almost on realtime.
Questions: 1) Is it possible to make assrender even faster? 2) Is it possible to make Aegisub use assrender? Aegisub 2.18 only recognizes VSFilter and VSFilterMod. 3) I can't use assrender on Windows 7 64bit. Says "unable to load C plugin". Other C plugins, like Yadif, works. Is there a way to fix that? PS.: Sorry for my bad English. Last edited by rapier; 9th February 2011 at 18:41. |
![]() |
![]() |
![]() |
#20 | Link | |
eccentric
Join Date: Jan 2011
Posts: 24
|
Yes.
Quote:
Never bothered with 64-bit AviSynth, and at the moment I neither have a mingw-w64 toolchain nor a 64-bit Windows testing environment ready, and this won’t change until I have a better internet connection (this should only take a few weeks). |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|