Page 1 of 1

VLC NPAPI Plugin with V4L video and ALSA audio capture

Posted: 12 Mar 2012 13:36
by tand
I have previously asked about using V4L video with ALSA audio capture through the NPAPI plugin on Chromium, see:
viewtopic.php?f=13&t=98531
I have now patched the code to add an input-slave option to the target.
Is this the right way to do it, or is there a cleaner way?
If 'input-slave' is seen as an OK option, I will go on and submit a patch.

Code: Select all

diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp index 1d9db49..bc6d0c1 100644 --- a/npapi/vlcplugin_base.cpp +++ b/npapi/vlcplugin_base.cpp @@ -464,6 +464,12 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[]) { set_enable_fs( boolValue(argv[i]) ); } + else if( !strcmp( argn[i], "input-slave" ) ) + { + char psz_input_slave_opts[80] = "--input-slave="; + strcat(psz_input_slave_opts, argv[i]); + ppsz_argv[ppsz_argc++] = psz_input_slave_opts; + } else if( !strcmp( argn[i], "mute" ) ) { if( boolValue(argv[i]) )
The following html code demonstrate the use with a video capture device with ALSA audio.

Code: Select all

<!DOCTYPE HTML> <html lang="en"> <head> <meta charset=utf-8> <title>VLC video capture test with Chromium browser</title> </head> <body> <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="720" height="576" id="vlc" input-slave="alsa://hw:2,0" mute="false" allowfullscreen="false" toolbar="false" target="v4l2:///dev/video0:width=720:height=576"> </embed> <script language="Javascript"> <!-- var vlc = document.getElementById("vlc"); vlc.video.deinterlace.enable("blend"): //!--> </script> </body> </html>
Feedback is appreciated!

PS. It seems that recent versions of VLC (2.0+) have problems with ALSA capture. However, the new 2.0-based npapi plugin with ALSA seems to work OK with at least VLC 1.1.12. I guess that this has already been noted? DS

Re: VLC NPAPI Plugin with V4L video and ALSA audio capture

Posted: 12 Mar 2012 13:45
by Jean-Baptiste Kempf
No idea why this does not work now. We need to look at it.

Re: VLC NPAPI Plugin with V4L video and ALSA audio capture

Posted: 21 May 2012 14:06
by tittbit
'input-slave' option is what u require to patch the code.

i dont think there is more cleaner way?