v4l2h264enc Invalid color format in RGBA input video

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Trying to pipe video feed from v4l2src to v4l2covert and then v4l2h264enc. 
Source is an analog camera producing 50fps UYVY video. Need to convert color 
space to RGBA to get a fork of it using tee and feed it into qmlglsink somewhere 
else. Using the following pipeline, I'm getting encoded video with swapped 
colors (R in inplace of B and vice-versa):

gst-launch-1.0 v4l2src norm=PAL do-timestamp=true ! \
video/x-raw,format=UYVY,width=720,height=576 ! \
videocrop left=8 right=8 ! v4l2convert ! video/x-raw,format=RGBA ! \
v4l2h264enc ! video/x-h264,level="(string)3.1" ! filesink location="output.mp4"

So then I tried to manipulate color format info using capssetter and change 
RGBA to BGRA as encoder supports both formats and probably this would fix it. 
But after inserting the capssetter into the pipeline, it won't start and it'll 
return errors.

The pipeline:

gst-launch-1.0 v4l2src norm=PAL ! \
video/x-raw,format=UYVY,width=720,height=576 ! \
videocrop left=8 right=8 ! v4l2convert ! \
video/x-raw,format=RGBA,width=704,height=576,framerate=25/1, \
interlace-mode=progressive ! \
capssetter join=true replace=false \
caps="video/x-raw,format=BGRA,framerate=50/1" ! \
v4l2h264enc ! video/x-h264,level="(string)3.1" ! filesink location="output.mp4"

errors in gst-launch output:

GST_CAPS gstpad.c:3240:gst_pad_query_accept_caps_default:<v4l2h264enc0:sink> 
caps: video/x-raw, framerate=(fraction)50/1, interlace-mode=(string)progressive, 
format=(string)BGRA, width=(int)704, height=(int)576 were not compatible with: 
EMPTY
basetransform gstbasetransform.c:1371:gst_base_transform_setcaps:<capssetter0> 
transform could not transform video/x-raw, framerate=(fraction)25/1, 
interlace-mode=(string)progressive, format=(string)RGBA, width=(int)704, 
height=(int)576 in anything we support


Machine is a raspberrypi 4 device. Asking the same question in their forum, 
they said they "did check the byte ordering for RGBA and confirmed that it was 
correct, which means it is GStreamer that has the mismatch. You can use 
capssetter to correct the mismatch.", but I did not get answers about the output 
error after inserting capssetter into the pipeline.




[Index of Archives]     [Linux Embedded]     [Linux ARM Kernel]     [Linux for ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux Media]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux