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 opencode.net

2
Score 63.8%
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) 1 year ago

- VLC 3 microseconds fix.

10

gabzil

3 months ago

Hello
thanks a lot for this programm *_*
i would like to change the condition to display the subtitle when the player is in "pause" but it doesn't work yet :'(
maybe it is not possible but if it is can somebody help me ?
thanks for your answer :)

Report

C

mederi

2 months ago

[2]
Following solution does not need pressings of the button in the dialog box (v1.3).
Line 28>
capabilities = {"playing-listener"}
Line 42> --Define a callback function here by inserting following new lines:
function playing_changed()
input_events_handler()
subtitle=nil
end

Really not a bad idea I could add in the future version.

Report

10

gabzil

2 months ago

Hi, It is working wonders *_*
(I couldn't do it alone, I absolutely not thought about this. You know VLC script very well 0_o )
Thanks a lot for your work, I was thiking to this for long time but I couldn't find it on the net. You should release it, you'll probably have a lot of success :) [it's indeed so helpful to learn a foreign language and very adapted]
Congratulation for your amazing work and thanks a lot again. you make me so happy and I'll think to you each time I'll use VLC.
I wish you a lot of success :)

Report

C

mederi

2 months ago

So do you want to display subtitles only when you pause a playback and do not show them during normal playback?

Report

10

gabzil

2 months ago

Hi,first I'm glad you aswer me, I'm veryhappy, thanks a lot to take time to answer me.
Yes that's it. I would like to do this to improve my English. So I would to always display the first subtitle [easy I have nothing to do :)] but when i don't understant i would like to display a second subtitle as you do with this plugin when i stop the movie. Then i do play and then the second subtitle disappear . I think it should be not so hard you've already done the script but I failed to understand the all script well.
It could help a lot of people who are learning foreign language :)
thanks again

Report

C

mederi

2 months ago

Find the following line:
if subtitle==nil then
Then try to add the condition there:
if subtitle==nil and vlc.playlist.status()=="paused" then

Report

10

gabzil

2 months ago

When I tried I change the wrong condition (line 69 instead of 103) but it's still not working :(
I tried with an "or" instead of "and" but it's not better.
I ask myself if the problem is not linked with the dialogue box

Report

10

gabzil

2 months ago

But I think I don't understand well the program, beaucause when I replace the condition line 103 ("if subtitle==nil then") by "if true then" i thought it should always display the subtitle but no. so if I add here vlc.playlist.status()=="paused" it doesn't work.
What do suggest me ? Th

Report

10

gabzil

2 months ago

thanks for your answer*

Report

C

mederi

2 months ago

Also edit related "else" command in line 136 (v1.3) to:
elseif subtitle~=nil then

Report

10

gabzil

2 months ago

thanks I forgot to do that but it is not enough to do it :(
Thanks to help me :) I keep working on this :)

Report

10

gabzil

3 months ago

10 10 the best

Report

alanbill

3 years ago

I would suggest you to use PlayerXtreme. A couple of times, it was difficult for everyone to understand the vocals. So people need a player that support subtitles with proper stability. I discovered PlayerXtreme in this category, the best app till now. It allows you to restyle and resize the subtitles. You can also download new subtitles by using its download subtitles feature. It also supports all popular formats of subtitles. It allows Closed Captioned (CC), SRT, SMI, TXT and more. It has also the capability to play approximately 40 formats without any conversion

Report

C

mederi

4 years ago

Quote:http://addons.videolan.org/content/show.php?content=152364&forumpage=1#c477914
On Linux
by KqdK2J4K on: 12 hours ago

http://wikiwiki.jp/disklessfun/?misc1#e976f4fa
Thank you for sharing your script. I will put it in description and package of the extension.

Report

C

mederi

4 years ago

Quote:sleep 1This command waits 1 second that might be too long. Try to use "sleep 0.1" instead of "sleep 1" or use "usleep 100000" with microseconds. I cannot test it as I am on Windows XP. Please somebody let me know the best solution.

Report

surferau

5 years ago

locate the string in "Subtitler (lite) mod.lua" file
data = file:read(500000)

and add after

data = string.gsub(data, "\r", "")

Report

C

mederi

5 years ago

What OS?

Report

surferau

5 years ago

Pretty much any since the regular expression which used to parse the srt file does not take in mind that in windows line endings are \r\n not just \n . That means any srt file made under windows will not work.

Report

C

mederi

5 years ago

Well, the script works well for me on my system Windows XP, VLC 32-bit. The "\r\n" EOLs are automatically converted to "\n"s by the file:read() function.
Please confirm conditions when is the different behavior. VLC 64-bit? Linux or Mac? I cannot test it, but it is really possible that you are true and additional line of code is necessary there.

Report

surferau

5 years ago

Did not work on MAC OS

Report

C

mederi

5 years ago

Hi, surferau! Please confirm whether the new version (1.2) of Subtitler (lite) mod works on Mac OS X. Thanks.

Report

C

mederi

5 years ago

Was it the same crash as was already reported here by conehead on May 31, 2014, and the additional line of code is the solution?
http://addons.videolan.org/content/show.php?content=152364&forumpage=1#c465569
The script should not crash. It just should not find any subtitles in the file. I can pass all necessary information to VLC developers to fix this crashing issue and I can update the script.
Is there any method to send "Enter" keystrokes automatically and periodically into the "Subtitler (lite) mod" dialog box on Mac OSX? Any script or application?
Thank you for your report and solution.

Report

francalba

5 years ago

Hello Mederi, congratulations for your app: \"Subtitler (lite) mod.lua\"

I would very pleased if you could tell me what lines of your program do I have to change for keeping always the subtitle on the screen.

Thanks in advance.
F. Alba.

Report

C

mederi

5 years ago

What do you mean by "keeping always the subtitle on the screen"?

Report

francalba

5 years ago

I mean that the subtitles is enabled on screen always, without the need of pushing Refresh button.
Thank you.

Report

v1.3 (14.5.2018) 1 year ago

- VLC 3 microseconds fix.

5 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

12345678910
121
product-maker gabzil Dec 28 2019 10 the best
10 the best
product-maker darvishrishi Jan 27 2015 9 excellent
product-maker calonix May 14 2013 9 excellent
product-maker diegocarrera Apr 20 2013 3 bad
product-maker Base: 4 x 5.0 Ratings
gabzil
Dec 28 2019
sneetsher
Oct 10 2019
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
GPLv2 or later
version
updated Aug 28 2018
added Jul 13 2012
downloads 24h
49
mediaviews 24h 0
pageviews 24h 310
System Tags addon gplv2-later