VLC NPAPI Plugin with V4L video and ALSA audio capture

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
tand
Blank Cone
Blank Cone
Posts: 13
Joined: 20 Feb 2012 16:18

VLC NPAPI Plugin with V4L video and ALSA audio capture

Postby tand » 12 Mar 2012 13:36

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
Last edited by tand on 12 Mar 2012 14:19, edited 1 time in total.

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

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

Postby Jean-Baptiste Kempf » 12 Mar 2012 13:45

No idea why this does not work now. We need to look at it.
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.

tittbit
Blank Cone
Blank Cone
Posts: 17
Joined: 10 Mar 2012 19:40

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

Postby tittbit » 21 May 2012 14:06

'input-slave' option is what u require to patch the code.

i dont think there is more cleaner way?
Life is not finding yourself, it is discovering yourself.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 1 guest