x264 [错误]:基线配置文件不支持 4:2:2

x264 [error]: baseline profile doesn't support 4:2:2

我可以使用以下方法播放来自我的 UVC 相机的视频流:

gst-launch-1.0 v4l2src device=/dev/video4 ! decodebin ! autovideosink

现在,我想将流转换为 h264,以便进一步传输(即不一定到 autovideosink)。但是当我执行以下操作时:

gst-launch-1.0 v4l2src device=/dev/video4 ! videoconvert ! x264enc ! decodebin ! autovideosink

我收到错误:

x264 [error]: baseline profile doesn't support 4:2:2

我错过了什么?

您可以通过在 videoconvertx264enc 之间设置上限来强制使用 4:2:0,如下所示:

gst-launch-1.0 v4l2src device=/dev/video4 ! videoconvert ! videoconvert ! video/x-raw,format=I420 ! x264enc ! decodebin ! autovideosink

注意:“4:2:2”指定“chroma subsampling", and there are nice comparisons here.

定义:

Chroma subsampling is a type of compression that reduces the color information in a signal in favor of luminance data. This reduces bandwidth without significantly affecting picture quality.