0

I'm using a custom Linux built using Buildroot for a SoC Allwinner A20. This SoC have 4 analog video inputs which I need to use. The problem is that there is not a decent driver for this video input, so I'm fixing the single one I was able to find over the internet. It is a V4L2 driver for this device.

This device can capture video from more than one of the video inputs at the same time, and combine them in one single image, splitting the image in 2 or 4 parts, displaying the video from each camera in a different part.

However, the driver is very basic, and it is not prepared to configure this yet. It only capture from the video input #1. What I want to do is to modify this driver so it allows to configure how many inputs do you cant to enable (1, 2 or 4 inputs) and which ones (for example: enable inputs #2 and #4 and combine them into a video split in 2 parts).

First thing I though was to do this using the VIDIOC_S_INPUT ioctl because this is what it is supposed to do: selecting what input you want to use from a device with more than one input. However, this would work great if I just had to choose one of the 4 inputs, but I don't know how to use it to enable 2 or 4 inputs, and less what inputs must be enabled in this case, and in what order.

How can achieve this in a 4vl2 compliant way? I would like to use it with standard software like ffmpeg and gstreamer.

naggety
  • 166
  • 1
  • 10

1 Answers1

0

I guess that the v4l2 compliant way would be to create 4 devices /dev/video0../dev/video3 each of them exposing one capture source, and then do the overlay in user-space.

If this is not possible, and you indeed can only present a single combined video stream via a single device (/dev/video0) because the device does the stream merge in hardware, then i don't think that using VIDIOC_S_INPUT is out of the way. just come up with a good numbering scheme...

However (to re-iterate), if the stream merge is not done in hardware but in software, then you should never do that in kernel-space and always in user-space (so you should expose the 4 streams via 4 device files)

umläute
  • 28,885
  • 9
  • 68
  • 122