Subtitler lite mod v1.3 Original

VLC Extensions

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on git.opendesktop.org

0
Score 52%
Description:

"Subtitler (lite) mod.lua" - A semiautomatic workaround for VLC-2.1+ with [refresh] button in the dialog box that should be pressed periodically during playback. Just use it with some button presser / key sender (see USAGE below).
"Subtitler (lite).lua" - The extension works only in VLC-2.0.x. The automatic solution should not be forgotten. VLC archive: http://download.videolan.org/vlc/

Subtitler (lite) is VLC extension that displays subtitles on the screen in a playing video and/or in a dialog box. Now you can watch your film with 2 different subtitles. Subtitler (lite) mod now can SKIP unwanted scenes (intro, credits, commercials, unimportant scenes, ...) or MUTE selected scenes.

DOWNLOAD:
- save the .zip file
INSTALLATION:
- extract (unzip) the .lua file and put it in the VLC subdir /lua/extensions, by default:
* Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\extensions\
* Windows (current user): %APPDATA%\VLC\lua\extensions\
* Linux (all users): /usr/lib/vlc/lua/extensions/
* Linux (current user): ~/.local/share/vlc/lua/extensions/
* Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/extensions/
* Mac OS X (current user): /Users/%your_name%/Library/Application Support/org.videolan.vlc/lua/extensions/
(create directories if they don't exist)
- Restart VLC or just reload extensions (Tools > Plugins and extensions > Active Extensions tab: Reload extensions button).
USAGE:
Then you simply start the extension in VLC menu "View" or "Vlc > Extensions" on Mac OS.

The extension will try to load SRT subtitle file of the same name and location as a playing media ("d:\films\film.avi" --> "d:\films\film.srt").
Subtitler (lite) mod: Then you need to keep pressing the [refresh] button in the dialog box. You rather use some button presser / key sender. Following ones are included in the package:
- "keypresser(Windows).vbs", a simple VBScript for Windows users;
- "buttonpresser(Mac).applescript", a simple AppleScript for Mac OS X users
http://addons.videolan.org/content/show.php?content=152364&forumpage=1#c473169
- "keeping-press-enter(Linux).sh" - Linux, xdotool - A shell script:
http://wikiwiki.jp/disklessfun/?misc1#e976f4fa
"sleep 0.1" or "usleep 100000" instead of "sleep 1"?
- "subtitlerlite.ahk" - AutoHotkey script for Windows:
https://forum.videolan.org/viewtopic.php?f=29&t=97791&start=40#p407054

To set up the Subtitler (lite), please edit global variables at the beginning of the script:
http://forum.videolan.org/viewtopic.php?f=29&t=97791#p346506
subtitles_uri = nil
The default value nil means, that the variable subtitles_uri is not defined and the script automatically looks for a SubRip (SRT) subtitle file of the same name and location as a playing media ("d:\films\film.avi" --> "d:\films\film.srt"). You can customize the "srt" extension in filename_extension variable (see below).
You can set your custom uri ("file:///D:/films/subtitles.srt"). A web browser can help you to encode a path in uri format (Firefox: open a file (drag&drop) in the browser, right-click, show info).
output_dialogbox = false
Set the value true or false. If it is true, then it displays subtitles in the dialog window.
output_osd = true
It displays subtitles in a playing video. If a video is not available (audio files), then it automatically displays subtitles (lyrics) in the dialog box.
osd_position = "top"
You can place subtitles in a playing video on "top", "top-left", "top-right", "left", "center", "right", "bottom", "bottom-left", "bottom-right".
charset = "Windows-1250"
Set an appropriate code page of your subtitle files (Western European subtitles "Windows-1252"). UTF-8 charset is automatically detected, but you can force it if you want. nil value also means "UTF-8" charset.
filename_extension = "srt"
You can set your custom extension for your subtitles dedicated to Subtitler. You can set a language code ("eng.srt") or you can set some other extension ("srt-vlc") as a subtitle file now can contain commands for Subtitler (lite) mod.
execute_commands = true
The default value executes commands [skip], [mute] found at the beginning of a subtitle text. You can use any subtitle editor with SRT support (Subtitle Edit http://www.nikse.dk/subtitleedit/ , Aegisub http://www.aegisub.org/ ) or just any ordinary text editor (Notepad) to create/edit SRT subtitles/scripts/cutlists for Subtitler (lite) mod.

Forum location: http://forum.videolan.org/viewtopic.php?f=29&t=97791

Donation:
If you find this extension interesting, your donation is welcome at http://www.videolan.org/ to encourage developers to do some maintenance and improvements of Lua Extensions support in VLC.
https://trac.videolan.org/vlc/ticket/8097
https://trac.videolan.org/vlc/ticket/3883

Last changelog:

v1.3 (14.5.2018) 9 months ago

- VLC 3 microseconds fix.

conehead

4 years ago

http://addons.videolan.org/content/show.php/VLSub+0.9.11?content=148752

"VLSub is not working with Vlc 2.1.x on any platform because the lua "net" module needed to interact with opensubtitles has been removed in this release for the extensions.
Works with Vlc 2.2 on mac and linux."

VLC 2.2 for OS X has yet not been release.

Report

syndicate01

4 years ago

I want to load up the sub titling software for my use with your vlc
player, but can, as i don;t know what the hell it is that i'm looking
at on the one page, supposedly with all of the information regarding it!!!!..
how am i going to use, what's not there, and what i can't understand, even
if it is there?!?!?!?!?!?!?..

Report

calonix

4 years ago

Hi Mederi
you can write that solution in a lua extension?
If you got it upload it, please.

Report

calonix

4 years ago

thank you! Mederi.
You got it.
It's really usefull.

Report

C

mederi

4 years ago

It is possible to modify the script and add a Refresh button in the dialog box. Then you could keep Enter key pressed down to keep updating subtitles on the screen. It is possible to use some "keypresser", an external application, to automatically send presses of Enter key in the dialog box window of this extension.
You can test this method on Animated ASCII Art extension: http://addons.videolan.org/content/show.php?content=162229
Interested?

Report

calonix

4 years ago

thank you! You got it!
it's really usefull.

Report

calonix

5 years ago

Could you fix that issue, please.

Report

C

mederi

5 years ago

Ticket #8097
Lua Extensions, VLC2.1: var.add_callback( ), var.del_callback( ) do not work
http://trac.videolan.org/vlc/ticket/8097
Some willing C++ developer could help.

Report

C

mederi

5 years ago

http://forum.videolan.org/viewtopic.php?f=29&t=112220#p382214

* find line 134> if actual_time>=v[1] and actual_time<=v[2] then
* insert next new lines>
Quote: if string.match(v[3], "It's been a long road")~=nil then
local duration = vlc.var.get(input,"length")
vlc.var.set(input,"position", (v[1]+80) / duration)
break
endJumps 80 seconds ahead if subtitle text "It's been a long road" should appear.

Report

calonix

5 years ago

Tips to load subtitle in VLC with subtitler:
- Your subtitle should get same video's name
- subtitle codification should be UTF-8 not UNICODE, UCS-2 Little Indian, etc.

thanks mederi!

Report

ENigma885

5 years ago

"Your subtitle should get same video's name"
How are you going to name 2 subtitle files with the same name in the same folder? or did I misunderstand that point?

Report

calonix

5 years ago

I mean. If I have video's name as "video.mp4" then your subtitle must called as "video.srt" to get it in pist 1 on VLC.
Now if you have two subtitles, you should called both with same root name. Something like these: video.srt (pist 1) and video_english.srt (pist 2). Where root name is "video".
Subtitler only reads subtitle in pist 1 not in pist 2 or above.
For example, in my case "video.srt" is in spanish so I have to configure charset="UTF-8" into extension subtitler code to read punctions signs of latin language.

I hope have been clear.
Regards

Report

calonix

5 years ago

I mean. If I have video's name as "video.mp4" then your subtitle must called as "video.srt" to get it in pist 1 on VLC.
Now if you have two subtitles, you should called both with same root name. Something like these: video.srt (pist 1) and video_english.srt (pist 2). Where root name is "video".
Subtitler only reads subtitle in pist 1 not in pist 2 or above.
For example, in my case "video.srt" is in spanish so I have to configure charset="UTF-8" into extension subtitler code to read punctions signs of latin language.

I hope have been clear.
Regards

Report

laixix

6 years ago

You can check this please, I did a debug script errors, and apparently the load script but the "Function Load_subtitles ()" not doing his job as he is not initialized blank window.

xcb_xv debug: display is visible
xcb_xv debug: display is visible
main debug: auto hiding mouse cursor
qt4 debug: activating or triggering extension 'Subtitler (lite)'
lua debug: Activating extension 'Subtitler (lite)'
lua debug: Creating dialog 'Subtitler (lite)'
lua info: home/neutron/Descargas/a.srt
xcb_xv debug: display is visible
qt4 debug: Creating a new dialog: 'Subtitler (lite)'

Report

laixix

6 years ago

for some reason the subtitle is not charging me perhaps you could explain a little more about your programming and also see if I can make some modifications.

Report

C

mederi

6 years ago

There is no error in the messages you provided.
All is solved in the VLC forum: http://forum.videolan.org/viewtopic.php?f=29&t=97791&start=20#p365954
It really should work if you set a proper Linux path to your subtitle file in "subtitles_path" Global variable at the beginning of the script. Somethig like:Quote:subtitles_path = "/proper Linux path to your SRT file.srt"Can you see activated Subtitler (lite) dialog box on the screen at least? Then if you load some film in VLC player, the extension should load and parse SRT file and you will see it in the dialog box.
Or you can try automatic detection of subtitles. Then:Quote:...
subtitles_path = nil
...
media_uri = "/"..string.gsub(media_uri, "^.-///(.*)%..-$","%1")
...
I have planned later to publish a new version of the extension with the fixed bug for Linux and some new features (controls, timing (delay +/-, fps), ...), but currently I have just lost motivation because VLC2.1 does not support callbacks in Lua.
If you can C++ programming, you could help developers to fix this Lua issue.

Report

laixix

6 years ago

it appears the box but does not read the. srt, but to top the box blank is initialized, right!! there is something that you still do not understand, if subtitle == nil thenfor i, v in pairs (subtitles) doif actual_time> = v [1] and actual_time <= v [2] then, my question is, which takes the matrix values​​, and what is the value of actual_time???sorry if I make lots of questions but based on your script I make my script.

Report

laixix

6 years ago

I understand, it is regrettable that no callback function vlc.var.add functions, I'm looking for a way to program it in c + + but I need more information on this function to print data from the subtitles in vlc screen. or about the operation of the function add_callback.

Report

laixix

6 years ago

I found the libraries for add_callback function call, maybe if we mix with c + + lua script will run without problems the script. 

This is the page

http://fossies.org/dox/vlc-2.0.5/vlcproc_8hpp.html

Report

laixix

6 years ago

here the funtion var_DelCallback
http://fossies.org/dox/vlc-2.0.5/marq_8c.html#a52c6c12dc0d5a53ecb52bfee7c20e62c

Report

C

mederi

6 years ago

I have just found this opinion/decision of developers:
http://mailman.videolan.org/pipermail/vlc-devel/2012-March/087604.html
http://mailman.videolan.org/pipermail/vlc-devel/2012-April/087652.html
You can also read previous messages that lead to these ones there.

I understand this as a GAME OVER! Extensions are evil...

If you still need something from me, then we should continue our discussion on VLC forum through private messages.

Report

laixix

6 years ago

would like to help and I was wondering where I can find a manual for developing extensions for vlc or other programs in Lua is what I need if I may I can also help you modify the code and implement new ideas.

Report

C

mederi

6 years ago

http://forum.videolan.org/viewtopic.php?f=29&t=98644#p330318
is a good start where I gathered available information. Then here is the manual for you:
1.) Global VLC Lua README.txt: http://www.videolan.org/developers/vlc/share/lua/README.txt
2.) Lua 5.1 Reference Manual: http://www.lua.org/manual/5.1/
3.) Lua tutorials: http://lua-users.org/wiki/TutorialDirectory
4.) non-compiled VLC Lua scripts (like in VLC1): http://www.videolan.org/developers/vlc/share/lua/
5.) http://addons.videolan.org/
6.) VideoLAN Forum - Scripting VLC in Lua: http://forum.videolan.org/viewforum.php?f=29

Report

laixix

6 years ago

thanks my friend ,There are some problems in the compatibility of the extensions in linux, will try to fix them, but just one last thing, you could do a little summary about the functions implemented in this script .... I greatly appreciate it and thank you for your feedback.

Report

v1.3 (14.5.2018) 9 months ago

- VLC 3 microseconds fix.

6 years ago

Subtitler (lite) mod 1.2 (2.11.2014) 33650
- support for [skip] and [mute] commands at the beginning of subtitle text
- autodetection of UTF-8 charset of loaded subtitles
- different method of loading subtitles (URI) now should not have any problem to load subtitle files with paths containing also other than Basic Latin (non-ASCII) characters

Subtitler (lite) mod 1.1 (29.3.2014)
- a workaround for VLC-2.1+ with [refresh] button in the dialog box that should be pressed periodically during playback. Some software button presser or key sender is recommended. A simple VBS script for Windows users is included in the package.

Subtitler (lite) 1.0 (13.7.2012)
- initial release based on vlc.var.add_callback() function removed since VLC-2.1

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
Details
license
GPLv2 or later
version
updated Aug 28 2018
added Jul 13 2012
downloads today
0
page views today 121
System Tags addon gplv2-later