
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
"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
v1.3 (14.5.2018) 2 years ago
- VLC 3 microseconds fix.
v1.3 (14.5.2018) 2 years 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
homayoon
6 months ago
Report
alesmuc
10 months ago
and not in ~/.local/share/vlc/lua/extensions/ as written up in this guide.
I discovered it locating the VLsub (a plugin that comes by default in vlc) folder with the Nautilus search.
Anyway the plugin still doesn't work. Activating the plugin from the view vlc menu it works only opening video with no subtitles file (giving the instructions), while opening video with same name srt subtitles file nothing happens at all.
Then I tried to install on windows 10, discovering that the right folder to place the file "Subtitler (lite) mod.lua" is %APPDATA%\Roaming\vlc\lua\extensions\ and not %APPDATA%\VLC\lua\extensions\ as written in this guide. In this way the plugin works properly on windows 10, while still I don't get it to work on ubuntu 20.04. Can please anybody help?
Report
mederi
10 months ago
Report
gabzil
1 year ago
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
mederi
1 year ago
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
gabzil
1 year ago
(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
mederi
1 year ago
Report
gabzil
1 year ago
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
mederi
1 year ago
if subtitle==nil then
Then try to add the condition there:
if subtitle==nil and vlc.playlist.status()=="paused" then
Report
gabzil
1 year ago
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
gabzil
1 year ago
What do suggest me ? Th
Report
gabzil
1 year ago
Report
mederi
1 year ago
elseif subtitle~=nil then
Report
gabzil
1 year ago
Thanks to help me :) I keep working on this :)
Report
gabzil
1 year ago
Report
alanbill
4 years ago
Report
mederi
5 years ago
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
mederi
5 years ago
Report
surferau
6 years ago
data = file:read(500000)
and add after
data = string.gsub(data, "\r", "")
Report
mederi
6 years ago
Report
surferau
6 years ago
Report
mederi
6 years ago
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
6 years ago
Report
mederi
6 years ago
Report
mederi
6 years ago
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