Open main menu

Changes

C779-Software

3,109 bytes added, 12:42, 27 December 2021
no edit summary
</pre>
6. The driver does NOT automatically switch to the resolution detected. Use the command:
<pre>
pi@raspberrypi:~ $ v4l2-ctl --query-dv-timings
Flags:
</pre>
You MUST set the timings via "v4l2-ctl --set-dv-bt-timings". You can pass in an index to the detected mode, or use:
v4l2-ctl --set-dv-bt-timings query
to select the currently detected timings.
v4l2-ctl -V
should now reflect the resolution detected.
 
7. The chip supports two formats - BGR3 (the default) and UYVY. BGR3 is 24bpp, and UYVY is YUV4:2:2 16bpp.
 
Over the normal 2 CSI-2 lanes the data rate is such that BGR3 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.
v4l2-ctl -v pixelformat=UYVY
 
8. Use gstreamer to save video and audio
 
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.
 
If the video and audio are well connected, you can get a playable video foo.kmv after running the above command. If the input video source has sound, you will be able to hear the corresponding sound.
 
'''Note''' that the version of the gst command tested here is below 1.8.
 
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 sample command to recode a video with 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 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 <ref name="note1"/>)
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.
 
PS: Please 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.
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