cubecubed
cubecubed

Reputation: 238

yuv420p pixel format in GStreamer?

I am trying to stream a video from opencv/python to rtsp-simple-server via GStreamer. I am able to view the video fine in vlc, but the online streaming application I am using is very picky. I need the stream to have a pixel format of yuv420p. How do I convert a stream to this format with GStreamer?

This is my current code which creates a stream with the yuv444p:

out = cv2.VideoWriter('appsrc ! videoconvert' + \
' ! x264enc speed-preset=ultrafast bitrate=600 key-int-max=40' + \
' ! rtspclientsink location=rtsp://localhost:554/video',
cv2.CAP_GSTREAMER, 0, fps, (width, height), True)

I am looking for the GStreamer equivalent of -pix_fmt yuv420p

Upvotes: 0

Views: 1904

Answers (1)

Florian Zwoch
Florian Zwoch

Reputation: 7383

.. videoconvert ! video/x-raw, format=I420 ! x264enc ..

You could also tell x264 to use a specific profile that does 420 instead:

.. x264enc ! video/x-h264, profile=main ! ..

Both methods should work.

Upvotes: 3

Related Questions