Freescale / gstreamer-imx

GStreamer 1.0 plugins for i.MX platforms
Other
184 stars 127 forks source link

Constant bitrate doubles at output #214

Closed huseyinkozan closed 3 years ago

huseyinkozan commented 6 years ago

Hi,

We get 1500 kbit bitrate after setting to 700 with this command:

root@colibri-imx6:~# gst-launch-1.0 imxv4l2src device=/dev/video0 ! imxvpuenc_h264 bitrate=700 ! fdsink | pv > /dev/null
^C22MiB 0:00:08 [ 170kiB/s] [                      <=>                                                                                                                      ]

Hardware and software details can be found this Toradex issue: https://www.toradex.com/community/questions/28775/gstreamer-700kbit-constant-bit-rate-encoding-produ.html

How can we investigate and fix ?

mjgigli commented 5 years ago

I am also seeing a bitrate that ranges from 1.5x to 2x from the value that I set in the bitrate parameter of the imxvpuenc_h264 plugin.

Interestingly enough, we don't see this issue with smaller resolution video streams. We run 2 different types of video streams, smaller resolution (e.g. 320x240) analog video through this same plugin, and don't see this issue. But when we run larger resolution (e.g. 1280x720) digital video through this plugin, we see this much larger bitrate that is set for this parameter.

Pehoh commented 5 years ago

You need to set the fps-n property of the imxv4l2videosrc plugin properly. By default the value is 30, if you have a video in 50fps or 60fps, the bitrate will be the double than expected.