The Raspberry Pi Foundation has updated several versions recently;
The use guide of [[C779]]/[[C790]]/[[X630 ]] depends on the official Raspberry Pi OS version you are using. Different versions have different usage methods. If you have some questions, please contact us and attach the osversion you are using.(<span style="color:red;">Email: support@geekworm.com</span>)
You can refer to [https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=281972 Raspberry pi official forum post]
sudo apt-get upgrade
2. Enable camera module (the camera is enabled by default in Raspberry pi '''Bullseys /Bookworm''' OS)
sudo raspi-config
sudo reboot
Navigate to ''''Interfacing Options'''' and hit Enter. Now select the ''''Camera'''' option, and hit the Enter key to enable it. Select “Finish” and select to '''reboot''' your Raspberry Pi.
'''[NOTE] ''' reboot is important!!
3. Edit /boot/config.txt (that will need sudo)
sudo nano /boot/firmware/config.txt
Add the line:
dtoverlay=tc358743
Add the line if your shield support CSI module supports audio also like '''C790'''
dtoverlay=tc358743-audio
please append theIf following setting if (and only if) you have a device such as the Auvidea B102 that supports the 22pin connector with all 4 lanes wired out(such as [[X1300]]), and are using a Compute Module with the CAM1 connector that also has all 4 lanes wired up, you can use
dtoverlay=tc358743,4lane=1
pi@raspberrypi:~ $ dmesg | grep cma
[ 0.000000] cma: Reserved 256 MiB at 0x000000001ec00000
If it reports less than 96MB assigned to CMA, then edit please '''''/boot/firemare/cmdline.txt''''' as following: sudo nano /boot/firmware/cmdline.txt and addthen add <code>cma=96M</code> to the start of the line. Do NOT add any carriage returns 5. Reboot. sudo reboot
5. Reboot. If all is well you should get a /dev/video0 device, and "v4l2-ctl --list-devices" will tell you that it is provided by Unicam.
After connecting all the cables, power on the Raspberry Pi, the C779/C790 indicator light is normally green, and after opening the Raspberry Pi terminal, enter the following command:
pi@raspberrypi:~ $ ls /dev/video0
/dev/video0
<pre>
pi@raspberrypi:~ $ ls /dev/video0/dev/video0pi@raspberrypigeekworm:~ $ v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
/dev/video10
/dev/video12
/dev/video18
/dev/media1video31
bcm2835-isp (platform:bcm2835-isp):
/dev/video15
/dev/video16
/dev/video20
/dev/video21
/dev/video22
/dev/video23
/dev/media0
/dev/media2
unicam (platform:fe801000.csi):
/dev/video0
/dev/video1media4 rpi-hevc-dec (platform:rpi-hevc-dec): /dev/video19 /dev/media3 bcm2835-codec (vchiq:bcm2835-codec): /dev/media2media1
</pre>
should now reflect the resolution detected.
8. The chip supports two formats - RGB3(the default) and UYVY. RGB3 is 24bpp, and UYVY is YUV4:2:2 16bpp. Over the normal 2 CSI-2 lanes the data rate is such that RGB3 can run at a maximum of 1080p30, whilst UYVY will go up to 1080p50. Use the following command to select UYVY, however your application may override that.Test video recording v4l2-ctl -v pixelformat=UYVY 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 [bcm2835verbose -i2s-dir-hifi dir-hifi-0] Subdevices: 1d /1 Subdevice #0: subdevice #0</pre>Note: <span style="color:red;">card 1<dev/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:~ $ gstvideo0 -launch-1.0 set-fmt-versiongst-launch-1.0 version 1.18.4GStreamer 1.18.4http://packages.qa.debian.org/gstreamer1.0</pre> <span stylevideo="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-modewidth=5 ! video/x-raw1280, formatheight=UYVY720, frameratepixelformat=25/1 ! v4l2h264enc output'RGB3' -io-mode=4 ! video/x-h264,profile=high ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv alsasrc device=hw:1 ! audio/xstream-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 devicemmap=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 stream-vvv v4l2src ! "video/x-raw,<span style="color:red;">framerateskip=30/1</span>,format=UYVY" ! v4l2h264enc extra3 -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/xstream-raw,rate=48000,channelscount=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/xstream-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,profileto=high, level=(string)4.2" ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv Press CTRL+C to end recordingcsitest. 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 -yuv -query-dvstream-timings'''' command.poll[[File:Csi-framerate.png|none]] For the The above HDMI device, because the frame rate is 60, so we modify the framerate parameter command will capture frames and save 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<home/span>''',format=UYVY" ! v4l2h264enc extra-controls="controls,h264_profile=4,h264_level=13,video_bitrate=256000;" ! "video/x-h264,profile=high, level=pi (string)4.2" ! h264parse ! queue ! matroskamux name=mux ! filesink location=foo.mkv Record the video and audiofilename: (if your shield supports audio also) gst-launch-1csitest.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=(stringyuv)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 9. To play the audio card numberYUV file on Raspberry Pi OS desktop, You must change to correct audio card numberuse FFplay.(Query Run the car number via ''''arecord -'''l'following command on local terminal window, refer to step 9Not work if executing the command from SSH). ffplay -f rawvideo -video_size 1280x720 -pixel_format bgr24 csitest.yuv
12. For old raspberry pi os'''If you have other tutorials, you can use [[Raspistil]] to take photoplease leave them in the comments.'''
<!--增加评论功能! -->
<comments />