Convert YUV420 to BGR without using videoconvert in GStreamer

Andrew Max drodevilosun at gmail.com
Mon Sep 23 16:38:52 UTC 2019


I am using GSteamer, and I want to convert I420(YUV420p) to BGR(BGR24) format
without videoconvert. Pipeline:

gst-launch-1.0 filesrc location= ./Big_Buck_Bunny_1080_10s_1MB.mp4 ! qtdemux
! h264parse ! avdec_h264 ! fakesink

I don't use videoconvert plugin because it takes many CPU workload. I saw
that avdec_h264 plugins has support BGR format and I tried to chose BGR
format but the output always give I420 format ("avdec_h264 ! video/x-raw,
format=BGR !").

I tried to cast it to BGR format in source code
(gst-libav/ext/libav/gstavvidec.c\gst_ffmpeg_pixfmt_to_videoformat()) but I
got an error in line 1606
(gst-libav/gst-libs/ext/libav/libavcodec/decode.c): Assertion frame->data[i]
failed 

for (i = 0; i < num_planes; i++) {
            av_assert0(frame->data[i]);
        }

- Does my way correct? Should I modify num_planes in deocode.c? If it's not
a right way, can I convert format by using OpenCV and combine with GStreamer
pipeline?

- By the way, I intend to apply algorithm to convert image I420 to BGR after
decode. Is it correct?

If you have any good way, please tell me also.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list