View Full Version : Is there a 64bit version of SubtitleEx?


JackBrody
10th February 2020, 14:00
I have installed Avisynth+ 3.4 along with ffms2.dll (for FFmpegSource2 - I work with AVC MP4 files), VirtualDub and MPC-HC, everything in 64bit on my Windows 7 SP1 x64. All this works smooth.

I'd like to use external filter SubtitleEx but I can only find 32bit library.

Is there a 64bit version available somewhere?

Or am I supposed to get back to 32bit Avisynth and everything?



PS: the same with KenBurnsEffect, only 32bit library available as well...

StainlessS
10th February 2020, 16:28
Most known x64 plugs here on wiki:- http://avisynth.nl/index.php/AviSynth%2B_x64_plugins
Zoom (req for KenBurns thingy) is last in list.

There are a few more x64 archives just below zoom at end of page.

johnmeyer
10th February 2020, 19:32
AVISynth 64-bit can't run 32-bit plugins? I never bothered to change to 64-bit (I hesitate to even call it an "upgrade") because I saw zero likelihood of any improvement. However, I'm not in any way berating the OP's decision to do so, and am only wondering if it is really true that when you go to the 64-bit version that you are totally cut off from using any 32-bit plugins.

I assume you can still use Groucho's AVISynth switcher to go back and forth (from 32- to 64-bit) if you can't get 32-bit plugins to work any other way.

Groucho2004
10th February 2020, 19:50
I'd like to use external filter SubtitleEx but I can only find 32bit library.

Is there a 64bit version available somewhere?My search returned nothing. Also, even with the wayback machine, no source to be found (even though the author made it available back in the day).

Groucho2004
10th February 2020, 19:52
AVISynth 64-bit can't run 32-bit plugins?No, it can't.

johnmeyer
10th February 2020, 20:18
No, it can't.Thanks for that clarification.

Reel.Deel
11th February 2020, 00:13
My search returned nothing. Also, even with the wayback machine, no source to be found (even though the author made it available back in the day).

I was also looking for a 64-bit version of this plugin some months ago. The source code for the original SubtitleEX is missing, however, there is source code for the updated SubtitleEx: http://hosiken.jp/dev/win/subtitleex.html

I hope someone can compile a 64-bit version :)

**Edit**
The author of SubtitleEx (kai) also had similar issues with the source code:
"Based on "SubTitleEx" created by Basilik Tournadski, which was released on a currently closed site called "mVideo Utilities", Japanese characters are garbled. In addition, a function to set the presence / absence of line breaks and line spacing has been added.

The source code of "SubTitleEx" has been released in the past, but it is not available now, and for some reason it is not left in the Internet Archive. Therefore, we created a plug-in with the same function as SubTitleEx based on DVTimeStampEx, a plug-in created by the same author that had the source code left in the Internet Archive, which happened to have the SubTitleEx character display engine."

Groucho2004
11th February 2020, 01:00
I was also looking for a 64-bit version of this plugin some months ago. The source code for the original SubtitleEX is missing, however, there is source code for the updated SubtitleEx: http://hosiken.jp/dev/win/subtitleex.html

I hope someone can compile a 64-bit version :)Good find. Here's (https://www.dropbox.com/s/jd6dzjurnb2ts3n/SubTitleEx64.7z?dl=1) a 64 bit test version. It seems to work fine but maybe someone else can give it a whirl.

wonkey_monkey
11th February 2020, 01:25
Presumably someone could, in theory, write some kind of inter-process-communicating gizmo that could feed clips between 64-bit and 32-bit instances of Avisynth? Doesn't something similar already exist for feeding 64-bit applications from 32-bit Avisynth?

qyot27
11th February 2020, 01:32
I assume you can still use Groucho's AVISynth switcher to go back and forth (from 32- to 64-bit) if you can't get 32-bit plugins to work any other way.
32-bit and 64-bit DLLs are installed at the same time (32-bit in SysWow64, 64-bit in System32), there's no need for any switching. Load up the regular 32-bit VirtualDub.exe, it sees the 32-bit version. Load VirtualDub64.exe, it sees the 64-bit.

It's not just a limitation of 64-bit AviSynth+ that it can't load 32-bit stuff. (https://docs.microsoft.com/en-us/windows/win32/winprog64/process-interoperability)

StainlessS
11th February 2020, 16:35
As Qyot27 said.
Is no prob to have side by side x86 / x64 Avs+, just call the required version of eg VDub2.
PS-Pad [EDIT: A text/script editor], is 32 bit, but can have set up to start 32 bit MPC-HC, or eg 64 bit PotPlayer, it only starts the process with supplied avs filename
and so works with either 32 or 64 bit players.

I had also found SubtitleEx mod with source yesterday but had to go out, I was gonna have a go at compile, but groucho beat me, thanx Grouchy.

Also, cant remember what its called, but I think you can run eg 32 bit script from x64 Avs+ using AvsPipeMod [or named something like that, I've never tried it].

Groucho2004
11th February 2020, 18:36
I had also found SubtitleEx mod with source yesterday but had to go out, I was gonna have a go at compileThere was some inline ASM in the source which I had to modify for x64. This works fine if you have a Intel C/C++ compiler but MSVC does not support inline ASM in x64. So, without the Intel compiler one would have to re-write that code to plain C/C++ or Intrinsics.

StainlessS
11th February 2020, 18:40
Ok, glad I did not have to attempt it, thanx.
TWriteAVI v2.0 has some assembler which I cannot convert to ASM/Intrinsics, I bet you could though :) [EDIT: Not that much really, think is in about 3 places, one place only a half dozen instructions]

EDIT: Not sure, I think Dogway recently wanted WAV output from Avs [think wanted from avs+ x64, x64 ver$ of TWriteAVI/TWriteWAV would have been able to do this].
SoundOut can output audio from Avs, but WAV file not available till some time later, TWriteWAV can be set to return on completion, so WAV available and usable on function return.

EDIT: TWriteAVI v2.0, https://forum.doom9.org/showthread.php?t=172837&highlight=TWriteAVI

EDIT: The problem ASSY stuff here:- https://forum.doom9.org/showthread.php?p=1847647#post1847647

Groucho2004
11th February 2020, 21:03
TWriteAVI v2.0 has some assembler which I cannot convert to ASM/Intrinsics, I bet you could though :)I'll have a look when I have a bit more time.

StainlessS
11th February 2020, 21:05
Mucho grouchyass

Groucho2004
11th February 2020, 21:47
Mucho grouchyassYour Spanish language skills are pretty much on par with Trump's command of the English language. :)

Groucho2004
12th February 2020, 11:36
Here's (https://www.dropbox.com/s/jd6dzjurnb2ts3n/SubTitleEx64.7z?dl=1) a 64 bit test version. It seems to work fine but maybe someone else can give it a whirl.No feedback from the OP so I guess it's working?

Stereodude
12th February 2020, 18:49
Presumably someone could, in theory, write some kind of inter-process-communicating gizmo that could feed clips between 64-bit and 32-bit instances of Avisynth? Doesn't something similar already exist for feeding 64-bit applications from 32-bit Avisynth?
It already exists. MP_Pipeline: https://forum.doom9.org/showthread.php?t=163281

StainlessS
12th February 2020, 19:21
It already exists. MP_Pipeline: https://forum.doom9.org/showthread.php?t=163281

Yep, thanx, thats what I mean below

Also, cant remember what its called, but I think you can run eg 32 bit script from x64 Avs+ using AvsPipeMod [or named something like that, I've never tried it].


EDIT: The binary in MP_Pipeline link is dead, click source link and then Releases for Binary.

Binary link message
Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine

Reel.Deel
12th February 2020, 20:19
Good find. Here's (https://www.dropbox.com/s/jd6dzjurnb2ts3n/SubTitleEx64.7z?dl=1) a 64 bit test version. It seems to work fine but maybe someone else can give it a whirl.

Thanks, I'll give it a try in the coming days.

StainlessS
12th February 2020, 20:56
Docs translation

Original [as in zip]

====================================
AVISynth —pƒvƒ‰ƒOƒCƒ“ SubTitleEx‰ü
====================================

ŠT—v
----

AVISynth —pƒvƒ‰ƒOƒCƒ“ SubTitleEx‰ü ‚Í�AAVISynth 2.5 —p‚̃eƒ�ƒbƒv•\ަƒvƒ‰ƒOƒCƒ“‚Å�A
AVISynth •W�€‚Ì SubTitle ‚æ‚葽�”‚Ì‹@”\Šg’£‚ª‚È‚³‚ê‚Ä‚¢‚Ü‚·�B

�umVideo Utilities�v‚Æ‚¢‚¤Œ»�݂͕Â�½‚³‚ê‚Ä‚¢‚éƒTƒCƒg‚ÅŒöŠJ‚³‚ê‚Ä‚¢‚½
Basilik Tournadski Ž��ì�¬‚Ì�uSubTitleEx�v‚ð‚à‚Æ‚É�A“ú–{Œê‚ª•¶Žš‰»‚¯‚·‚錻�Û‚ð
�C�³‚µ‚½‚à‚̂ł·�B‚Ü‚½�A‰ü�s‚Ì—L–³�A‚¨‚æ‚Ñ�sŠÔ‚ð�Ý’è‚Å‚«‚é‹@”\‚ð’ljÁ‚µ‚Ä‚¢‚Ü‚·�B

�uSubTitleEx�v‚Í‰ß‹Ž‚Éƒ\�[ƒXƒR�[ƒh‚ªŒöŠJ‚³‚ê‚Ä‚¢‚½‚̂ł·‚ªŒ»�݂ł͓üŽè‚Å‚«‚¸�A
‚½‚Ü‚½‚Ü Internet Archive ‚Ƀ\�[ƒXƒR�[ƒh‚ªŽc‚Á‚Ä‚¢‚½�A“¯�ìŽÒ‚É‚æ‚éƒvƒ‰ƒOƒCƒ“‚Å
SubTitleEx ‚Ì•¶Žš•\ަƒGƒ“ƒWƒ“‚ª‘g‚Ý�ž‚Ü‚ê‚Ä‚¢‚é�uDVTimeStampEx�v‚ð‚à‚Æ‚É�A
�uSubTitleEx�v‘Š“–‚Ì‹@”\‚ðŽ�‚Á‚½‚à‚Ì‚ð�ì�¬‚µ‚Ü‚µ‚½�B


Žg‚¢•û
------

AviSynth ‚ðƒCƒ“ƒXƒg�[ƒ‹‚µ‚½ƒtƒHƒ‹ƒ_‚Ì�uPlugin�vƒtƒHƒ‹ƒ_‚É�ASubtitleEx.dll ‚ð
ƒRƒs�[‚·‚邾‚¯‚ÅŽg—p‚ª‰Â”\‚ɂȂè‚Ü‚·�B

–{‰Æ SubtitleEx ‚Ì‹@”\‚Í‚·‚ׂĎÀ‘•‚³‚ê‚Ä‚¨‚è�Aˆê•”‚Ì�uƒ_ƒ�•¶Žš�v‚ªŠÜ‚Ü‚ê‚邯
•¶Žš‰»‚¯‚·‚é–â‘肪�C�³‚³‚ê‚Ä‚¢‚Ü‚·�B‚»‚ê‚ɉÁ‚¦‚Ä�ASubTitleEx‰ü‚ł͈ȉº‚Ì
ƒpƒ‰ƒ��[ƒ^‚ª’ljÁ‚³‚ê‚Ä‚¢‚Ü‚·�B

SubtitleEx(
string text,
int "x",
int "y",
int "firstframe",
int "lastframe",
string "font",
string "effects",
int "size",
int "textcolor",
int "halocolor"
int "linemargin"
int "spc"
)

�E –{‰Æ SubtitleEx ‚̃pƒ‰ƒ��[ƒ^

- text •\ަ‚·‚éƒeƒLƒXƒg�B‰ü�s‚·‚é�ê�‡‚»‚̉Ó�Š‚É�u | �v‚ð�‘‚«‚Ü‚·�B
- x •\ަ‚·‚é�À•W‚Å‚·�Bƒ}ƒCƒiƒX‚ðŽw’è‚·‚邯‰E‚©‚ç‚ɂȂè‚Ü‚·�B
- y •\ަ‚·‚é�À•W‚Å‚·�Bƒ}ƒCƒiƒX‚ðŽw’è‚·‚邯‰º‚©‚ç‚ɂȂè‚Ü‚·�B
- firstframe •\ަ‚·‚é�Å�‰‚̃tƒŒ�[ƒ€�”‚Å‚·�B
- lastframe •\ަ‚·‚é�ÅŒã‚̃tƒŒ�[ƒ€�”‚Å‚·�B
- font ƒtƒHƒ“ƒg–¼‚ðŽw’肵‚Ü‚·�B
- effects ƒGƒtƒFƒNƒg‚ðŽw’肵‚Ü‚·�B•¡�”Žw’è‚·‚é‚Í�ê�‡‚͂‚Ȃ°‚Ä�‘‚«‚Ü‚·�B
b:‘¾Žš i:ŽÎ‘Ì u:‰º�ü s:‘Å‚¿�Á‚µ�ü
f(ƒCƒ“‚̃tƒŒ�[ƒ€�”,ƒAƒEƒg‚̃tƒŒ�[ƒ€�”):ƒtƒF�[ƒhƒCƒ“�EƒAƒEƒg
m(ŠJŽnƒtƒŒ�[ƒ€,ŠJŽnX,ŠJŽnY,�I—¹ƒtƒŒ�[ƒ€,�I—¹X,�I—¹Y):ƒ‚�[ƒVƒ‡ƒ“
- size ƒtƒHƒ“ƒgƒTƒCƒY‚Å‚·�B
- textcolor •¶Žš�F‚Å‚·�BƒAƒ‹ƒtƒ@‚àŽw’è‰Â”\‚Å‚·�B
- halocolor ‰�Žæ‚è‚Ì�F‚Å‚·�BƒAƒ‹ƒtƒ@‚àŽw’è‰Â”\‚Å‚·�B

�E SubtitleEx‰ü‚ŒljÁ‚³‚ꂽƒpƒ‰ƒ��[ƒ^

- effects="w" �u | �v‚É‚æ‚é‰ü�s‚ª–³Œø‚ɂȂè‚Ü‚·�B
- linemargin=�”’l �sŠÔŠu‚ðŽw’肵‚Ü‚·�B
- spc=�”’l •¶ŽšŠÔŠu‚ðŽw’肵‚Ü‚·�B


’�ˆÓŽ–�€
--------

ƒtƒH�[ƒ}ƒbƒg‚ð RGB32 ‚ȂǂɕÏ�X‚µ‚È‚¢‚ƃNƒ‰ƒbƒVƒ…‚µ‚Ä‚µ‚Ü‚¤�ê�‡‚ª‚ ‚è‚Ü‚·�B
‚±‚Ì�ê�‡‚̓tƒH�[ƒ}ƒbƒg‚ð•ÏŠ·‚µ‚Ä‚*‚¾‚³‚¢�B


ƒ‰ƒCƒZƒ“ƒX
----------

�uAVISynth —pƒvƒ‰ƒOƒCƒ“ SubTitleEx‰ü�v‚Ì’˜�ìŒ ‚¨‚æ‚у‰ƒCƒZƒ“ƒX‚Í�A‚±‚̃vƒ‰ƒOƒCƒ“‚Ì
Œ´�ì‚Å‚ ‚é�ABasilik Tournadski Ž�‚Ì�uSubTitleEx�v�uDVTimeStampEx�v‚É�€‚¶‚Ü‚·�B

‚±‚ê‚ç‚̃vƒ‰ƒOƒCƒ“‚Í Basilik Tournadski Ž�‚ª’˜�ìŒ ‚ðŽ�‚¿�A–³�ž‚̃tƒŠ�[ƒ\ƒtƒg‚Æ‚µ‚Ä
ŒöŠJ‚³‚ê‚Ä‚¢‚Ü‚µ‚½�B

‚½‚¾‚µ�A‚±‚̃vƒ‰ƒOƒCƒ“‚͂܂Á‚½‚*”ñŒöŽ®‚È‚à‚̂ł ‚邽‚ß�A‚±‚̃vƒ‰ƒOƒCƒ“‚ÉŠÖ‚µ‚Ä
Œ´�ìŽÒ‚É–â‚¢�‡‚킹‚µ‚È‚¢‚Å‚*‚¾‚³‚¢�B‚Ü‚½�A‚±‚̃vƒ‰ƒOƒCƒ“‚ɂ‚¢‚Ä�A
Œ´�ìŽÒ�E‰ü‘¢”Å�ìŽÒ‚͈ê�Ø‚Ì�Ó”C‚𕉂¢‚Ü‚¹‚ñ�B


‰ü‘¢”Å�ìŽÒ�E”z•zŒ³
------------------

‚Ù‚µ‚¯‚ñ (http://hosiken.jp/)



Original [after codepage conversion]

====================================
AVISynth 用プラグイン SubTitleEx改
====================================

概要
----

AVISynth 用プラグイン SubTitleEx改 は、AVISynth 2.5 用のテロップ表示プラグインで、
AVISynth 標準の SubTitle より多数の機能拡張がなされています。

「mVideo Utilities」という現在は閉鎖されているサイトで公開されていた
Basilik Tournadski 氏作成の「SubTitleEx」をもとに、日本語が文字化けする現象を
修正したものです。また、改行の有無、および行間を設定できる機能を追加しています。

「SubTitleEx」は過去にソースコードが公開されていたのですが現在では入手できず、
たまたま Internet Archive にソースコードが残っていた、同作者によるプラグインで
SubTitleEx の文字表示エンジンが組み込まれている「DVTimeStampEx」をもとに、
「SubTitleEx」相当の機能を持ったものを作成しました。


使い方
------

AviSynth をインストールしたフォルダの「Plugin」フォルダに、SubtitleEx.dll を
コピーするだけで使用が可能になります。

本家 SubtitleEx の機能はすべて実装されており、一部の「ダメ文字」が含まれると
文字化けする問題が修正されています。それに加えて、SubTitleEx改では以下の
パラメータが追加されています。

SubtitleEx(
string text,
int "x",
int "y",
int "firstframe",
int "lastframe",
string "font",
string "effects",
int "size",
int "textcolor",
int "halocolor"
int "linemargin"
int "spc"
)

・ 本家 SubtitleEx のパラメータ

- text 表示するテキスト。改行する場合その箇所に「 | 」を書きます。
- x 表示する座標です。マイナスを指定すると右からになります。
- y 表示する座標です。マイナスを指定すると下からになります。
- firstframe 表示する最初のフレーム数です。
- lastframe 表示する最後のフレーム数です。
- font フォント名を指定します。
- effects エフェクトを指定します。複数指定するは場合はつなげて書きます。
b:太字 i:斜体 u:下線 s:打ち消し線
f(インのフレーム数,アウトのフレーム数):フェードイン・アウト
m(開始フレーム,開始X,開始Y,終了フレーム,終了X,終了Y):モーション
- size フォントサイズです。
- textcolor 文字色です。アルファも指定可能です。
- halocolor 縁取りの色です。アルファも指定可能です。

・ SubtitleEx改で追加されたパラメータ

- effects="w" 「 | 」による改行が無効になります。
- linemargin=数値 行間隔を指定します。
- spc=数値 文字間隔を指定します。


注意事項
--------

フォーマットを RGB32 などに変更しないとクラッシュしてしまう場合があります。
この場合はフォーマットを変換してください。


ライセンス
----------

「AVISynth 用プラグイン SubTitleEx改」の著作権およびライセンスは、このプラグインの
原作である、Basilik Tournadski 氏の「SubTitleEx」「DVTimeStampEx」に準じます。

これらのプラグインは Basilik Tournadski 氏が著作権を持ち、無償のフリーソフトとして
公開されていました。

ただし、このプラグインはまったく非公式なものであるため、このプラグインに関して
原作者に問い合わせしないでください。また、このプラグインについて、
原作者・改造版作者は一切の責任を負いません。


改造版作者・配布元
------------------

ほしけん (http://hosiken.jp/)


Translated to English

====================================
AVISynth plug-in SubTitleEx
====================================

Overview
----

AVISynth plug-in SubTitleEx Kai is a subtitle display plug-in for AVISynth 2.5.
There are many enhancements over the AVISynth standard SubTitle.

It was published on a currently closed site called "mVideo Utilities"
Based on "SubTitleEx" created by Basilik Tournadski, Japanese characters are garbled
It has been corrected. In addition, a function to set the presence / absence of line breaks and line spacing has been added.

"SubTitleEx" had source code released in the past, but it is not available now,
It happened that the source code was left in the Internet Archive.
Based on "DVTimeStampEx" that incorporates SubTitleEx's character display engine,
Created one with a function equivalent to "SubTitleEx".


How to use
------

SubtitleEx.dll is added to the "Plugin" folder of the folder where AviSynth is installed.
It can be used just by copying.

All functions of the original SubtitleEx are implemented, and if some "useless characters" are included
A garbled problem has been fixed. In addition, SubTitleEx breaks
Parameters have been added.

SubtitleEx(
string text,
int "x",
int "y",
int "firstframe",
int "lastframe",
string "font",
string "effects",
int "size",
int "textcolor",
int "halocolor"
int "linemargin"
int "spc"
)


· Parameters of SubtitleEx

-text The text to display. If you want to start a new line, write "|" at that point.
-x The coordinates to display. If you specify minus, it will be from the right.
-y The coordinates to display. If you specify minus, it will be from the bottom.
-firstframe The number of the first frame to display.
-lastframe The number of the last frame to display.
-font Specify the font name.
-effects Specifies effects. If you specify more than one, write them together.
b: bold i: italic u: underline s: strikethrough
f (number of frames in, number of frames out): fade-in / out
m (start frame, start X, start Y, end frame, end X, end Y): motion
-size Font size.
-textcolor The text color. Alpha can also be specified.
-halocolor The color of the border. Alpha can also be specified.


· Parameter added by SubtitleEx

-effects = "w" Line breaks with "|" are disabled.
-linemargin = number Specify the line spacing.
-spc = number Specify the character spacing.


Notes
--------


If you do not change the format to RGB32, etc., you may crash.
In this case, convert the format.


license
----------

The copyright and license for "AVISynth Plug-in SubTitleEx Kai" are
Based on the original "SubTitleEx" and "DVTimeStampEx" by Basilik Tournadski.

These plug-ins are copyrighted by Basilik Tournadski and are free software.
Was published.

However, since this plugin is completely unofficial,
Do not contact the original author. Also, about this plugin,
The original author and modified author do not take any responsibility.


Modified author / distributor
------------------

Hoshiken (http://hosiken.jp/)


EDIT: The original txt file in zip has no encoding info and looks not much like the original text above in 2nd code block,
In PS-PAD, I ticked Menu/Encoding/AutoDetect_CP, which converts as for 2nd code black above.
then translated in pieces using google search "online translate", which is a direct online google translate whatsit,
limited length so need do in pieces.

Original test script

version()
converttorgb32()
SubTitleEx(x=0, y=0, font="MS UI Gothic", size=20, "�Þ—¿‚̃|ƒCƒ“ƒg|�Eƒuƒ‹ƒhƒbƒOƒ\�[ƒX|�E”Œ•û‚̉–|SubtitleEx‰ü‚Í“ú–{Œê‚ª‰»‚¯‚Ü‚¹‚ñ",
\ effects="bif(20, 20)m(0,0,0,300,100,0)", linemargin=-2, spc=16, textcolor=$ffff80, halocolor=$ff0000)


Autodetected Code Page Test.avs

version()
converttorgb32()
SubTitleEx(x=0, y=0, font="MS UI Gothic", size=20, "材料のポイント|・ブルドッグソース|・伯方の塩|SubtitleEx改は日本語が化けません",
\ effects="bif(20, 20)m(0,0,0,300,100,0)", linemargin=-2, spc=16, textcolor=$ffff80, halocolor=$ff0000)


Test.avs Result image [Maybe should change display string to UTF8 or something]
https://i.postimg.cc/J4GJ7TSn/Subtitle-Ex.jpg (https://postimages.org/)

EDIT: The Google Online Tranlate thing(works like old BabelFish site):- https://www.google.com/search?source=hp&ei=bGBEXtx98YOMuw_ws4CYDQ&q=online+translate&oq=online+translate&gs_l=psy-ab.3..0l7j0i10l3.1785.4309..4512...0.0..0.321.2178.0j16j0j1......0....1..gws-wiz.....8..0i362i308i154i357j0i131.M0P2LIIlhKI&ved=0ahUKEwjc46DC7cznAhXxAWMBHfAZANMQ4dUDCAc&uact=5

Groucho2004
13th February 2020, 00:55
Test.avs Result image [Maybe should change display string to UTF8 or something]
https://i.postimg.cc/J4GJ7TSn/Subtitle-Ex.jpg (https://postimages.org/)
It displays fine when you save the .avs with ANSI encoding (Shift-JIS for JA) and change the system locale to Japanese:
https://i.postimg.cc/SsjWX29F/test1-00.png
The image above was captured with the 64 bit version in VDub2.

JackBrody
13th February 2020, 10:17
No feedback from the OP so I guess it's working?

Sorry for not responding, I am finally here.

I gave it a try now. I only see troubles with negative values of x or y (positions on screen). According to the documentation (http://www.avisynth.nl/index.php/SubtitleEx) they are supposed to align right, resp. to the bottom.

Try:
BlankClip().SubtitleEx("First line|Second line|Third line", x = -100, y = -100)

Half of the third line is under the bottom margin of the screen.

https://ctrlv.cz/shots/2020/02/13/rDP7.png

Groucho2004
13th February 2020, 11:48
I only see troubles with negative values of x or y (positions on screen). According to the documentation (http://www.avisynth.nl/index.php/SubtitleEx) they are supposed to align right, resp. to the bottom.

Try:
BlankClip().SubtitleEx("First line|Second line|Third line", x = -100, y = -100)

Half of the third line is under the bottom margin of the screen.

https://ctrlv.cz/shots/2020/02/13/rDP7.pngIndeed. The original SubtitleEx by Basilik did not have that issue. I think the problem is somewhere in this code segment:
if ( m_Info.pos_x < 0 )
{
m_Info.alignment = TA_BASELINE | TA_RIGHT;
m_Info.pos_x = vi.width + m_Info.pos_x;
}
else
{
m_Info.alignment = TA_BASELINE | TA_LEFT;
}

if ( m_Style.center )
{
m_Info.alignment = TA_BASELINE | TA_CENTER;
}

if ( m_Info.pos_y < 0 )
{
m_Info.pos_y = vi.height + m_Info.pos_y;
}Should be easy to fix. However, very little time right now...

JackBrody
13th February 2020, 14:57
By the way, is the performance penalty of using 32-bit Avisynth significant (compared to 64-bit)? Is there any at all?

Groucho2004
13th February 2020, 15:07
By the way, is the performance penalty of using 32-bit Avisynth significant (compared to 64-bit)? Is there any at all?You can measure the difference with AVSMeter.

JackBrody
17th February 2020, 22:43
I unpacked AVSMeter but before I fed it with my AVS script I tested it on both 64bit and 32bit VirtualDub. No problem with the former, but the latter definitely has issues. I got "Avisynth open failure: FFVideoSource: No suitable output format found" error on the line with 37-th FFmpegSource2() call.

So I am afraid I can't go back to 32bit with my projects. :-)

StainlessS
17th February 2020, 23:02
And the same if there is NO SubtitleEx() call ?
If so then problem in your FFMPegSource, probably not same version as your x64 FFMPegSource.

EDIT:

AvsMeter avsinfo
#AvsMeter64 avsinfo

Should show versions [EDIT: If they have a version resource, many versions of both LSmash and FfmpegSsource do not have version resource]

JackBrody
18th February 2020, 00:27
I have not yet used SubtitleEx in my script so this is only about FFmpegSource2. Outputs from "avsmeter(64) avsinfo" are following:

AVSMeter 2.9.8 (x86), 2012-2020, (c) Groucho2004

VersionString: AviSynth+ 3.4 (r2923, 3.4, i386)
VersionNumber: 2.60
File / Product version: 3.4.0.0 / 3.4.0.0
Interface Version: 6
Multi-threading support: Yes
Avisynth.dll location: C:\Windows\SysWOW64\avisynth.dll
Avisynth.dll time stamp: 2019-10-20, 10:25:02 (UTC)
PluginDir2_5 (HKLM, x86): C:\Program Files (x86)\AviSynth+\plugins
PluginDir+ (HKLM, x86): C:\Program Files (x86)\AviSynth+\plugins+


[C++ 2.6 Plugins (32 Bit)] [Version, Time stamp]
C:\Program Files (x86)\AviSynth+\plugins+\ConvertStacked.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins+\DirectShowSource.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins+\ImageSeq.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins+\Shibatch.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins+\TimeStretch.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins+\VDubFilter.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins\ffms2.dll [n/a, 2016-12-29]

[Scripts (AVSI)] [Time stamp]
C:\Program Files (x86)\AviSynth+\plugins+\colors_rgb.avsi [2019-10-20]

[Uncategorized files] [Time stamp]
C:\Program Files (x86)\AviSynth+\plugins+\colors_rgb.txt [2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins\ffms2.lib [2016-12-29]
C:\Program Files (x86)\AviSynth+\plugins\ffmsindex.exe [2016-12-29]




AVSMeter 2.9.8 (x64), 2012-2020, (c) Groucho2004

VersionString: AviSynth+ 3.4 (r2923, 3.4, x86_64)
VersionNumber: 2.60
File / Product version: 3.4.0.0 / 3.4.0.0
Interface Version: 6
Multi-threading support: Yes
Avisynth.dll location: C:\Windows\SYSTEM32\avisynth.dll
Avisynth.dll time stamp: 2019-10-20, 12:58:12 (UTC)
PluginDir2_5 (HKLM, x64): C:\Program Files (x86)\AviSynth+\plugins64
PluginDir+ (HKLM, x64): C:\Program Files (x86)\AviSynth+\plugins64+


[C++ 2.6 Plugins (64 Bit)] [Version, Time stamp]
C:\Program Files (x86)\AviSynth+\plugins64+\ConvertStacked.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins64+\DirectShowSource.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins64+\ImageSeq.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins64+\Shibatch.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins64+\TimeStretch.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins64+\VDubFilter.dll [n/a, 2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins64\ffms2.dll [n/a, 2016-12-29]

[Scripts (AVSI)] [Time stamp]
C:\Program Files (x86)\AviSynth+\plugins64+\colors_rgb.avsi [2019-10-20]

[Uncategorized files] [Time stamp]
C:\Program Files (x86)\AviSynth+\plugins64+\colors_rgb.txt [2019-10-20]
C:\Program Files (x86)\AviSynth+\plugins64\ffms2.lib [2016-12-29]
C:\Program Files (x86)\AviSynth+\plugins64\ffmsindex.exe [2016-12-29]

StainlessS
18th February 2020, 00:55
You dont need the .Lib files.
ffmsindex.exe only needed if you use it via command line.

I thought AvsMeter showed Operating System, I guess not.
What does Info show for faulting clip on x64 ?
Post to PostImage.org, dont need account. [Paste thumbnail for forum, or link for forum]

There is defo a later version ffms2 than 2016 [at least for W7].
I'm using this one on W7,x64, FFMS2_a26x64_2.23.1_MSVC_FFMPEG_4.2.2(l33tmeatwad).dll [just description, the file aint called that]
W7, x86, FFMS2_a26x86_2.23.1_MSVC_FFMPEG_4.2.2(l33tmeatwad).dll
And on XP,x64, ffms2_a26x64(XP)_2.23_clang.dll
XP x86, ffms2_C_x86_r1315_119_avs_vsp_LastXP.dll
[EDIT: Above dll is a C version, LoadCPlugin, will auto load in Avs+ OK]

Groucho2004
18th February 2020, 04:36
I thought AvsMeter showed Operating System, I guess not.It does if you output to a log file and not just capture the screen.

Groucho2004
18th February 2020, 04:41
I got "Avisynth open failure: FFVideoSource: No suitable output format found" error on the line with 37-th FFmpegSource2() call.Post your complete script.

JackBrody
20th February 2020, 22:14
Stainless: Info() output follows. BTW it is the same for all the clips as they were shot on the same day with the same camera:

https://ctrlv.cz/shots/2020/02/20/ZQq1.png

Groucho2004: script after anonymization:


function Poznamka(clip c, int startFrame, string text) {
time = 6
endFrame = startFrame + Int(c.FrameRate * time)
return c.subtitleEx(text, firstframe = startFrame, lastframe = endFrame, x = -50, y = -50, size = 40, textcolor = $00FFFFFF, halocolor = $00000000, effects = "bf(25,25)")
}







function Prostrih(clip c, clip insertedClip, float startTime) {
insFrames = insertedClip.frameCount
fps = c.FrameRate
startFrame = Int(startTime * fps)

clipBefore = c.Trim(0, startFrame - 1)
clipAfter = c.Trim(startFrame + insFrames, 0)
montage = clipBefore + insertedClip + clipAfter
return AudioDub(montage, c)
}






function ProlinackaPresCernou(clip c1, clip c2, int frames) {
return c1.FadeOut(frames) ++ c2.FadeIn(frames)
}







function TrimByTime(clip c, float startTime, float endTime) {
fps = c.FrameRate
startFrame = Int(startTime * fps)
endFrame = Int(endTime * fps)
return c.Trim(startFrame, endFrame)
}






















prvni_klip = FFmpegSource2("video.mp4", atrack = -1).Trim(0, 100)


cerna_2s = BlankClip(prvni_klip, length = 50)























BlankClip(prvni_klip, length = 150).Subtitle("some text", x = 960, y = 540, align = 5, lsp = 500, size = 100)
FadeIn(50)










Dissolve(prvni_klip, 50) ++ \
FFmpegSource2("video.mp4", atrack = -1).Trim(10, -75) ++ \
FFmpegSource2("video.mp4", atrack = -1).Trim(209, -220)









prostrihNaTuristy = FFmpegSource2("video.mp4", atrack = -1).Trim(0, 100)

ProlinackaPresCernou(FFmpegSource2("video.mp4", atrack = -1).Trim(500, 1354).Prostrih(prostrihNaTuristy, 13.48), 25) ++ \
FFmpegSource2("video.mp4", atrack = -1).Trim(53, 240) ++ \
FFmpegSource2("video.mp4", atrack = -1).Trim(5, 265)







ProlinackaPresCernou(FFmpegSource2("video.mp4", atrack = -1).Trim(185, -100).Amplify(0.3), 25) ++ \
FFmpegSource2("video.mp4", atrack = -1).Trim(5, -100) ++ \
FFmpegSource2("video.mp4", atrack = -1).Trim(596, 775)


Dissolve(FFmpegSource2("video.mp4", atrack = -1).Trim(10, 0), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).Trim(25, 178))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).Trim(503, -100))


Dissolve(FFmpegSource2("video.mp4", atrack = -1).Trim(10, -150), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).Trim(10, -125))

ProstrihNaSnehulaka = FFmpegSource2("video.mp4", atrack = -1).Trim(100, -140)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).Trim(310, 844).Prostrih(ProstrihNaSnehulaka, 10))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).Trim(75, -100))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).Trim(10, -100))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(2.67, -4))





ProlinackaPresCernou(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(2.979, -5).Amplify(0.3), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(1.13, 9.05))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.5, -5))
Dissolve(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(1.7, -4.5), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.5, 9.52))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.5, -6))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 0))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(11.369, 27.28))




ProlinackaPresCernou(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(1, 9.2), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 0))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -4.5))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(7.43, 0))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -5))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -5))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -5))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(9, 35))

Dissolve(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(4, 0), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -5))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(1.6, 4.8))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -5))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 7))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -5))


Dissolve(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 0), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 0).Amplify(0.3))









ProlinackaPresCernou(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.2, 5), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(8.2, 18))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(7.6, 13.6))

Dissolve(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(1, 8), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, -5))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 6))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(14.5, 30.2))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(7.08, 20.1))
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(44.3, 58.5))






ProlinackaPresCernou(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(2.1, 8), 25)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(6, 13))

Dissolve(FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 10), 25)


prostrih1 = FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.3, 5.1)
prostrih2 = FFmpegSource2("video.mp4", atrack = -1).TrimByTime(1.5, 6)
prostrih3 = FFmpegSource2("video.mp4", atrack = -1).TrimByTime(0.2, 6)
AlignedSplice(FFmpegSource2("video.mp4", atrack = -1).Prostrih(prostrih1, 26.2).Prostrih(prostrih2, 57).Prostrih(prostrih3, 76.9).TrimByTime(0.3, 96.2))

FadeOut(50)






When I open it in 64-bit VirtualDub, it plays just fine.
When in 32-bit VD, I get following error. Line 172 contains 36th call of FFmpegSource2(). Once I got an error different from this one, it was something with insanity :confused: (but I guess I am perfectly sane so far :) )

https://ctrlv.cz/shots/2020/02/20/IvPt.png


Sorry for responding after 2 days. I have instant e-mail notification set on this thread from the OP but the forum doesn't send me notification e-mails.

StainlessS
20th February 2020, 23:33
Maybe the source filter just dont like you having loads of instances open, its kinda crazy too, you just need one instance of the clip opening your "video.mp4",
and after that either use Last or assign to some variable and use that,
eg

C=FFmpegSource2("video.mp4", atrack = -1)
AClip =C.trim(0,100) ++ C.trim(110,200) ++ C.Trim(500,700)


Also AlignedSplice is exactly the same as "++", and UnalignedSplice same as "+".

I would get a more recent version of ffms2 (both x86 and x64).

Groucho2004
20th February 2020, 23:42
You might be running out of memory on 32 bit for the reasons Stainless stated. Run the script with AVSMeter64 to see how much memory it needs.

StainlessS
20th February 2020, 23:57
There is a known problem (with any source filter) when you hit some limit on file open count, it seems to be a system resource limit and may
be different for each source filter.
Here a thread on it:- https://forum.doom9.org/showthread.php?p=1532807&highlight=file+open+resouce+limit#post1532807
x64 probably just has a higher limit and so you have escaped so far. Modify your method, ie dont open the same file gazillions of times.

More:
https://forum.doom9.org/showthread.php?t=24316&highlight=file+open+resouce+limit
[See IanB post] https://forum.doom9.org/showthread.php?t=162693&highlight=file+open+resouce+limit

There are probably many more threads mentioning the problem.

@hinsdale1,

Yes it is the number of Direct Show environments created by each DirectshowSource() that is killing you. Each one is sizeable.

The error message indicates severe lack of free memory in the process address space.

The call was for an 8Mb chunk, SetMemoryMax was 512Mb, but there was only 64Mb already allocated (probably as 8 of 8Mb buffers) in the frame cache so far. So the address space is pretty maxed out, 64MB is about 3% of the 2GB address space.

Options:-

If you environment supports it you could try the 3GB hack. This might give you upto 50% more address space.

Try SetMemoryMax(32), this will force very aggressive reuse of the existing buffers.

Assuming the shape and sizes are compatible, externally splice your individual .mkv sources into a single big mkv source so you only need a single Direct Show environment. You could then cut the single input clip back into component clips to maintain your work flow.

Try a different source filter technology, like ffmeg or DG, that may be less memory intensive.

JackBrody
21st February 2020, 01:35
Every FFmpegSource2() loads a different video. By the "anonymization" I meant that I removed everything that was personal. So were the names of my videos so I replaced them with "video.mp4". :)


From the log created by AVSmeter64:


Log file created with: AVSMeter 2.9.8 (x64)
Script file: c:\video\script.avs

[OS/Hardware info]
Operating system: Windows 10 (x64) (Build 18362)

CPU: AMD Ryzen 5 PRO 3500U w/ Radeon Vega Mobile Gfx / Ryzen 5 (Picasso)
MMX, MMXEXT, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4A, FMA3, AVX, AVX2
4 physical cores / 8 logical cores


[Avisynth info]
VersionString: AviSynth+ 3.4 (r2923, 3.4, x86_64)
VersionNumber: 2.60
File / Product version: 3.4.0.0 / 3.4.0.0
Interface Version: 6
Multi-threading support: Yes
Avisynth.dll location: C:\Windows\SYSTEM32\avisynth.dll
Avisynth.dll time stamp: 2019-10-20, 12:58:12 (UTC)
PluginDir2_5 (HKLM, x64): C:\Program Files (x86)\AviSynth+\plugins64
PluginDir+ (HKLM, x64): C:\Program Files (x86)\AviSynth+\plugins64+


[Clip info]
Number of frames: 12908
Length (hh:mm:ss.ms): 00:08:36.320
Frame width: 1920
Frame height: 1080
Framerate: 25.000 (25/1)
Colorspace: i420
Audio channels: 2
Audio bits/sample: 32 (Float)
Audio sample rate: 48000
Audio samples: 24783360


[Runtime info]
Frames processed: 12908 (0 - 12907)
FPS (min | max | average): 116.9 | 3290 | 411.3
Process memory usage (max): 4042 MiB
Thread count: 493
CPU usage (average): 70.7%

Time (elapsed): 00:00:31.384

StainlessS
21st February 2020, 03:59
so I replaced them with "video.mp4"
OK, but makes no difference as far as the number of open files.

This dont look good.
Process memory usage (max): 4042 MiB

JackBrody
21st February 2020, 17:44
Well, I have 16 GB of RAM, no problem with 4 GB used. But 32-bit aplications are only able to address 3,5 GB, right?

Groucho2004, how about add memory size to the output of AVSMeter? Might be relevant sometimes.

Groucho2004
21st February 2020, 17:55
32-bit aplications are only able to address 3,5 GB, right?On a 64 bit OS it's very close to 4GB. Nevertheless, you're really hitting that limit.

Groucho2004, how about add memory size to the output of AVSMeter? Might be relevant sometimes.Which memory size? Total? Remaining? For the active process I presume?

StainlessS
21st February 2020, 18:00
only able to address 3,5 GB, right?
32 bit, 2GB for User space, 2GB kernel [theoretical, even if only eg 512MB ram, Pagefile [EDIT: Virtual Memory] steps in].
If app has some flag set [Large Address Aware] then can have 3GB user space [1GB kernel].
Some systems cannot access about last 0.5 GB of RAM for some reason [hardware address mapping I think],
not sure if that affects all systems, perhaps G2K4 likes to chime in.

EDIT: OK, he did go BONG.

JackBrody
21st February 2020, 20:31
On a 64 bit OS it's very close to 4GB. Nevertheless, you're really hitting that limit.
Never mind I will stay with 64-bit Avisynth.
BTW will you have time to fix the problem with bottom-aligning text in SubtitleEx plugin?


Which memory size? Total? Remaining? For the active process I presume?
I meant physical memory but it would be already there if you considered it important. :)

Groucho2004
21st February 2020, 23:19
BTW will you have time to fix the problem with bottom-aligning text in SubtitleEx plugin?I did look at it and it depends on the font size. With smaller fonts there is no problem. I don't know how to fix this, maybe someone with more experience in device contexts and plugin development can have a go (Stainless?).

StainlessS
22nd February 2020, 19:54
G2K4,
How did you fix the original source, [did you use original Internal.h ? and what fixes for eg LPCWSTR].
I have zero knowledge of that wide character stuff, I've always avoided that like the plague,
[given your profession it is unlikely that you are in the same boat].
I also know little of Std CPP library [never used since about 1997 EDIT: Actually ~April 1996] and absolutley nowt about CPP Std Template Library.
If you post or PM your altered source, maybe I'll have a try, thanx.

Groucho2004
22nd February 2020, 20:29
G2K4,
How did you fix the original source, [did you use original Internal.h ? and what fixes for eg LPCWSTR].
I have zero knowledge of that wide character stuff, I've always avoided that like the plague,
[given your profession it is unlikely that you are in the same boat].
I also know little of Std CPP library [never used since about 1997 EDIT: Actually ~April 1996] and absolutley nowt about CPP Std Template Library.
If you post or PM your altered source, maybe I'll have a try, thanx.
Here (https://www.dropbox.com/s/361726hfdjw4e8r/SubTitleEx.7z?dl=1) are the sources for 32 & 64 bit. Ignore the 64 bit source, you can't build it with VC. The only changes I made in the 32 bit source are the AVS+ headers including the usual changes (AVS_Linkage, ...). There's no wide character/Unicode stuff in there.

Edit - One more thing: I copied the PixelClip class definition from internal.h since it is not present in the AVS+ headers.

StainlessS
24th February 2020, 15:12
Thanks G2K4, I've got em, not had time to take a gander yet.

StainlessS
25th February 2020, 21:22
Mods to previously posted Japanese -> English translation of docs.


====================================
AVISynth plug-in SubTitleEx
====================================

Overview
----

AVISynth plug-in SubTitleEx Kai is a subtitle display plug-in for AVISynth 2.5.
There are many enhancements over the AVISynth standard SubTitle.

It was published on a currently closed site called "mVideo Utilities"
Based on "SubTitleEx" created by Basilik Tournadski, Japanese characters are garbled
It has been corrected. In addition, a function to set the presence / absence of line breaks and line spacing has been added.

"SubTitleEx" had source code released in the past, but it is not available now,
It happened that the source code was left in the Internet Archive.
Based on "DVTimeStampEx" that incorporates SubTitleEx's character display engine,
Created one with a function equivalent to "SubTitleEx".


How to use
------

SubtitleEx.dll is added to the "Plugin" folder of the folder where AviSynth is installed.
It can be used just by copying.

All functions of the original SubtitleEx are implemented, and if some "useless characters" are included
A garbled problem has been fixed. In addition, SubTitleEx breaks
Parameters have been added.

SubtitleEx(
clip c,
string text,
int "x",
int "y",
int "firstframe",
int "lastframe",
string "font",
string "effects",
int "size",
int "textcolor",
int "halocolor"
int "spc"
int "linemargin"
)


· Parameters of SubtitleEx

-c Non optional clip.
-text The text to display (Default ""). If you want to start a new line, write "|" at that point.
-x The coordinates to display (Default c.Width * -0.11). If you specify minus, it will be from the right.
-y The coordinates to display (Default c.Height * -0.17). If you specify minus, it will be from the bottom.
-firstframe The number of the first frame to display (Default 0).
-lastframe The number of the last frame to display (Default, Last frame of clip c).
-font Specify the font name (Default "Arial").

-effects Specifies effects (Default "b"). If you specify more than one, write them together.
b: Bold i: Italic u: Underline o: strikeOut/strikethrough
f (number of frames in, number of frames out): fade-in / out
m (start frame, start X, start Y, end frame, end X, end Y): motion
w Line breaks with "|" are disabled. (Added by SubTitleEx Kai)
c: Center (not sure that it works properly)
n: No Anti Alias
e: Alpha Emboss
s: Alpha Blur
g: Alpha Gaussian Blur
l: Alpha Laplacian
-size Font size (Default 36).
-textcolor The text color (Default $FFFFFF). Alpha can also be specified.
-halocolor The color of the text halo (Default $000000). Alpha can also be specified.
-spc number Specify the character spacing. (Default 0, Added by SubTitleEx Kai)
-linemargin number Specify the line spacing. (Default 0, Added by SubTitleEx Kai)

NOTE, In original SubTitleEx Kai docs,
spc and linemargin order was transposed (ie wrong).
Effects "s" (Strikethrough) was wrong, should be "o" (strikeOut, as above).
Effects "cnesgl" were all missing from doc (well 's' did Alpha Blur rather than StrikeThrough).
EDIT: Above "nesgl" effects should perhaps be mutually exclusive.


Notes
--------


If you do not change the format to RGB32, etc., you may crash.
In this case, convert the format.


license
----------

The copyright and license for "AVISynth Plug-in SubTitleEx Kai" are
Based on the original "SubTitleEx" and "DVTimeStampEx" by Basilik Tournadski.

These plug-ins are copyrighted by Basilik Tournadski and are free software.
Was published.

However, since this plugin is completely unofficial,
Do not contact the original author. Also, about this plugin,
The original author and modified author do not take any responsibility.


Modified author / distributor
------------------

Hoshiken (http://hosiken.jp/)


Updated:

StainlessS
27th February 2020, 03:59
Previous post updated/Added, in RED. [Prev update post deleted, below appended, ie BUMP]

Previously Un-documented Effects, Laplacian maybe does work ok, if big enough.
https://i.postimg.cc/7PQX0kvD/Effects.jpg (https://postimages.org/)

EDIT:

BlankClip(Color=$0000FF)
SubtitleEx("STANDARD",x=0,y=0,effects="",Size=64)
SubtitleEx("No ANTI-ALIAS",x=0,y=64,effects="n",Size=64)
SubtitleEx("ALPHA EMBOSS",x=0,y=128,effects="e",Size=64)
SubtitleEx("ALPHA BLUR",x=0,y=192,effects="s",Size=64)
SubtitleEx("ALPHA GAUSSIAN",x=0,y=256,effects="g",Size=64)
SubtitleEx("ALPHA LAPLACIAN",x=0,y=320,effects="l",Size=64)

https://i.postimg.cc/Z5jLYtx1/Effects2.jpg (https://postimages.org/)

Reel.Deel
27th February 2020, 15:24
StainlessS, thank you for the updated docs. If SubTitleEx Kai is fixed to were it behaves like the original I will add your info above to the wiki.

StainlessS
27th February 2020, 16:46
There is also difference between the two for Y=0 [original got it wrong maybe], try this with original and Kai dll's.
(Maybe Kai fix for Y=0, broke the bottom align thing)


#LoadPlugin(".\subtitleEx.dll") # Original
BlankClip()
SubtitleEx("First line 111111 11111 111|Second line 2222 222 22222 2|Third lineg",effects="sc",size=48,x=width/2,y=0)
return last


I'm takin' my time with this, I wanna understand it before I try to break it :)

Got to go to pub now.

EDIT:
Original
https://i.postimg.cc/fyhS8QM2/kai-dll.jpg (https://postimages.org/)

Kai
https://i.postimg.cc/k4Lv9HqK/orig-dll.jpg (https://postimages.org/)
EDIT: Oops, labelled wrong, order changed[link names wrong though].

EDIT:
RD, some additional docs and nifty examples in DVUtilities CHM (Compressed HTML help file, search DVUtilities):- http://www.avisynth.nl/users/warpenterprises/
Or Direct link Here:- http://www.avisynth.nl/users/warpenterprises/files/dvutilities_20050717.zip

StainlessS
28th February 2020, 17:26
Anybody know if SubtitleEx was issued under GPL, or not ?
(Should I add it to the source)

StainlessS
28th February 2020, 18:12
It looks like some of the Anti-alias code was taken from avisynth source, so I'll add GPL.

EDIT:
Original SubtitleEx contained same subtitle engine as DvTimeStamp, and Kai's version was also based on DvTimestamp.
Internal.h is defo Avisynth, and as DvTimeStamp source subs engine also uses Internal.h so both original SubtitleEx and Kai version must also both be GPL.

Reel.Deel
29th February 2020, 02:27
EDIT:
RD, some additional docs and nifty examples in DVUtilities CHM (Compressed HTML help file, search DVUtilities):- http://www.avisynth.nl/users/warpenterprises/
Or Direct link Here:- http://www.avisynth.nl/users/warpenterprises/files/dvutilities_20050717.zip

Thanks, some time ago I added SubtitleEx to the wiki (http://www.avisynth.nl/index.php/SubtitleEx), all of taken from the original archived homepage which is more or less the same as the CHM doc.


Edit:
Anybody know if SubtitleEx was issued under GPL, or not ?
(Should I add it to the source)

Take a look here: https://forum.doom9.org/showthread.php?t=77148

StainlessS
29th February 2020, 10:17
RD, I did not find that thread, expected name in thread title, and did not examine all Search For Posts threads.
Note, last frame in Kai does not display subs ("<" vs "<=" error).

I think I'm gonna try use avs v2.60 Std Subs Anit-alias substitution, maybe get 2.60 colorspaces available, dont know if I will be successful,
I feel there is just something wrong with the original code (both Basilik and Kai versions), both only use TA_BASELINE relative, not
TA_TOP or TA_BOTTOM relative, anyway gonna give it a try, and if not succeed then go back to original source again.

@G24K, way to go, dumping this on me, "StainlessS might be more used to device contexts" (or words to tha effect), I aint no windows progger and only really had
limited experience with DC in the Clipboard plugin. You knows when to back out of it and lump it on to somebody stupid enough to have a go. :)

Groucho2004
29th February 2020, 11:18
...I aint no windows progger and only really had
limited experience with DC in the Clipboard plugin.Limited experience is still better than no experience. :) I always hated GDI stuff and steered clear of it.

...You knows when to back out of it and lump it on to somebody stupid enough to have a go.You could have refused but the goodness of your heart made you do the right thing. :)

StainlessS
29th February 2020, 12:12
Soft soap and flannel, blowing smoke up my ass, swivel on this. https://www.cosgan.de/images/smilie/frech/m045.gif

Groucho2004
29th February 2020, 14:32
swivel on this. https://www.cosgan.de/images/smilie/frech/m045.gifHorizontally or vertically?

StainlessS
3rd March 2020, 00:44
Horizontally or vertically?
Well you could try all 3 X, Y, and Z axis, and choose the one of most resistance.

Would anybody like to try a test version, not sure that it is all as it should be, in particular YV24 saturation (ie ApplyYV24)
Guinea pigs required.

From Antialiaser.cpp

// ssS: Added. Called only by Apply
void Antialiaser::ApplyYV24(BYTE* buf, int pitch, int textcolor, int halocolor, int pitchUV, BYTE* bufU, BYTE* bufV)
{
if (dirty)
GetAlphaRect();
int Ytext = ((textcolor >> 16) & 255), Utext = ((textcolor >> 8) & 255), Vtext = (textcolor & 255);
int Yhalo = ((halocolor >> 16) & 255), Uhalo = ((halocolor >> 8) & 255), Vhalo = (halocolor & 255);
int textTransparancy = (textcolor >> 24) & 255;
int haloTransparancy = (halocolor >> 24) & 255;
char* alpha = alpha_bits + validRectangle.top * w * 2;
// buf += pitch * ((h - 1) - validRectangle.bottom);
buf += pitch * validRectangle.top;
bufU += pitchUV * validRectangle.top;
bufV += pitchUV * validRectangle.top;
for (int y = validRectangle.bottom; y >= validRectangle.top; --y)
{
for (int x = validRectangle.left; x <= validRectangle.right; ++x)
{
char tr0, tr1;
tr0 = div255to64[textTransparancy][alpha[x * 2 + 0]];
// tr1 = div255to64[haloTransparancy][alpha[x * 2 + 1]];
tr1 = (alpha[x * 2 + 0] >= 64)?0:div255to64[haloTransparancy][alpha[x * 2 + 1]];

buf[x] = (buf[x] * (64 - tr0 - tr1) + Ytext * tr0 + Yhalo * tr1) >> 6;

bufU[x] = (bufU[x] * (64 - tr0 - tr1) + Utext * tr0 + Uhalo * tr1) >> 6;
bufV[x] = (bufV[x] * (64 - tr0 - tr1) + Vtext * tr0 + Vhalo * tr1) >> 6;

// ssS: Alternative test
// bufU[x] = (bufU[x] * (128 - tr0 - tr1) + Utext * tr0 + Uhalo * tr1) >> 7;
// bufV[x] = (bufV[x] * (128 - tr0 - tr1) + Vtext * tr0 + Vhalo * tr1) >> 7;

// ssS: Alternative test
// bufU[x] = (bufU[x] * (128 - tr0*2 - tr1*2) + Utext * tr0*2 + Uhalo * tr1*2) >> 7;
// bufV[x] = (bufV[x] * (128 - tr0*2 - tr1*2) + Vtext * tr0*2 + Vhalo * tr1*2) >> 7;

}
buf += pitch;
bufU += pitchUV;
bufV += pitchUV;
alpha += w * 2;
}
}



v1.50Beta mod StainlessS.

Given version number of v1.50Beta
Made output same as original SubtitleEx for y=0 and Y=-1. (Y=0, Baseline of first line of text is at YCoord 0, Y=-1, BaseLine of Last line of text is at YCoord Height-1).
Where "|" inserts a NewLine in text, "||" will now print a single Pipe "|" character, without NewLine.
Add support for all v2.60 Std Colorspaces except YV411.


Decided to go with plan D, ie revert back to original KAI with mods.

It only became obvious what original SubtitleEx intended when rendering multiline where Y=0, and Y=-1 were viewed simultaneously, have implemented as original.

YV24

#LoadPlugin(".\SubtitleEx.dll") # Original SubtitleEx
#LoadPlugin(".\SubtitleExKai.dll") # Kai

#BlankClip(pixel_type="RGB24")
#BlankClip(pixel_type="RGB32")
#BlankClip(pixel_type="YUY2")
#BlankClip(pixel_type="YV12")
#BlankClip(pixel_type="YV16")
BlankClip(pixel_type="YV24")
#BlankClip(pixel_type="Y8")
TColor=$FF00FF
HColor=$00FF00
SubtitleEx(TextColor=TColor,HaloColor=HColor,"First line111111 11111g|Second line 2222 222 222g|Third lineg",effects="bc", size=48,x=width/2,y=0)
SubtitleEx(TextColor=TColor,HaloColor=HColor,"First line111111 11111g|Second line 2222 222 222g|Third lineg",effects="bec",size=48,x=width/2,y=-1)
#info
return convertToRGB32

YV24
https://i.postimg.cc/J0FQPx5b/CSTEST-00.jpg (https://postimages.org/)
YV12
https://i.postimg.cc/N03b1RJR/CSTEST-01.jpg (https://postimages.org/)
Actually, looks like I got it right, YV24 and YV12 look similar-ish on D9 post, I had not seen them side by side.

G2K4, for compile to x64, need define both "WIN32" and "_WIN64". [EDIT: Ensure version resource shows x64, "_WIN64" for resource compiler]

dll + source + VS2008 project files via SendSpace beneath this post, "SubtitleEx_a26_x86_v1.50_Beta01_20200302.7z".

EDIT: Bottom/top baseline relative stuff

const char *s=m_Info.text;
char *p;
int currLine;
for(currLine=0; currLine < LineCount; ++currLine) {
p=buf;
while(*s) {
if(s[1]!='\0') {
if(IsDBCSLeadByte(s[0]) == TRUE) {
*p++ = *s++; // Lead multi-byte
*p++ = *s++; // trail multi-byte
continue;
}
if(s[0]=='|' && s[1]=='|') {
++s; // Skip escape char
*p++ = *s++; // copy escaped pipe
continue;
}
}
if(s[0]=='|') {
++s; // skip n/l pipe
break; // End of current line
}
*p++ = *s++; // copy normal char
}
*p='\0';
if (m_Info.org_y >= 0) {
// ssS: linemargin Takes effect only where currline > 0
m_pAnti->AntialiserTextOut(buf, x, y + m_Info.linemargin * currLine, currLine);
} else {
// ssS: ie for 3 lines then from top, (currLine - LineCount + 1) = -2, -1, 0.
m_pAnti->AntialiserTextOut(buf, x, y + m_Info.linemargin * (currLine - LineCount + 1), currLine - LineCount + 1);
}
}


EDIT: Have not tested multi-byte Japanese type stuff. [have all that weird foreign stuff switched off on my machines]

Reel.Deel
3rd March 2020, 16:55
StainlessS, thank you very much for taking the time to do this! Great job, I will test the plugin :)

StainlessS
3rd March 2020, 17:12
Thanks RD, think I did/may_have gotten ApplyYV24() wrong, convert YV24 to YV12 and subtract from YV12 version produces visible difference in chroma, I'll try again.

StainlessS
5th March 2020, 15:01
OK, I think that maybe I did YV24 correct after all, If no bug reports prior to about Saturday, I'll release v1.50 without beta,
perhaps G2K4 finds it within his good self to add an x64 dll.

I was absolutely knackered when I was doing this plug, up until yesterday I had hardly slept a single wink for about 10 days,
for about 3 or 4 days I was shagged out, but after that it sort of became the norm and did not feel so much tired.
One day last week I had 5 pints of ale, no effect at all, not a wink slept, but last night about 10 pints did the trick, finally got some sleep. https://www.cosgan.de/images/smilie/muede/a015.gif

Groucho2004
5th March 2020, 17:14
If no bug reports prior to about Saturday, I'll release v1.50 without beta,
perhaps G2K4 finds it within his good self to add an x64 dll.Will do. Just let me know where the modified source is.

StainlessS
5th March 2020, 19:18
Modded source on my SendSpace below this post. [ SubtitleEx_a25_a26_x86_v1.50_20200305.zip ]

I've made Version resource v1.50, and added x64 code into AntiAliaser.cpp as so [switched via '_WIN64' define)


// ssS:
#ifdef _WIN64
unsigned __int64 tmp;
__asm
{ // test if the whole area isn't just plain black
mov edx, srcpitch


Define both WIN32 and _WIN64 for x64 build.

zip contains Avs v2.60/+ x86 and v2.58 dll's.

I'm more than happy for you to host in your repository.

Groucho2004
5th March 2020, 19:40
Modded source on my SendSpaceI keep getting 'bad gateway" on Sendspace. Can you upload to mediafire?

StainlessS
5th March 2020, 19:56
I've re-uploaded to SendSpace [I had problems uploading the first time, real slow connection], and here on MediaFire:- http://www.mediafire.com/file/c4lmehfy431dfwm/SubtitleEx_a25_a26_x86_v1.50_20200305.zip/file

Groucho2004
5th March 2020, 20:18
here on MediaFire:- http://www.mediafire.com/file/c4lmehfy431dfwm/SubtitleEx_a25_a26_x86_v1.50_20200305.zip/fileGot it, thanks.

Groucho2004
10th March 2020, 12:37
Modded source on my SendSpace below this post. [ SubtitleEx_a25_a26_x86_v1.50_20200305.zip ]

I've made Version resource v1.50, and added x64 code into AntiAliaser.cpp as so [switched via '_WIN64' define)


// ssS:
#ifdef _WIN64
unsigned __int64 tmp;
__asm
{ // test if the whole area isn't just plain black
mov edx, srcpitch


Define both WIN32 and _WIN64 for x64 build.

zip contains Avs v2.60/+ x86 and v2.58 dll's.


I finally had some time to build a 64 bit version with your modifications. All good except that the top y coords are now shifted, see here:

Script:
colorbars(width = 640, height = 480, pixel_type = "yv12").killaudio()
converttorgb32()
SubTitleEx(x=0, y=0, font="Arial", size=50, "First line (x=0, y=0)")


Result:
https://i.postimg.cc/jd51LPQy/test00-00.png

Result with the first version I made:
https://i.postimg.cc/t4RFXN3H/test00-01.png

pinterf
10th March 2020, 15:03
// ssS:
#ifdef _WIN64
unsigned __int64 tmp;
__asm
{ // test if the whole area isn't just plain black
mov edx, srcpitch


That asm part can safely be replaced by
const BYTE* src2 = src - 8 * srcpitch - 1;
unsigned int tmp = 0;
for (int i = 0; i < 24; i++) {
tmp |= *(unsigned int*)(src2);
src2 += srcpitch;
}
tmp &= 0x00ffffff;

Checked, compiler generates the same or better asm code for that part. No need for special 64 bit tmp, 32 bit is enough.

StainlessS
10th March 2020, 18:13
WOW thanks P, smashing.

G2K4,
Yeah, I decded to revert to original SubtitleEx method, before the Kai version.
from post 58

v1.50Beta mod StainlessS.

Given version number of v1.50Beta
Made output same as original SubtitleEx for y=0 and Y=-1. (Y=0, Baseline of first line of text is at YCoord 0, Y=-1, BaseLine of Last line of text is at YCoord Height-1).
Where "|" inserts a NewLine in text, "||" will now print a single Pipe "|" character, without NewLine.
Add support for all v2.60 Std Colorspaces except YV411.

It only became obvious what original SubtitleEx intended when rendering multiline where Y=0, and Y=-1 were viewed simultaneously, have implemented as original.


YV24
https://i.postimg.cc/J0FQPx5b/CSTEST-00.jpg (https://postimages.org/)
YV12
https://i.postimg.cc/N03b1RJR/CSTEST-01.jpg (https://postimages.org/)
Actually, looks like I got it right, YV24 and YV12 look similar-ish on D9 post, I had not seen them side by side.

EDIT: Bottom/top baseline relative stuff

const char *s=m_Info.text;
char *p;
int currLine;
for(currLine=0; currLine < LineCount; ++currLine) {
p=buf;
while(*s) {
if(s[1]!='\0') {
if(IsDBCSLeadByte(s[0]) == TRUE) {
*p++ = *s++; // Lead multi-byte
*p++ = *s++; // trail multi-byte
continue;
}
if(s[0]=='|' && s[1]=='|') {
++s; // Skip escape char
*p++ = *s++; // copy escaped pipe
continue;
}
}
if(s[0]=='|') {
++s; // skip n/l pipe
break; // End of current line
}
*p++ = *s++; // copy normal char
}
*p='\0';
if (m_Info.org_y >= 0) {
// ssS: linemargin Takes effect only where currline > 0
m_pAnti->AntialiserTextOut(buf, x, y + m_Info.linemargin * currLine, currLine);
} else {
// ssS: ie for 3 lines then from top, (currLine - LineCount + 1) = -2, -1, 0.
m_pAnti->AntialiserTextOut(buf, x, y + m_Info.linemargin * (currLine - LineCount + 1), currLine - LineCount + 1);
}
}



Original pre Kai version always positioned at baseline(otherwise cannot go upwards and partially off frame because of the Y= -1 thing).
I'm happy to leave as the author intended.

Groucho2004
10th March 2020, 18:39
Original pre Kai version always positioned at baseline(otherwise cannot go upwards and partially off frame because of the Y= -1 thing).
I'm happy to leave as the author intended.OK, fair enough.

I forgot to mention, the x86 / x64 distinction in the version resource does not work. It always shows 'x86'. I had a quick look but could not find any error in the conditional logic in version.h. And yes, I did define "WIN32" and "_WIN64".

Edit - With a temporary workaround the version in the x64 DLL is now OK. Here (http://www.mediafire.com/file/eogfo29xl3txvfv/SubTitleEx_x64.7z/file) is the plugin.

StainlessS
10th March 2020, 19:35
Thanks g, [no you cant have big G, thats Gavino's moniker].

I would have preferred if implemented with say optonal keypad base align arg, and forget x=-1 type stuff, maybe separate eg Vcent arg (for real centering, rather than print downwards from center), and where
Align defined then x and y relative to alignment, else relative 0,0. [EDIT: And maybe separate args for justification, eg right aligned, left justified. I think RT_subtitle can do that but forgot how]

The the command line for resource compiler whatsit on VS2008,

/d "_WIN64" /d "_UNICODE" /d "UNICODE" /fo"x64\Debug/DDigitTest.res"

Although I undefine UNICODE type stuff in "Compiler.h" (for the plug code)

#ifndef __COMPILER_H__
#define __COMPILER_H__

#ifdef UNICODE
#undef UNICODE // Avoid default wide character stuff
#endif
#ifdef _UNICODE
#undef _UNICODE // Avoid default wide character stuff
#endif
#ifdef MBCS
#undef MBCS
#endif
#ifdef _MBCS
#undef _MBCS
#endif

#define _CRT_SECURE_NO_WARNINGS

// Compile for minimum supported system. MUST be defined before includes.
// NEED to use SDK for updated headers, TK3 will give error messages/Warnings about Beta versions.
#ifdef _WIN64
#define WINVER 0x0502 // XP 64 Bit or Server 2003
#define _WIN32_WINNT 0x0502 // XP 64 Bit or Server 2003
#define NTDDI_VERSION 0x05020000 // Server 2003 SP0
#define _WIN32_IE 0x0700 // 0x0700=IE 7 SP0
#else
#define WINVER 0x0501 // XP 32 bit
#define _WIN32_WINNT 0x0501 // XP 32 bit
#define NTDDI_VERSION 0x05010300 // XP SP3
#define _WIN32_IE 0x0603 // 0x0603=IE 6 SP2
#endif


EDIT: Arh, I dont define WIN32 for resource compiler, maybe that was it.
When compile for v2.58, I also add AVISYNTH_PLUGIN_25 to Resource and CPP Preprocessor definitions.

EDIT:
Linker command line

/OUT:"M:\SJ\SOURCE ARCHIVE\VC\AVISYNTH FILTERS\2K8x64\DDigitTest\x64\Release\DDigitTest_x64.dll"
/INCREMENTAL:NO /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"x64\Release\DDigitTest_x64.dll.intermediate.manifest"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/DEBUG /PDB:"M:\SJ\SOURCE ARCHIVE\VC\AVISYNTH FILTERS\2K8x64\DDigitTest\x64\Release\DDigitTest_x64.pdb"
/SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X64 /ERRORREPORT:PROMPT kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib


CPP command line

/O2 /Ob2 /Oi /Ot /GL /D "_WIN64" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "DDIGITTEST_EXPORTS" /D "_WINDLL"
/D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy /Fo"x64\Release\\" /Fd"x64\Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt

EDIT: For line breaks. EDIT: Above looks like for debug version. FIXED.

EDIT: Does it work proper with that there squiggly writin' ?

StainlessS
12th March 2020, 00:35
SubtitleEx() v1.51. See Mediafire in my sig below this post. In the HOSTED folder.
Also availabe for 30 days from my Sendspace, also below this post.
Or direct link to MediaFire here:- http://www.mediafire.com/file/amek5sms7fz7csf/SubtitleEx_a25_a26_x86%2526x64_v1.51_20200311.zip/file

Dll's for avs v2.58, avs/+ x86 and x64.
+ source and project files for VS 2008.
Requires CPP runtimes 2008.

Removed ASM as suggested by Pinterf several posts ahead, no need for Intel compiler for x64 anymore.

Reel.Deel
15th March 2020, 19:16
StainlessS, thank you very much for taking the time to update this plugin! I've tried it out for a few things and all seems to be well :).
I've updated the wiki also: http://avisynth.nl/index.php/SubtitleEx

StainlessS
29th March 2020, 16:01
User fieliapm (not on-site since Oct 2018)

Has posted a few SubtitleEx() related script functions on Github:- https://github.com/fieliapm/avsi4comp
Go up 1 directory to see other available fieliapm stuff.

One of the available items is also posted in devs forum, (VideoInputSource - grab video frame from video capture card or webcam in real-time):- https://forum.doom9.org/showthread.php?t=170311
EDIT: Also here in Avs Usage (OP post only):- https://forum.doom9.org/showthread.php?t=174514&highlight=VideoInputSource

I posted this some time ago in that thread (cant remember what I did though, was simple I think):-
Thank you, I've just got it up working on remote machine, and serving to local machine via TcpServer(), Tcpsource(), pair, works fine. :)

Reel.Deel
23rd August 2021, 19:42
Hi StainlessS,

I think I found a bug when anti-aliasing is disabled and the colorspace is YUV. The problem can be most easily seen when the input is YV16 but is is also noticeable with YV24 and YV12. With YV12 is seems the halo color disappears.

ColorBars
ConvertToYV16()
SubtitleEx("TEST", x=240, y=240, effects="n", size=72, textcolor=$00FF0199, halocolor=$0047982F)

StainlessS
23rd August 2021, 20:54
Crap, I hated trying to fix that one.
If it aint been fixed after some reasonable amount of time, bug me again.
(busy)

EDIT: I dont think I touched anything like that, maybe bug in original too.
Maybe can you check in original 32 bit, or maybe bug even in AVS itself [or windows],
think maybe it uses AVS for text rendering incl anti-alias, I only touched print coords and the like,
would not have ani idea about text rendering itself.

StainlessS
23rd August 2021, 21:30
For anyone interested


#ColorBars
blankclip
# TOP Image in RGB
SubtitleEx("TEST", x=240, y=320 -64, effects="n", size=72, textcolor=$00FF0199, halocolor=$0047982F)
ConvertToYV16()
# BOT image in YV16
SubtitleEx("TEST", x=240, y=320, effects="n", size=72, textcolor=$00FF0199, halocolor=$0047982F)


https://i.postimg.cc/HcH24B6C/RD-00.png (https://postimg.cc/HcH24B6C)

EDIT:

#ColorBars
blankclip
# TOP Image in RGB
SubtitleEx("TEST", x=64, y=400 -180, effects="n", size=240, textcolor=$00FF0199, halocolor=$0047982F)
ConvertToYV16(Matrix="rec601")
# BOT image in YV16
SubtitleEx("TEST", x=64, y=400, effects="n", size=240, textcolor=$00FF0199, halocolor=$0047982F)

Spline36Resize(Width*2,Height*2)

https://i.postimg.cc/mDVtbdsf/RD-01.png (https://postimg.cc/JDD1x50P)

RD, is the disappearing halo only because its on colorbars.
Seem to be halo on blankclip so maybe just interference due to subsampling and colorbars colors.

EDIT: Previous script, changed to colorbars. Top RGB32 Bot YV16
https://i.postimg.cc/fyKFq9mv/RD-02.png (https://postimg.cc/GT4qH9MB)
Halo seems to be sorta transparent, presume that its not supposed to be.

Swapped Top YV16, Bot RGB32

ColorBars
#blankclip
SubtitleEx("TEST", x=64, y=400, effects="n", size=240, textcolor=$00FF0199, halocolor=$0047982F) # BOT Image RGB32
ConvertToYV16(Matrix="rec601")
SubtitleEx("TEST", x=64, y=400 -180, effects="n", size=240, textcolor=$00FF0199, halocolor=$0047982F) # TOP Image in YV16
Spline36Resize(Width*2,Height*2)

https://i.postimg.cc/fyKFq9mv/RD-02.png (https://postimg.cc/GT4qH9MB)

Sorta transparent halo there too, dont know if is supposed to be.

Reel.Deel
23rd August 2021, 21:43
The original SubtitleEx by Basilik seems to be fine. I could only test in YV12 and YUY2. Although in RGB the results are different, in the case of anti-aliasing I would think the output of the original is more correct.

ColorBars
ConvertToYUY2()
o = SubtitleEx_o86_SubtitleEx("TEST", x=240, y=240, effects="n", size=72, textcolor=$00FF0199, halocolor=$0047982F)
n = SubtitleEx_x86_SubtitleEx("TEST", x=240, y=240, effects="n", size=72, textcolor=$00FF0199, halocolor=$0047982F)

Interleave(o,n)

StainlessS
23rd August 2021, 22:14
OK, Ill take a look when i get time.
Maybe just Halo Alpha wrong somewhere.

Reel.Deel
23rd August 2021, 22:18
OK, Ill take a look when i get time.
Maybe just Halo Alpha wrong.

Thank you StainlessS. I was trying to make a script to allow overlaying the subtitles onto HBD colorspaces without having to convert the video to 8-bit but could not get the same output as using SubtitleEX by itself. I will wait :)