V4l2¶
- 获取视频设备的裁剪(crop)设置
v4l2-ctl --device=/dev/video0 --get-crop
- 捕获视频帧
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap=3 --stream-skip=3 --stream-to=1.nv12 --stream-count=1 --stream-poll
- 显示nv12数据
ffplay -f rawvideo -pixel_format nv12 -video_size 1920x1080 1.nv12
# gst-launch-1.0 是 GStreamer 多媒体框架的一个命令行工具,在 RK3588 芯片平台上具有特殊的优化和功能 gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=1920,height=1080 ! mpph264enc ! filesink location=1.h264