Magics-Group / wcjs-renderer

Renderer JS API for WebChimera.js
http://webchimera.org/
MIT License
40 stars 24 forks source link

subtitles #10

Closed shenanigans closed 8 years ago

shenanigans commented 8 years ago

Maybe I'm just stupid but I can't get subtitles to display. I've been doing this sort of thing...

var vlc = wcjs_renderer.init (canvasElem);
vlc.play (localFilePath);
vlc.events.once ('FrameReady', function (frame) {
    vlc.subtitles.track = 1;
});

I've tried placing a div.wcp-subtitles in the page like the normal player app would want, no luck. My reading leads me to believe that in -renderer the subtitles are supposed to be rendered by VLC and appear in the normal frame data, is this correct? Is there a doc page I missed somewhere? The "Javascript API" I keep seeing doesn't seem to describe webchimera.js at all, specifying lots of methods that aren't there. Is my problem between my keyboard and chair?

This has all been with an x64 build from wcjs-prebuilt.

jaruba commented 8 years ago

what kind of subtitles are you trying to load? from a file? from inside video files (ie: internal, such as the ones in some mkv files)

jaruba commented 8 years ago

"Javascript API" I keep seeing doesn't seem to describe webchimera.js at all

We're in the process of changing the entire website wiki to reflect only on webchimera.js and wcjs-player APIs, the website wiki is currently only hosting the APIs for WebChimera NPAPI and WebChimera QML Player.

WebChimers.js API Docs: https://github.com/RSATom/WebChimera.js/wiki/JavaScript-API

RSATom commented 8 years ago

@shenanigans, could you please check if you have vlc.subtitles.count > 0 ?

RSATom commented 8 years ago

@jaruba. +1

jaruba commented 8 years ago

@RSATom: I believe there's a different issue here, even if vlc.subtitles.count is greater then 0, I still wouldn't expect it to work.

RSATom commented 8 years ago

@jaruba, do you mean subtitles are broken in wcjs?

jaruba commented 8 years ago

@RSATom not in wcjs, no.. I think their broken in the VLC prebuilts from Magics..

RSATom commented 8 years ago

hm... I'm always recommend prefer use vanilla builds...

RSATom commented 8 years ago

let's wait @shenanigans, we need more info...

shenanigans commented 8 years ago

I tested two scenarios - bundled subtitles in .mkv files and a .srt file that VLC was detecting automatically. And yeah, of course I checked that count > 0....

RSATom commented 8 years ago

@shenanigans, do you use vanilla libvlc or from wcjs-prebuilt ?

jaruba commented 8 years ago

Download DebugView, open it, play something with wcjs.

Tell me if you see core decoder errors like in this image: vlc-welp

shenanigans commented 8 years ago

@RSATom wcjs-prebuilt with manually copied binaries a-la the x64 workaround. @jaruba When and only when subtitles would be displayed, I'm seeing "core blend error: blending YUVA to I420 failed"

jaruba commented 8 years ago

@RSATom nope, not what I was expecting, this is your battle not mine :)

RSATom commented 8 years ago

"core blend error: blending YUVA to I420 failed"

It could be some internal libvlc restriction (but don't sure 100% yet). Did you try any .avi ?

shenanigans commented 8 years ago

Same result with .avi and an external .srt file.

RSATom commented 8 years ago

ok, I'll check. Did you try it with 32-bit libvlc?

shenanigans commented 8 years ago

Looks to work just fine in win32.

RSATom commented 8 years ago

then I'm afraid it's a bug in libvlc

RSATom commented 8 years ago

@shenanigans, btw, why exactly did you decide to use x64 version?

shenanigans commented 8 years ago

The application was originally image-focused and used lwip to do really fast and pretty thumbnails for the big-three image formats. I initially had a hard time figuring out how to build a 32-bit version of lwip and that got me thinking in terms of an x64 application with a 32-bit port. There's not actually a good reason to use x64 here and I'll probably stick with 32-bit going forward just to avoid this kind of issue.

shenanigans commented 8 years ago

....wait, can you explain how this could be a libvlc bug? It's just a copy of libvlc.dll from the 64-bit desktop VLC I have installed and it displays subtitles just fine.

RSATom commented 8 years ago

1) WebChimera.js uses vmem module to receive video frames. 2) VLC itself don't use this module to display frames (it uses other more effective output modules) 3) WebChimera.js use only I420 pixel format, so libvlc have to transcode all frames to this format before give it to vmem. 4) according to "core blend error: blending YUVA to I420 failed" libvlc x64 has some problem with this transcode 5) libvlc ia32 doesn't have any problem with playback

so I think it's a bug in x64 build of libvlc's pixel format transform module (or something near it)

RSATom commented 8 years ago

btw, another solution could be add other than I420 pixel formats support to WebChimera.js. Just to workaround bug in pixel format transform module...

shenanigans commented 8 years ago

cool, thanks for a thorough answer.

sunabozu commented 8 years ago

Have the same issue with 64-bit version. Switching to ia32 does solve the problem.