AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > Anime Related Topics > General Anime > Fansub Groups

Notices

Reply
 
Thread Tools
Old 2013-04-19, 20:43   Link #1
Youkakun
Junior Member
*Fansubber
 
 
Join Date: Mar 2012
Location: Germany
LVS - my personal Overlua follower

For those who didn't discovered it in Aegisub forum already, i present my personal follower of Overlua here: LVS.

Personally i use it for typesetting, karaoke effects, image creation and some video effects.
Opening AvsPMod -> writing the Avisynth script for video & LVS loading -> writing the LVS input script while refreshing AvsPMod to see the results -> encode Avisynth script.
It's some Lua programming with a graphics kit, but all-in-all easier and more powerful than Overlua (and active).
In comparison, some advantages:
  • More up-to-date Lua (v5.2) with utf-8 support on windows
  • Simpler and larger API
  • Better text support (with windows fonts)
  • Advanced ASS parser
  • Fast image convolution with arbitrary kernels
  • PNG im- & export
  • Autoload folder for standard included scripts
  • Mesh gradient
  • ...

I've already thought about writing a GUI, but using it with AvsP is comfortable enough. Maybe it could be the core of NyuFX 2... i don't know.
Other plugin interfaces shouldn't be a problem and i've already implented a ffmpeg demuxer [1][2] in NyuFX 1.6, so this project could have a future

I tried to write a lot of documentation, like easy usage examples, html documents and many comments in source code.
Feedback would be nice and contributors are welcome.

Last edited by Youkakun; 2013-04-20 at 12:18.
Youkakun is offline   Reply With Quote
Old 2013-05-01, 01:43   Link #2
fgghjjkll
Junior Member
 
Join Date: Jan 2011
Interesting project. I will probably look into this soon.
Though it is easier than OverLua, do you still need to be a masochist to use it effectively?
fgghjjkll is offline   Reply With Quote
Old 2013-05-01, 02:13   Link #3
Youkakun
Junior Member
*Fansubber
 
 
Join Date: Mar 2012
Location: Germany
Not really.
A big set of functions, good documentations and lot of commented examples should make it much much easier to learn and use than Overlua. A folder for autoloading scripts serves as external library place, so users can extend the environment and share this way their LVS extensions.
Youkakun is offline   Reply With Quote
Old 2013-10-06, 19:24   Link #4
Youkakun
Junior Member
*Fansubber
 
 
Join Date: Mar 2012
Location: Germany
LVS took his way to version v1.3, became more powerful + fast, bugs were fixed and tests made by creating typesets and karaoke effects.

One script for a simple karaoke effect could look like this:
Code:
-- Parse ASS file and fill global tables
ass.load("my_ktime.ass")

-- Roumaji & Kanji
local function roumaji_kanji(ctx, ms, line)
	-- Iterate through sylables
	for _, syl in ipairs(line.styleref.alignment < 7 and line.chars or line.syls) do	-- Use characters in case of kanjis
		-- Set color dependent on sylable activity
		ctx:set_source(ms >= syl.start_time and ms < syl.end_time and g2du.red or g2du.yellow)
		-- Draw sylable text
		ctx:path_add_text(syl.x, syl.y, syl.text, ass.unpack_font(line.styleref))
		ctx:fill()
		ctx:path_clear()
	end
end

-- Subtitle
local function subtitle(ctx, line)
	-- Draw line text
	ctx:path_add_text(line.x, line.y, line.text, ass.unpack_font(line.styleref))
	ctx:set_source(g2du.yellow)
	ctx:fill()
	ctx:path_clear()
end

-- Process frames
function GetFrame(frame, frame_i)
	-- Create drawing context for frame
	local ctx = frame:get_context()
	-- Get frame time
	local ms = frame_i / VIDEO_FPS * 1000
	-- Look for frame-related ASS lines
	for _, line in ipairs(lines) do
		if ms >= line.start_time and ms < line.end_time then
			-- Draw ASS line
			if line.styleref.alignment > 3 then
				roumaji_kanji(ctx, ms, line)
			else
				subtitle(ctx, line)
			end
		end
	end
end
It's just a color change of active sylables, but imagine to use gradients and pictures, invert frame colors, deform text like clay, use various convolution filters, work with audio data, etc.

More informations:
Online docs
Samples
Youkakun is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
We use Silk.