Page 1 of 1

vlc and webcams with internal h264 encoder

Posted: 02 Jun 2012 13:09
by burek
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.

Re: vlc and webcams with internal h264 encoder

Posted: 02 Jun 2012 15:40
by Rémi Denis-Courmont
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.

Re: vlc and webcams with internal h264 encoder

Posted: 24 Dec 2012 16:41
by madrugado
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?

Re: vlc and webcams with internal h264 encoder

Posted: 24 Dec 2012 19:01
by Rémi Denis-Courmont
"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".

Re: vlc and webcams with internal h264 encoder

Posted: 26 Dec 2012 14:06
by madrugado
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?

Re: vlc and webcams with internal h264 encoder

Posted: 26 Dec 2012 17:26
by Rémi Denis-Courmont
No, this never was implemented in VLC.