3

I use ELP USB camera with h264-codec output.

Ffmpeg-command to take the video stream:

ffmpeg -i /dev/video1 -c:v copy output.ts

As result I have a video with 4Mb bitrate - this value is too high for my task.

There is the same situation when I use GSTreamer:

gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-h264,width=1280,height=720,framerate=30/1 ! mpegtsmux ! filesink location=output.ts

I know that it's possible to change the bitrate if we decode h264 the stream firstly and then encode it to h264 again. This operation requires too much CPU-power of my NanoPI device.

The main question is: Is it possible to change a USB-camera's bitrate without decoding?

Thanks in advance!

Nick Saw
  • 387
  • 1
  • 12

1 Answers1

4

Some of USB cameras support UVC Protocol, which allows you to adjust a wider range of functions than v4l2-ctl.

For example, to change a bitrate without decoding:

gst-launch-1.0 uvch264src initial-bitrate=1500000 average-bitrate=1500000 iframe-period=1000 device=/dev/video0 name=src auto-start=true src.vidsrc ! video/x-h264,width=1280,height=720,framerate=30/1,profile=constrained-baseline ! h264parse ! mpegtsmux ! filesink location=output.ts

IMPORTANT! ELP USB-cam doesn't support this protocol. But the well-known Logitech C920-yes, and the command was tested by this camera.

If anyone knows HD USB cameras which support h.264 codec and UVC Protocol, write me, I will be very grateful.

Nick Saw
  • 387
  • 1
  • 12