[Extension] subtitler >> External / Dual subtitles

Discuss your Lua playlist, album art and interface scripts.
iamtodor
New Cone
New Cone
Posts: 8
Joined: 07 Mar 2018 09:00

Re: [Extension] subtitler >> External / Dual subtitles

Postby iamtodor » 29 Jan 2019 11:20

Any plans to implement this feature? I would donate you for 10$ for an opportunity to turn on 2 different subtitles :)

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] subtitler >> External / Dual subtitles

Postby mederi » 29 Jan 2019 15:46

You can already use this extension to show subtitles from an external srt subtitle file. The usage is a bit cumbersome (an external button presser required), but at least it works. You can also show subtitles in a dialog box window (useful with audio files or current text-to-speech integration). Then you can turn standard VLC subtitles to a different source.

kielerrr
New Cone
New Cone
Posts: 1
Joined: 24 Aug 2019 23:57

Re: VLC Extension: subtitler >> External / Dual subtitles

Postby kielerrr » 25 Aug 2019 00:05

Is it possible to send a keystroke to an inactive window (without activating the "Subtitler (lite) mod" window)?
Is it possible to remember current active application (window), then temporarily activate a dialog box of some VLC Lua Extension and then reactivate the previous application using the AutoHotkey?
I had trouble with the original AHK script as well, as it requires the window to be focused. The AHK code below will send the Enter command even if the Subtitler window is minimized. It doesn't interfere with any other windows unless that window also contains 'Subtitler (lite) mod' in the window title. Tested in AHK 2.0 but I'm pretty sure it can easily be run in 1.0 as well.
This runs automatically, so make sure the subtitler window is active. Press escape to terminate.

Code: Select all

#SingleInstance TargetWindw := "Subtitler (lite) mod" #If WinExist (TargetWindw) MsgBox "Starting Subtitler" while WinExist(TargetWindw) { Sleep 100 ControlSend "{Enter}",,TargetWindw } return Esc:: MsgBox "Ending Subtitler" ExitApp return
Edit: Added esc key

jmon12
New Cone
New Cone
Posts: 6
Joined: 11 Oct 2020 23:09

Re: [Extension] subtitler >> External / Dual subtitles

Postby jmon12 » 13 Oct 2020 18:31

First of all thank you for your very useful extension! VLC 4 is supposed to have this feature, but I compiled it from source and didn't find a way to make it work. See this post /https://forum.videolan.org/viewtopic.php?t=154662 and the corresponding feature request https://trac.videolan.org/vlc/ticket/824#no1.

Your extension works like a charm for me under Arch linux, kernel 5.8.14-arch1-1 (with KDE desktop environment), and vlc 3.0.11.1.

However, I have a problem with the use of xdotool and your extension to automatically refresh, without focusing on the Subtitler dialog window. The following (very simple) bash code works as expected, except when the focus is on the main VLC window, which obviously what I want.

Code: Select all

TITLE="Subtitler \(lite\) mode" while true do xdotool search --name "${TITLE}" key "Return" sleep 0.1 done
I'm neither an expert of xdotool or VLC, but I think that's not related to xdotool, and a superficial research didn't prove me wrong yet. Any clue where that could come from in your implementation?

I would be very happy to contribute, at least for testing a few scenarios if you give me some clues, but I might not be the most competent to solve the problem on my own.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: [Extension] subtitler >> External / Dual subtitles

Postby mederi » 14 Oct 2020 14:11

I believe the feature is already implemented in VLC 4. Are you sure that you cannot select the secondary subtile track in VLC menu if you load several subtitles for a playing video? Last year VLC 4 NB did not work for me on a weak Windows 7 netbook (some OpenGL error). I will try it again.
As for the extension, the question is whether it is possible to send "Enter" key strokes to a dialog box without focusing that window. In previous post user kielerrr says AHK script can do it on Windows.

jmon12
New Cone
New Cone
Posts: 6
Joined: 11 Oct 2020 23:09

Re: [Extension] subtitler >> External / Dual subtitles

Postby jmon12 » 14 Oct 2020 14:46

Thank you for your quick answer.
I didn't extensively visit the UI of VLC 4, but didn't find a way to add the second subtitles track. And didn't find anyone who succeeded on the internet neither. I'll search further. If you succeed in making it work on Windows, please let me know.

Yes it is possible to send the keystroke without the Window being active. My very simple script works with any window focused, except the main VLC one. This is why I think that it is somehow related to the extension, but that's just a guess.

jmon12
New Cone
New Cone
Posts: 6
Joined: 11 Oct 2020 23:09

Re: [Extension] subtitler >> External / Dual subtitles

Postby jmon12 » 16 Oct 2020 12:20

OK I finally understood how to make it work with VLC4, see this post https://askubuntu.com/questions/216734/ ... ltaneously.

I updated the corresponding thread: https://forum.videolan.org/viewtopic.ph ... 04#p509704.

Your extension finally becomes legacy, thank you for the great work!

Kaka123
New Cone
New Cone
Posts: 1
Joined: 22 Jan 2022 00:18

Re: [Extension] subtitler >> External / Dual subtitles

Postby Kaka123 » 22 Jan 2022 00:22

Hello, I don't find the option "Tools>Preferences>Subtitles/OSD>Dual Subtitles" on any version of vlc 4.0 win64 :/.
Thanks you for any response :)


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 17 guests