vlc and webcams with internal h264 encoder

*nix specific usage questions
burek
Blank Cone
Blank Cone
Posts: 40
Joined: 10 May 2008 21:52

vlc and webcams with internal h264 encoder

Postby burek » 02 Jun 2012 13:09

Hi,

I've got an usb webcam with internal (hardware) h264 encoder and I managed to start the stream using:

Code: Select all

vlc v4l2:///dev/video0:width=320:height=240:chroma=h264
So far, so good, but... The default bitrate, at which the webcam's h264 encoder is encoding the video stream, is too high for me (around 3-4 mbps) and I'd like to lower it down by telling the webcam to encode the video with a different bitrate. I don't want to transcode the stream with vlc, because in that case, there is no purpose of webcam's internal encoder.

I've been told (at the #v4l irc channel) that this can be done using ioctl() in vlc's source code (more info here, if needed: https://ffmpeg.org/trac/ffmpeg/ticket/1389 ), so my question is: is there a way to tell the webcam to lower the encoding bitrate, using vlc?

Thanks in advance.
Image
          • www.gusari.org

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: vlc and webcams with internal h264 encoder

Postby Rémi Denis-Courmont » 02 Jun 2012 15:40

VLC can change the V4L2 controls via the command line or UI effects dialog. There is no support for UVC-specific functionality at this point in time.

So if the encoding parameters are not available as V4L2 controls, then it will not work as is.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

madrugado
New Cone
New Cone
Posts: 4
Joined: 24 Dec 2012 16:35

Re: vlc and webcams with internal h264 encoder

Postby madrugado » 24 Dec 2012 16:41

Hi all.

I have almost the same issue. But I want to tune some video stream params.
First of all I want to set FPS and frequency of k-frames. Now I'm doing this so:

Code: Select all

cvlc v -vvv v4l2:///dev/video0:width=640:height=360:fps=5:keyint=4:chroma=h264 --sout "#standard{access=http,mux=ts,dst=:5000}" --no-sout-audio
But I this that doesn't work because of this string in the output:

Code: Select all

[0x41b03000] v4l2 demux debug: added new video es h264 640x360 [b][0x41b03000] v4l2 demux debug: frame rate: 0.000000[/b]
May be I'm doing something wrong?

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: vlc and webcams with internal h264 encoder

Postby Rémi Denis-Courmont » 24 Dec 2012 19:01

"fps" and "keyint" are not currently implemented by the V4L2 input plugin. fps is not a V4L2 "control" anyway, so it would need special support. I don't know about "keyint".
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

madrugado
New Cone
New Cone
Posts: 4
Joined: 24 Dec 2012 16:35

Re: vlc and webcams with internal h264 encoder

Postby madrugado » 26 Dec 2012 14:06

Hi Rémi,

Is there any frame rate control available in V4L2 input plugin? Or there is some option like use v4l2-ctl to set parameters I need ahead of vlc use?

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: vlc and webcams with internal h264 encoder

Postby Rémi Denis-Courmont » 26 Dec 2012 17:26

No, this never was implemented in VLC.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 18 guests