DisplayApp is an application that displays the camera image sent by USB CDC.
You can use the prebuilt binaries in bin
directory.
Or run make build
command. displayapp
will be build in bin
directory.
To record the video as MP4 file, run the following command. /tmp/out.mp4
will be created.
displayapp | ffmpeg -y -f image2pipe -c:v mjpeg -r 30 -i - -vcodec libx264 /tmp/out.mp4
To display the video in the window, run the following command.
displayapp | ffplay -i -
To output jpeg files every 1 seconds, run the following command. /tmp/test*.jpg
will be created.
displayapp -p /tmp
To use v4l2loopback, run the following commands.
First start v4l2loopback with modprobe
command. Then confirm your loopback device with v4l2-ctl
command.
sudo modprobe v4l2loopback exclusive_caps=1
v4l2-ctl --list-devices
In my case, the loopback device was /dev/video1
.
In the case, run the following command.
./displayapp | ffmpeg -y -f image2pipe -c:v mjpeg -r 30 -i - -pix_fmt yuyv422 -f v4l2 /dev/video1
Use -d
option to specify the COM port. Do not forget to install ffmpeg
.
For example, To record the video as MP4 file, run the following command.
displayapp.exe -d COM5 | ffmpeg -y -f image2pipe -c:v mjpeg -r 30 -i - -vcodec libx264 out.mp4
To display the video in the window, run the following command.
displayapp.exe -d COM5 | ffplay -i -