GStreamer constant bitrate problem on RPI
marisol carter
carter.marisol84 at gmail.com
Tue Jul 16 05:20:50 UTC 2019
Hi,
I have RPI model 3b+ and using omx h264 encoder for streaming. I have to
use constant bitrate due to network bandwidth constraints.
according to '$gst-inspect-1.0 omxh264enc
control-rate : Bitrate control method
flags: readable, writable, changeable only in NULL
or READY state
Enum "GstOMXVideoEncControlRate" Default: -1,
"default"
(0): disable - Disable
(1): variable - Variable
(2): constant - Constant
(3): variable-skip-frames - Variable Skip Frames
(4): constant-skip-frames - Constant Skip Frames
(-1): default - Component Default'
setting control-rate to 2 should stream with a constant bitrate but
apparently, it locks. when I set control-rate to 3 it works fine. any ideas?
gst outputs:
Working one:
pi at raspberrypi:~ $ gst-launch-1.0 -v v4l2src device=/dev/video0 !
video/x-raw,width=640,height=480 ! omxh264enc control-rate=3
target-bitrate=900000 inline-header=true periodicty-idr=120 ! mpegtsmux !
udpsink port=5000 sync=false async=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw,
width=(int)640, height=(int)480, format=(string)I420,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
video/x-raw, width=(int)640, height=(int)480, format=(string)I420,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
framerate=(fraction)30/1
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink:
caps = video/x-raw, width=(int)640, height=(int)480, format=(string)I420,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
video/x-raw, width=(int)640, height=(int)480, format=(string)I420,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
framerate=(fraction)30/1
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src:
caps = video/x-h264, stream-format=(string)byte-stream,
alignment=(string)au, profile=(string)high, level=(string)4, width=(int)640,
height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/MpegTsMux:mpegtsmux0.GstPad:sink_65: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,
profile=(string)high, level=(string)4, width=(int)640, height=(int)480,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/MpegTsMux:mpegtsmux0.GstPad:src: caps = video/mpegts,
systemstream=(boolean)true, packetsize=(int)188
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = video/mpegts,
systemstream=(boolean)true, packetsize=(int)188
/GstPipeline:pipeline0/MpegTsMux:mpegtsmux0.GstPad:src: caps = video/mpegts,
systemstream=(boolean)true, packetsize=(int)188, streamheader=(buffer)<
47400030a600ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000b00d0001c100000001e020a2c32941,
474020308b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0002b0280001c10000e041f00c050448444d5688040ffffcfc1be041f00a050848444d56ff1b443f5a3175c0
>
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = video/mpegts,
systemstream=(boolean)true, packetsize=(int)188, streamheader=(buffer)<
47400030a600ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000b00d0001c100000001e020a2c32941,
474020308b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0002b0280001c10000e041f00c050448444d5688040ffffcfc1be041f00a050848444d56ff1b443f5a3175c0
>
Not working:
pi at raspberrypi:~ $ gst-launch-1.0 -v v4l2src device=/dev/video0 !
video/x-raw,width=640,height=480 ! omxh264enc control-rate=2
target-bitrate=900000 inline-header=true periodicty-idr=120 ! mpegtsmux !
udpsink port=5000 sync=false async=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw,
width=(int)640, height=(int)480, format=(string)I420,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
video/x-raw, width=(int)640, height=(int)480, format=(string)I420,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
framerate=(fraction)30/1
versions:
GStreamer 1.10.4
Linux raspberrypi 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l
GNU/Linux
pi at raspberrypi:~ $ gst-inspect-1.0
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstomx.so
Plugin Details:
Name omx
Description GStreamer OpenMAX Plug-ins
Filename
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstomx.so
Version 1.10.4
License LGPL
Source module gst-omx
Source release date 2017-02-23
Binary package GStreamer OpenMAX Plug-ins source release
Origin URL Unknown package origin
omxmpeg2videodec: OpenMAX MPEG2 Video Decoder
omxmpeg4videodec: OpenMAX MPEG4 Video Decoder
omxh263dec: OpenMAX H.263 Video Decoder
omxh264dec: OpenMAX H.264 Video Decoder
omxtheoradec: OpenMAX Theora Video Decoder
omxvp8dec: OpenMAX VP8 Video Decoder
omxmjpegdec: OpenMAX MJPEG Video Decoder
omxvc1dec: OpenMAX WMV Video Decoder
omxh264enc: OpenMAX H.264 Video Encoder
omxanalogaudiosink: OpenMAX Analog Audio Sink
omxhdmiaudiosink: OpenMAX HDMI Audio Sink
11 features:
+-- 11 elements
Thanks.
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list