h265 cbr feature in imx8mp

root@verdin-imx8mp-15460501:~# tdx-info

Software summary

Bootloader: U-Boot
Kernel version: 5.15.177-6.8.2-devel+git.5a6602cc6c32 #1 SMP PREEMPT Fri Mar 21 16:22:58 UTC 2025
Kernel command line: root=PARTUUID=82e728d5-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
Distro name: NAME=“TDX Wayland with XWayland”
Distro version: VERSION_ID=6.8.2-devel-20250421051048-build.0
Distro variant: -
Hostname: verdin-imx8mp-15460501

Hardware info

HW model: Toradex Verdin iMX8M Plus on Verdin Development Board
Toradex version: 0063 V1.1B
Serial number: 15460501
Processor arch: aarch64

Hi everyone
i want to set bitrate (CBR) in h265 enc with gstreamer pipeline but i cann’t, how can i set cbr in gstreamer pipeline?
i do like this but it doesn’t any effect:
gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=60/1 ! videoconvert ! video/x-raw,format=NV12 ! v4l2h265enc extra-controls=“controls,video_bitrate_mode=1, video_bitrate=1000000” ! h265parse ! rtph265pay config-interval=1 pt=96 ! udpsink host=192.168.10.1 port=5000
but ethernet bitrate go further from 1Mb/s

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello there!

Setting a Constant Bit Rate (CBR) for H.265 encoding on the Verdin iMX8M Plus can be a bit challenging due to limited documentation on this specific configuration. However, I can guide you on how to approach this using GStreamer, which is a powerful tool for video processing on Toradex platforms.

To start, you can use a basic GStreamer pipeline for video encoding. Here’s an example pipeline for H.264 encoding, which you can adapt for H.265:

gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videoconvert ! vpuenc_h265 bitrate=5000000 ! video/x-h265 ! h265parse ! qtmux ! filesink location=videotestsrc.mp4

In this pipeline, you can specify the bitrate parameter in the vpuenc_h265 element to set the desired bit rate. Adjust the bitrate value to suit your needs.

For more detailed information on configuring video encoding, you can refer to the Video Processing - GStreamer documentation. This resource provides comprehensive guidance on using GStreamer for various video processing tasks on Toradex hardware.

If you have any more questions or need further assistance, feel free to ask!

Best regards,
Toradex AI Assistant.

your seggestion issue:
WARNING: erroneous pipeline: no element “vpuenc_h265”

but if i use like this
root@verdin-imx8mp-15460501:~# gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=30/1 ! videoconvert ! video/x-raw,format=NV12 ! vpuenc_hevc bitrate=1000000 ! h265parse ! rtph265pay config-interval=1 pt=96 ! udpsink host=192.168.10.1 port=5000
Setting pipeline to PAUSED …
[ 215.723641] usb 2-1.1: Failed to query (GET_DEF) UVC control 11 on unit 1: -32 (exp. 2).
====== VPUENC: 4.7.2 build on Sep 1 2022 09:49:28. ======
wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Aug 31 2022 01:28:14)
vpulib: 1.1.1
firmware: 1.1.1.65535
Pipeline is live and does not need PREROLL …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstCa[ 215.785474] uvcvideo 2-1.1:1.1: Non-zero status (-71) in video completion handler.
psFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/vpuenc_hevc:vpuenc_hevc0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
WARNING: from element /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: Internal GStreamer error: code not implemented. Please file a bug at Sign in · GitLab.
Additional debug info:
…/git/gst-libs/gst/video/gstvideofilter.c(296): gst_video_filter_transform (): /GstPipeline:pipeline0/GstVideoConvert:videoconvert0:
invalid video buffer received
/GstPipeline:pipeline0/vpuenc_hevc:vpuenc_hevc0.GstPad:src: caps = video/x-h265, variant=(string)itu, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, stream-format=(string)byte-stream, alignment=(string)au, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstH265Parse:h265parse0.GstPad:sink: caps = video/x-h265, variant=(string)itu, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, stream-format=(string)byte-stream, alignment=(string)au, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstH265Parse:h265parse0.GstPad:src: caps = video/x-h265, variant=(string)itu, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, stream-format=(string)hvc1, alignment=(string)au, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, profile=(string)main, tier=(string)main, level=(string)5.1, codec_data=(buffer)01014000000080000000000099f000fcfdf8f800000f03200001001840010c01ffff014000000300800000030000030099a50240210001002e420101014000000300800000030000030099a003c08010e58da592cad9ae5c4020000003002000000303c7f1625022000100094401c0e12181828a48
/GstPipeline:pipeline0/GstRtpH265Pay:rtph265pay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H265, sprop-vps=(string)QAEMAf//AUAAAAMAgAAAAwAAAwCZpQJA, sprop-sps=(string)“QgEBAUAAAAMAgAAAAwAAAwCZoAPAgBDljaWSytmuXEAgAAADACAAAAMDx/FiUA==”, sprop-pps=(string)RAHA4SGBgopI, payload=(int)96, ssrc=(uint)1987120844, timestamp-offset=(uint)908005065, seqnum-offset=(uint)2492, a-framerate=(string)30
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H265, sprop-vps=(string)QAEMAf//AUAAAAMAgAAAAwAAAwCZpQJA, sprop-sps=(string)“QgEBAUAAAAMAgAAAAwAAAwCZoAPAgBDljaWSytmuXEAgAAADACAAAAMDx/FiUA==”, sprop-pps=(string)RAHA4SGBgopI, payload=(int)96, ssrc=(uint)1987120844, timestamp-offset=(uint)908005065, seqnum-offset=(uint)2492, a-framerate=(string)30
/GstPipeline:pipeline0/GstRtpH265Pay:rtph265pay0.GstPad:sink: caps = video/x-h265, variant=(string)itu, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, stream-format=(string)hvc1, alignment=(string)au, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, profile=(string)main, tier=(string)main, level=(string)5.1, codec_data=(buffer)01014000000080000000000099f000fcfdf8f800000f03200001001840010c01ffff014000000300800000030000030099a50240210001002e420101014000000300800000030000030099a003c08010e58da592cad9ae5c4020000003002000000303c7f1625022000100094401c0e12181828a48
/GstPipeline:pipeline0/GstRtpH265Pay:rtph265pay0: timestamp = 908006906
/GstPipeline:pipeline0/GstRtpH265Pay:rtph265pay0: seqnum = 2492
Redistribute latency…
WARNING: from element /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: Internal GStreamer error: code not implemented. Please file a bug at Sign in · GitLab.
Additional debug info:
…/git/gst-libs/gst/video/gstvideofilter.c(296): gst_video_filter_transform (): /GstPipeline:pipeline0/GstVideoConvert:videoconvert0:
invalid video buffer received

and now also rate is not limitted to 1000000b/s