Difference between revisions of "Template:DebianBullseyeDesktop-XFCE-HDMIIN"
From FriendlyELEC WiKi
(updated by API) |
(updated by API) |
||
Line 51: | Line 51: | ||
* Capture a frame | * Capture a frame | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | pi@NanoPC-T6:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat='NV12' --stream-mmap=4 --stream-skip=10 --stream-to=/home/pi/4k_nv12.yuv --stream-count=1 --stream-poll | + | pi@NanoPC-T6:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat='NV12' \ |
+ | --stream-mmap=4 --stream-skip=10 --stream-to=/home/pi/4k_nv12.yuv --stream-count=1 \ | ||
+ | --stream-poll | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* Preview on computer (Linux/Mac) | * Preview on computer (Linux/Mac) |
Revision as of 11:47, 17 June 2023
How to test HDMI-IN
The node of HDMI-IN device is: /dev/video0, which can be operated by the v4l2-ctl command.
- Obtain device information
pi@NanoPC-T6:~$ v4l2-ctl -d /dev/video0 -V -D Driver Info: Driver name : rk_hdmirx Card type : rk_hdmirx Bus info : fdee0000.hdmirx-controller Driver version : 5.10.110 Capabilities : 0x84201000 Video Capture Multiplanar Streaming Extended Pix Format Device Capabilities Device Caps : 0x04201000 Video Capture Multiplanar Streaming Extended Pix Format Format Video Capture Multiplanar: Width/Height : 3840/2160 Pixel Format : 'NV12' (Y/CbCr 4:2:0) Field : None Number of planes : 1 Flags : premultiplied-alpha, 0x000000fe Colorspace : Unknown (0x11507070) Transfer Function : Unknown (0x000000b8) YCbCr/HSV Encoding: Unknown (0x000000ff) Quantization : Default Plane 0 : Bytes per Line : 3840 Size Image : 12441600
- View the resolution and image format of the currently connected device
pi@NanoPC-T6:~$ v4l2-ctl -d /dev/video0 --get-fmt-video Format Video Capture Multiplanar: Width/Height : 3840/2160 Pixel Format : 'NV12' (Y/CbCr 4:2:0) Field : None Number of planes : 1 Flags : premultiplied-alpha, 0x000000fe Colorspace : Unknown (0x1193b008) Transfer Function : Unknown (0x000000b8) YCbCr/HSV Encoding: Unknown (0x000000ff) Quantization : Default Plane 0 : Bytes per Line : 3840 Size Image : 12441600
- Capture a frame
pi@NanoPC-T6:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat='NV12' \ --stream-mmap=4 --stream-skip=10 --stream-to=/home/pi/4k_nv12.yuv --stream-count=1 \ --stream-poll
- Preview on computer (Linux/Mac)
ffplay -f rawvideo -video_size 3840x2160 -pixel_format nv12 4k_nv12.yuv
- Preview HDMI-In frames in the GUI
Click "Multimedia" -> "Qt V4L2 test Utility",and then "Start Capturing" icon on the toolbar,the configuration interface is shown below:
- View HDMI-IN audio device
pi@NanoPC-T6:~$ cat /proc/asound/card* 0 [rockchipdp0 ]: rockchip_dp0 - rockchip,dp0 rockchip,dp0 1 [rockchiphdmi0 ]: rockchip_hdmi0 - rockchip,hdmi0 rockchip,hdmi0 2 [realtekrt5616co]: realtek_rt5616- - realtek,rt5616-codec realtek,rt5616-codec 3 [rockchiphdmi1 ]: rockchip_hdmi1 - rockchip,hdmi1 rockchip,hdmi1 4 [rockchiphdmiin ]: rockchip_hdmiin - rockchip,hdmiin rockchip,hdmiin
As you can see, the sound card number of HDMI-IN is 4.
- Recording audio (recording 10 seconds)
pi@NanoPC-T6:~$ arecord -D hw:4,0 -f cd test.wav -d 10
- Playback recorded audio (output to HDMI0)
pi@NanoPC-T6:~$ aplay test.wav -D 'hw:rockchiphdmi0'