Open main menu

Changes

C779-Software

4,150 bytes removed, 2 September
no edit summary
sudo apt-get upgrade
2. Enable camera module (the camera is enabled by default in Raspberry pi '''Bullseys /Bookworm''' OS)
sudo raspi-config
should now reflect the resolution detected.
8. The chip supports two formats Test video recording v4l2-ctl --verbose -d /dev/video0 --set-fmt- video=width=1280,height=720,pixelformat='RGB3(the default) and UYVY' --stream-mmap=4 --stream-skip=3 --stream-count=2 --stream-to=csitest. RGB3 is 24bpp, yuv --stream-pollThe above command will capture frames and UYVY is YUV4save to /home/pi (filename:2:2 16bppcsitest.yuv)
Over the normal 2 CSI-2 lanes 9. To play the data rate is such that RGB3 can run at a maximum of 1080p30YUV file on Raspberry Pi OS desktop, whilst UYVY will go up to 1080p50use FFplay. Use (Run the following command to select UYVYon local terminal window, however your application may override thatNot work if executing the command from SSH). v4l2ffplay -ctl f rawvideo -v pixelformat=UYVYvideo_size 1280x720 -pixel_format bgr24 csitest.yuv
9. Check that the audio drivers / card is available to ALSA.<pre>pi@raspberrypi:~ $ arecord -l**** List of CAPTURE Hardware Devices ****card 1: tc358743 [tc358743], device 0: bcm2835-i2s-dir-hifi dir-hifi-0 [bcm2835-i2s-dir-hifi dir-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0</pre>Note: <span style="color:red;">card 1</span> means that the card number for the TC358743XBG is "1" and it might be different. 10. Install GStreamer tool; sudo apt install gstreamer1.0-tools Check gstreamer tool version:<pre>pi@raspberrypi:~ $ gst-launch-1.0 --versiongst-launch-1.0 version 1.18.4GStreamer 1.18.4http://packages.qa.debian.org/gstreamer1.0</pre> <span style="color:red;">Note: </span> Different versions have different command line parameters, which is very annoying. 11. Use gstreamer to record video and audio #GStreamer v1.14 command gst-launch-1.0 v4l2src io-mode=5 ! video/x-raw, format=UYVY, framerate=25/1 ! v4l2h264enc output-io-mode=4 ! video/x-h264,profile=high ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv alsasrc device=hw:1 ! audio/x-raw,rate=48000,channels=2 ! audioconvert ! avenc_aac bitrate=48000 ! aacparse ! queue ! mux. foo.mkv is the output file. If your gstreamer is version 1.8 or above, you can try the following test command. In addition, alsasrc device=hw:1 represents the sound card of TC358743, you can use "arecord -l" to query.  #The command to recode a video with audio. (GStreamer 1.18.4) gst-launch-1.0 -vvv v4l2src ! "video/x-raw,<span style="color:red;">framerate=30/1</span>,format=UYVY" ! v4l2h264enc extra-controls="controls,h264_profile=4,h264_level=13,video_bitrate=256000;" ! "video/x-h264,profile=high, level=(string)4.2" ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv alsasrc device=hw:1 ! audio/x-raw,rate=48000,channels=2 ! audioconvert ! avenc_aac bitrate=48000 ! aacparse ! queue ! mux.  #The sample command to recode a video without audio. (C779 doesn't support audio) gst-launch-1.0 -vvv v4l2src ! "video/x-raw,'''<span style="color:red;">framerate=30/1</span>''',format=UYVY" ! v4l2h264enc extra-controls="controls,h264_profile=4,h264_level=13,video_bitrate=256000;" ! "video/x-h264,profile=high, level=(string)4.2" ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv  Press CTRL+C to end recording. If you have the '''WARNING: erroneous pipeline: no element "v4l2src"''' errorother tutorials, please run leave them in the following command: sudo apt-get install gstreamer1comments.0-plugins-good If you have the '''WARNING: erroneous pipeline: no element "h264parse"''' error, please run the following command: sudo apt-get install gstreamer1.0-plugins-bad If you have the '''WARNING: erroneous pipeline: no element "alsasrc"''' error, please run the following command: sudo apt-get install gstreamer1.0-alsa PS: We recommend that you modify the above '''<span style="color:red;">framerate</span>''' parameter to the actual frame rate of your HDMI signal, the actual frame rate value is from the result of ''''v4l2-ctl --query-dv-timings'''' command.[[File:Csi-framerate.png|none]] For the above HDMI device, because the frame rate is 60, so we modify the framerate parameter to 60 like the followint command. Record the video only: gst-launch-1.0 -vvv v4l2src ! "video/x-raw,'''<span style="color:red;">framerate=60/1</span>''',format=UYVY" ! v4l2h264enc extra-controls="controls,h264_profile=4,h264_level=13,video_bitrate=256000;" ! "video/x-h264,profile=high, level=(string)4.2" ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv Record the video and audio: (if your shield supports audio also) gst-launch-1.0 -vvv v4l2src ! "video/x-raw,'''<span style="color:red;">framerate=60/1</span>''',format=UYVY" ! v4l2h264enc extra-controls="controls,h264_profile=4,h264_level=13,video_bitrate=256000;" ! "video/x-h264,profile=high, level=(string)4.2" ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv <span style="color:red;">alsasrc device=hw:1</span> ! audio/x-raw,rate=48000,channels=2 ! audioconvert ! avenc_aac bitrate=48000 ! aacparse ! queue ! mux. Note: <span style="color:red;">alsasrc device=hw:1</span> - "'''1'''" means the audio card number, You must change to correct audio card number.(Query the car number via ''''arecord -'''l', refer to step 9) 12. For old raspberry pi os, you can use [[Raspistil]] to take photo.
<!--增加评论功能! -->
<comments />