Because of Linux kernel updated pretty fast, the demo in VoCam264 SDK is already out of date…
We will need some changes to make TestAP able to compile:
- change include file from <linux/videodev.h> to <linux/videodev2.h>
- add header include to <string.h> and <stdio.h> to sonix_xu_ctrls.c, so compiler will stop complain the missing headers.
Now we can use mipsel-openwrt-linux-gcc to compile the TestAP.
mipsel-openwrt-linux-gcc *.c -o TestAP
To record h264 data, first go to /tmp folder or /mnt/mmcblk0p1 or /mnt/sda1(make sure the device has enough space for data) then use SONiX_UVC_TestAP -c -f H264 -r /dev/video1 -s 1920×1080 record it to that folder.
It will generate a file named RecordH264.h264, you can use ffplay to watch it.
The test application will record video with bitrate around 10Mb/s, so one second it will take around 1.3MB disk space, very big 🙂 we need to find a way to reduce the bitrate. I guess that will have to use its XU interface, but because Linux UVC interface changed, we do not have UVCIOC_CTRL_ADD, UVCIOC_CTRL_SET and UVCIOC_CTRL_GET anymore, the demo code is totally broken now, have to upgrade and patch it..
Now new interface is UVCIOC_CTRL_MAP which used to replace UVCIOC_CTRL_ADD and UVCIOC_CTRL_QUERY, which used to replace UVCIOC_CTRL_SET/GET.
Such as OSD function and motion detection function are both depends on those XU functions.
To be continue…❤️