VCL web plugin : can't get subtitles to show up

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

VCL web plugin : can't get subtitles to show up

Postby zeepee » 17 Nov 2012 02:33

Bonjour tout le monde :)

I have dev'ed a simple web "applet" (html, css and javascript/ajax - that's all) that allow me to view/listen to TV or radio channels in a more user friendly way than the VLC app allows.

Platform : Win7 Ultimate x64, Firefox (latest) only (don't wanna deal with IE when I don't *have* to :), VLC 2.0.4 with accompanying web plugin. With this setup I'm streaming (rtsp) TV/radio channels from a "Freebox" (our french friends here will know) which provides classic triple-play services (phone, internet, tv/radio), the applet allows me to simply switch channel, control volume, switch language (esp. for Arte TV), etc...

Now the problem : though I'm able to switch language (change audio track), I can't seem to be able to get the subtitles to show up on the video - although they do show up if I stream the same TV channel using VLC the app, not the plugin. The plugin does find about subtitle tracks and their description, I can select a subtitle track (using vlc.subtitle.track) - however, subtitles do NOT appear on the screen.

Has anyone here bumped on this issue ? Is there a fix/workaround for this ? Or maybe my setup is incorrect...?

TIA for your help. ;)

P.S. I also have the dreaded volume change delay problem, which I have fixed on the VLC app ( http://trac.videolan.org/vlc/ticket/5654 ), however the fix does not apply to the web plugin. Not as critical as the above issue though.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VCL web plugin : can't get subtitles to show up

Postby Jean-Baptiste Kempf » 19 Nov 2012 11:18

VLC cannot play srt subtitles over a .ts source
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 19 Nov 2012 12:17

Thanxx for answering.

You mean the VLC plugin I suppose ? Like I said, using VLC (the app, not the plugin) the subtitles do work for the very same TV channel (ArteHD) whereas no way to get them with the plugin... :(

Btw you mention "srt subtitles", I'm not sure this is the format used by Free to add subtitle tracks to their TS streams (maybe it is, I just don't know, usually it's a basic format used to add subtitles to existing video/movies that don't have any, not s'thing you'd expect from a content provider like Free).

john2k5
New Cone
New Cone
Posts: 1
Joined: 23 Jan 2013 12:28

Re: VCL web plugin : can't get subtitles to show up

Postby john2k5 » 23 Jan 2013 12:33

Not sure if this is what you are looking for? I needed to play embedded subtitles from a satellite stream in a web frontend, in the end I used a javascript timer event to trigger a specified subtitle track on page load. I used a 5 second delay, but this can be reduced to however long it takes your video stream to start playing.
Code is here: http://pastebin.com/wAq6XW3N
Feel free to use it if it helps.
John

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 29 Jul 2014 19:48

Quite a bump here ! :oops:

Am looking back into this issue right now, thanxx john for that piece of code I'll check it out on my setup (was about time I know ^^), apparently a timing issue, we'll see...

Or maybe this has been fixed in the latest VLC release ? (just installed 2.1.5 Rincewind)

Btw my setup has changed, I'm getting TV channels from a DVB-T card (usb "key" actually), not anymore from the "Freebox" adsl TV as mentioned in my 1st post above. What changed is that while I was previously able to at least switch audio track, I can't anymore, stuck with the default audio track (FR, mostly).


EDITH :

The funny thing is, right after I wrote this post (I've removed most of the initial post due to the findings that follow), I found out that while running the web interface, the url http://localhost:8080/requests/status.xml provides full information on the currently playing stream, including Audio tracks ID's and Subtitles tracks ID's.

Then I remembered reading in a VLC bug report that VLC needed the "PID" of the desired audio/subtitle track, not its rank/position in the list (ie 1, 2, 3, ...), so I immediately edited the applet source code to force the audio track to an audio track "ID" I found in the status.xml file (ID 732, which corresponds to a German audio track), restarted the applet, and... it worked, 1st time I'm able to switch audio language since I've moved from ADSL to DVB-T, feels great ! :)

Now I'm trying to do the same for the Subtitle track, however there are like 6 subtitles tracks listed in the status.xml file, each block looks like this :

Code: Select all

<category name="Stream 10"> <info name="Type">Subtitle</info> <info name="Description">DVB subtitles</info> <info name="Original ID">142</info> <info name="Language">French</info> <info name="Codec">DVB Subtitles (dvbs)</info>
with differing Stream # and "Original ID", tried a few of them but non worked. However when I tried to set subtitles using VLC the media player (not the web plugin), couldn't set subtitles either, so maybe either there's actually no subtitle for that specific program, or VLC is unable to display them.

I'll try this again tonight, hopefully I'll be able to make it work. Beside having to parse the xlm file (easy task though) the problem will be to identify the right track ID - right now I have no idea how to do that, will try all of them and see how it goes.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 29 Jul 2014 21:30

Ok instead of re-re editing my previous post I thought I'd create a new one ^^, just to say that FINALLY I've been able to get SUBTITLES to show up in the VLC web plugin. :)

What I did was first check with the media player that there was at least one subtitle track active in the chosen stream (ArteHD TV channel), found that the FR "DVB subtitles: hearing impaired" subtitle track was active, went to the status.xml file for that stream and found... *6* tracks listed as "DVB subtitles: hearing impaired" subtitles, oh well, then tried them one after next (by editing the applet code and restarting the applet), and finally the *last* one in the list (Murphy's law) did work !

Pretty happy about this, still quite some work to do to figure out how to code this into the applet and find the right track (no idea for now how to do this except try one at a time, worse yet this requires calling the media player somehow to get the track ID's), but at least I know it's feasible and that I won't have to entirely rewrite the applet using the VLC web interface (LUA api or s'thing) because I've tried to look into it and well... happy I can avoid it !

Hope this will help someone - or maybe I'm just a fool and this is already known by most people here ^^.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 30 Jul 2014 00:34

Alright, well after some more search I've found a corresponding "ticket" in the VLC bug tracking system :

http://git.videolan.org/?p=vlc.git;a=co ... 99aeccc022

which confirms what I wrote in previous post, the web plugin behaviour changed in a previous VLC release, now user's JS has to provide audio track *internal ID* (which depends on the stream) i/o the track number (1, 2, ...) before - however the plugin does NOT provide the ID's, so the user is left in the dark... (same applies to Subtitles ID vs number)

This sucks, what I don't understand is that at the e/o of that page this bug is marked as "closed" while in reality it's still unresolved. (unless I'm missing s'thing obvious)

At this point I'll try and see if the VLC web interface API can be used to return full information on Audio and Subtitles tracks, including their ID's (frustrating thing is that obviously the web plugin is able to identify and select the right tracks, only it "forgets" to return their ID's, which makes it useless in that respect... :?

If anyone here has found a workaround please chime in and let me know how you've done it - TIA. ;)

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 01 Aug 2014 15:51

Anyone ? No one ? :(

Is this bug (I suppose it's a bug) being worked on, has it been assigned to a specific release, or is it now "closed" and therefore ignored ? Doesn't seem like a complex task to fix it really (easy to say for s'one who's not going to do the job, I know), yet so very annoying...

More than 1400 reads (topic must be interesting I guess !) - and yet almost no answer. Goes beyond me.

P.S. Btw sorry for the typo in the title, hate it, but can't edit the 1st post anymore.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 11 Aug 2014 14:08

A quick post just to let you know that I've found a simple workaround for this bug, at least for the (only?) DVB-T channel here which regularly broadcasts movies, shows and docu's in original audio language with FR subtitles. ;)

miiatar
New Cone
New Cone
Posts: 1
Joined: 22 Aug 2014 10:33

Re: VCL web plugin : can't get subtitles to show up

Postby miiatar » 22 Aug 2014 10:35

Could you please share the workaround - I am struggling with the same problem..

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 09 May 2015 15:48

Sorry but obviously missed the previous post, in fact got back here by chance, looking for the resolution of another issue with the VLC Web plugin (DVB-T EPG info. not available, most vlc.mediaDescription.xxx properties return a "null" value, except for the .title which returns the location of the stream (eg "dvbt://frequency=522000000"), but no way to get the (now playing) program name, end time, etc...

Well, I'll take that unplanned opportunity to say that the latest VLC release (maybe even previous one ?) now has full support for selecting languages as well as subtitle tracks the way it is described in documentation (i.e. each track may be accessed via its track # 1, 2, 3 etc...). :D

Great news as far as I'm concerned, I had stopped using my vlc web plugin based applet for watching DVB-T tv (and used VLC the app because of that), now I'm back to it and loving it (so much more convenient with additional U/I features of my own taste) so that I'm probably going to spend the time to... rewrite it all over, add events handling, clean/simplify the current code, and add new features (radio channels streaming, multiple video sizes, u/i overlay on top of video frame, etc...).

Alright, thought it might be of interest to someone around here. I'm probably going to post the other issue in a better spot (at least a new topic).

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VCL web plugin : can't get subtitles to show up

Postby Jean-Baptiste Kempf » 09 May 2015 19:24

Alright, thought it might be of interest to someone around here. I'm probably going to post the other issue in a better spot (at least a new topic).
Well, we've been simplifying and reworking the plugin, lately. It should be more stable too.

The biggest issue is probably that you have no way to select the :program yet.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 09 May 2015 23:01

Looks like you've done some nice piece of work here, merci beaucoup pour tout ce travail. :)

As per the "EPG" issue, what I'm trying to do is at least be able to display the name of the program currently playing (by the selected TV channel), for instance a movie "American Beauty" on ArteHD channel (an absolute classic) I'd like my applet to be able to grab the program name from the web plugin and display "American Beauty".

It's just a matter of *reading* that information from the plugin, therefore I'm not sure why you mention "you have no way to select the :program yet", unless you just mean "select the program property to display it" .

Anyway I can survive without this, maybe I'll try to find a workaround, eg grab EPG information somewhere on the internet, though I don't think one can manipulate such stuff easily in JS alone, might have to call some php code from my TV applet.

Hopefully it'll be implemented sooner or later in the plugin, since the VLC app is clearly able to get it from the DVB-T stream and display not only the current program name but also full EPG info. for the selected channel (in the Tools->Program Guide menu).

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 10 May 2015 01:54

Just one last bit of info about this issue, I'm able to get data about stream buffering and other data like what appears to be the duration of the program currently playing since it started (using the VLC event "MediaPlayerTimeChanged"), so obviously the web plugin is actually able to grasp that (meta) data from the DVB-T input stream.

Should also be able to catch the program name which is just another piece of meta data, shouldn't it...?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VCL web plugin : can't get subtitles to show up

Postby Jean-Baptiste Kempf » 10 May 2015 12:04

It should, but it's not done yet.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 11 May 2015 00:53

Concise and clear, thanxx. Hopefully in the near future...

Sorry to be abusing a little here :oops: , new question : I've just added a mousewheel event handler (so that in the applet I can tune up or down the audio volume with a mouse scroll, same as in the VLC app). However this does not work if the mouse is over the video frame, I've had to enclose the vlc embed inside a DIV so that I could attach mouse events to that DIV and this now works fine.

Problem then of course, is that when I switch to full screen video the mouse scroll turns ineffective.

Is there any way to change this ? I'd love to be able to change the volume even when watching full screen video (as is possible with the app). Thanxx a bunch ! :)

(maybe "windowless=true" could in part fix this and at least avoid the need to enclose the embed inside a DIV, however it's not possible to switch video to full screen in the windowless mode - or at least I dunno how to do it)

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 01 Jun 2015 00:36

Just to mention that thanks to the above mentioned improvements in the web plugin, I've been able to add to my applet an "auto-switching" capability, such that when I select a TV channel the audio track would automatically switch to "original" if it's present - ie English most of the time i/o FR which is the native lang. here (and mine ^^) - and subtitles to FR.

Really neat and convenient (I hate watching dubbed movies), spares me many clicks/menu selections each time. :)

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: VCL web plugin : can't get subtitles to show up

Postby RSATom » 01 Jun 2015 09:55

Problem then of course, is that when I switch to full screen video the mouse scroll turns ineffective.
try WebChimera, all problems with mouse/keyboard events handling already solved there.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 01 Jun 2015 21:04

Thanxx, I've had a look already but it seemed a little too "sophisticated" for my needs - but I'll have a second look nonetheless, certainly worth it if as you say it helps eliminate events handling issues...

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: VCL web plugin : can't get subtitles to show up

Postby RSATom » 01 Jun 2015 21:05

WebChimera could be very simple and could be very complex, all depends on your needs.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: VCL web plugin : can't get subtitles to show up

Postby RSATom » 01 Jun 2015 21:07

look this demo: http://www.webchimera.org/demos/mouse_events it's related to mouse events handling

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 07 Jun 2015 17:39

Thanxx RSATom, I see that you're part of the Webchimera dev team, nice piece of work.

I have installed the mouse_events demo on my local web server (which allows me to run locally with QML stuff), made it to work quite easily, then mod'ed a few things here and there to my likings, and been able to play a DVB-T ("TNT" here) channel instead of the demo animé clip. Works exactly as it should and as I like, i.e. a right-lick pull-down menu available on the video surface plus an auto-hide toolbar at the bottom. Great. :) (though the pull-down menu tends to stick to being visible, even after action completed, a bit annoying)

A couple of things however at this point :

I'm still struggling as to which one I should use : the plugin, or the "player" (in fact the plugin with added pre-defined UI, right ?)

The mouse_events demo being based on the player, I haven't tried the plugin yet, however I've had to resort to the .plugin thingy in the player JS to make deinterlacing work (wouldn't work as a vlcArg when using the player JS method .addPlaylist( { vlcArgs: [vlc-options] }, though to be clear other vlcArgs options do work so it's not a syntax or functional issue).

One last thing : is it possible to disable this pesky (imho) "feature" of pausing the video when a single left-click on the video surface occurs - and if yes, how ? This for me is as bad as a go or no-go to Webchimera (it even stands in the way when double-clicking on the surface :roll:)

TIA. ;)

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: VCL web plugin : can't get subtitles to show up

Postby RSATom » 07 Jun 2015 18:15

Thanxx RSATom, I see that you're part of the Webchimera dev team, nice piece of work.
Yep, I'm founder of this project. And I'm glad you like it.
I have installed the mouse_events demo on my local web server (which allows me to run locally with QML stuff), made it to work quite easily, then mod'ed a few things here and there to my likings, and been able to play a DVB-T ("TNT" here) channel instead of the demo animé clip. Works exactly as it should and as I like, i.e. a right-lick pull-down menu available on the video surface plus an auto-hide toolbar at the bottom, with fade-in/out effect. Great. :)
You should thank Alexandru Branza (aka Jaruba) for this, he is the author of WebChimera Player.
A couple of things however at this point :

I'm still struggling as to which one I should use : the plugin, or the "player" (in fact the plugin with added pre-defined UI, right ?)
Plugin - is the core of WebChimera. Player is GUI which uses service offered by plugin. There are possible multiple different GUIs for Plugin, but all them will require Plugin installed. WebChimera Player is set of QML/JS files which define UI and logic you can see in demos on http://WebChimera.org/demos. As consequence you could write your own Player which could be totally different (and I really mean it, TOTALLY different) from player which was done by @Jaruba (He put huge amount of work to this project btw). For example you could look demos I wrote before @Alexandru came to project: http://rsatom.github.io/WebChimera/ they are ugly and dead simple, but it's still WebChimera Plugin + some QML and JS.
The mouse_events demo being based on the player, I haven't tried the plugin yet, however I've had to resort to the .plugin thingy in the player JS to make deinterlacing work (wouldn't work as a vlcArg when using the player JS method .addPlaylist( { vlcArgs: [vlc-options] }, though to be clear other vlcArgs options do work so it's not a syntax or functional issue).
One main thing you should understand: all what you can see inside WebChimera Plugin window are defined by QML. So if you need some UI customization you have to use it.
About options - not all options that supported by libvlc internally are available via plugin, since most of them defined as unsafe (I've whitelisted some of them, but only few). About deinterlace - there available api for that: http://wiki.webchimera.org/Plugin_JavaS ... ace_object but don't sure how well it works.
One last thing : is it possible to disable this pesky (imho) "feature" of pausing the video when a single left-click on the video surface occurs - and if yes, how ? This for me is as bad as a go or no-go to Webchimera (it even stands in the way when double-clicking on the surface :roll:)
"With WebChimera almost all is possible" - it seems it will be our slogan soon, so many times we repeated it :)

You could come to our developers channel https://gitter.im/RSATom/WebChimera and ask Player author (@Jaruba) about it - I think he will be glad to help you. It will be better ask him directly, since I did only plugin part, player was done by @Jaruba.

zeepee
Blank Cone
Blank Cone
Posts: 29
Joined: 17 Nov 2012 01:21

Re: VCL web plugin : can't get subtitles to show up

Postby zeepee » 07 Jun 2015 20:33

Wow ! Pretty fast to answer, maybe you were watching tennis game (Roland Garros men's final) on tv like I was this pm ? ^^

I just checked your basic demos (link in yr post), which btw gave me the answer about the irritating pause thing on left-click (seems to be caused in QML by the "MouseArea { onClicked: vlcPlayer2.togglePause(); }" code, at least in yr demo, I guess it's the same for the Player demos).

EDITH : Ok I found the culprit, it's line 358 in the hotkeys.qml file (thanxx to Jaruba for adding the comment "Toggle Pause if clicked on Surface" at the e/o the line otherwise I'd never had found it ^^).


I think I'll want to start from the Plugin API, not the Player, and from there on build a simple but 100% custom U/I (I'll probably make it look like a classic physical remote control, plus some). This will require that I learn about QML, a first timer for me. Not that I really want to, but there's no other option and that's Ok.

About the deinterlace control: like I said I know it has its own specific statement in the *Plugin* JS API (and I'm sure it works fine btw, it does in the VLC web plugin at least), but in the Player API it's only available via a "vlcArgs" param in the addPlaylist() method - however I couldn't make this to work (.addPlaylist({ url:mrl, vlcArgs: 'deinterlace=1' });), which is why I used the .plugin directive available in the Player API.

Well as you said this kind of detailed discussion needs to be had in the Webchimera forum, not here - so I'll stop right here. :)

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: VCL web plugin : can't get subtitles to show up

Postby RSATom » 08 Jun 2015 08:09

Wow ! Pretty fast to answer, maybe you were watching tennis game (Roland Garros men's final) on tv like I was this pm ? ^^
No, I almost never watch TV, just have subscription for new posts on this forum :)
I think I'll want to start from the Plugin API, not the Player, and from there on build a simple but 100% custom U/I (I'll probably make it look like a classic physical remote control, plus some). This will require that I learn about QML, a first timer for me. Not that I really want to, but there's no other option and that's Ok.
QML is pretty easy and obvious language. If you don't start something too complex right now, don't think you will have any problem. You could read small intro here: http://wiki.webchimera.org/Getting_started_with_QML
About the deinterlace control: like I said I know it has its own specific statement in the *Plugin* JS API (and I'm sure it works fine btw, it does in the VLC web plugin at least), but in the Player API it's only available via a "vlcArgs" param in the addPlaylist() method - however I couldn't make this to work (.addPlaylist({ url:mrl, vlcArgs: 'deinterlace=1' });), which is why I used the .plugin directive available in the Player API.
You could access Plugin JS API from Player JS API by something like

Code: Select all

wjs("#webchimera").plugin.video.deinterlace.enable( 'blend' )


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 54 guests