Changes

Jump to navigation Jump to search

CSI Audio Video capturing using GStreamer

2,243 bytes added, 16:18, 27 June 2023
no edit summary
sudo reboot
'''Once rebooted and check that the audio drivers / card is available to ALSA.'''
arecord -l
If the X630 module and drivers have been installed correctly you should see something similar to:
[[File:Arecord-X630.jpg]]
Note: card 2 means that the card number for the TC358743XBG is "2" and it might be different.
 
'''Create an EDID file so it can be loaded into the chip to allow it to tell the HDMI source what resolutions are supported.'''
sudo nano edid.txt
then enter the following:
<pre>
00ffffffffffff005262888800888888
1c150103800000780aEE91A3544C9926
0F505400000001010101010101010101
010101010101011d007251d01e206e28
5500c48e2100001e8c0ad08a20e02d10
103e9600138e2100001e000000fc0054
6f73686962612d4832430a20000000FD
003b3d0f2e0f1e0a202020202020014f
020321434e041303021211012021a23c
3d3e1f2309070766030c00300080E300
7F8c0ad08a20e02d10103e9600c48e21
0000188c0ad08a20e02d10103e960013
8e210000188c0aa01451f01600267c43
00138e21000098000000000000000000
00000000000000000000000000000000
00000000000000000000000000000028
</pre>
Save and exit with ctrl + x, followed by y when prompted to save, and then enter.
 
'''Push this to the device using'''
v4l2-ctl --set-edid=file=edid.txt --fix-edid-checksums
 
'''To print the currently detected timings'''
v4l2-ctl --query-dv-timings
 
''To select the currently detected timings''
v4l2-ctl --set-dv-bt-timings query
 
'''Capture the incoming audio (no video)'''
arecord -D hw:x,0 -V stereo -r 48000 -f S16_LE -c 2 audio.wav
 
Note: '''hw:x''' - You must replace "x" with correct audio card number.
 
Press ctrl + c to finish a recording, the file will be saved to /home/pi
 
'''Capture the incoming video and audio'''
gst-launch-1.0 v4l2src io-mode=0 ! 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=video.mkv alsasrc device=hw:2 ! audio/x-raw,rate=48000,channels=2 ! audioconvert ! avenc_aac bitrate=48000 ! aacparse ! queue ! mux.
 
Note: '''alsasrc device=hw:<span style="color:red;>2</span> - "<span style="color:red;>2</span>'''" means the audio card number, You must change to correct audio card number.
 
Press ctrl + c to finish a recording, the file will be saved to /home/pi
<!--Add review function! -->
<comments />

Navigation menu