gstreamer behavior over the network

We have a Y4M file we are encoding, multicasting and decoding using two tegra x2s. If we encode the video and send it to 127.0.0.1 and decode it, it is smooth and clear. If we send the video multicast from one x2 to another, the video gets blotchy and jitters. We ran iperf between the two boxes and got 80Mbps with no errors.

Here is the encoder script:
CLIENT_IP=239.255.0.1
#CLIENT_IP=127.0.0.1
PORT=11265
gst-launch-1.0 filesrc location=$LOCATION ! y4mdec ! ‘video/x-raw, format=(string)I420’ ! omxh265enc control-rate=2 bitrate=10000000 ! ‘video/x-h265, stream-format=(string)byte-stream’ ! h265parse ! rtph265pay mtu=1400 ! udpsink host=$CLIENT_IP port=$PORT sync=false async=false

Here is the decode script:
CLIENT_IP=239.255.0.1
#CLIENT_IP=127.0.0.1
PORT=11265
gst-launch-1.0 udpsrc address=${CLIENT_IP} port=${PORT} ! application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse ! omxh265dec ! nvoverlaysink -e

Any pointers would be helpful.
Thanks,
K-

Hi,
Could you try rtspsink and rtspsrc?
[url]https://devtalk.nvidia.com/default/topic/1014789/jetson-tx1/-the-cpu-usage-cannot-down-use-cuda-decode-/post/5188538/#5188538[/url]

Our requirements are to use UDP multicast. Thanks.
K-

UDP protocol does not ensure the completeness of data. Probably sps/pps is dropped. Can you set insert-sps-pps=true in encoder and try?

I don’t have that option:

nvidia@tegra-ubuntu:~$ gst-inspect-1.0 omxh265enc | grep insert
nvidia@tegra-ubuntu:~$

nvidia@tegra-ubuntu:~$ gst-inspect-1.0 omxh265enc
Factory Details:
Rank primary + 10 (266)
Long-name OpenMAX H.265 Video Encoder
Klass Codec/Encoder/Video
Description Encode H.265 video streams
Author Sanket Kothari skothari@nvidia.com

Plugin Details:
Name omx
Description GStreamer OpenMAX Plug-ins
Filename /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstomx.so
Version 1.0.0.1
License LGPL
Source module gst-omx
Source release date 2014-02-08
Binary package GStreamer source release
Origin URL Unknown package origin

GObject
±—GInitiallyUnowned
±—GstObject
±—GstElement
±—GstVideoEncoder
±—GstOMXVideoEnc
±—GstOMXH265Enc
±—GstOMXH265Enc-omxh265enc

Implemented Interfaces:
GstPreset

Pad Templates:
SRC template: ‘src’
Availability: Always
Capabilities:
video/x-h265
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
stream-format: { byte-stream, hvc1 }
alignment: au

SINK template: ‘sink’
Availability: Always
Capabilities:
video/x-raw(memory:NVMM)
format: { I420, NV12 }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
video/x-raw
format: { I420, NV12 }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]

Element Flags:
no flags set

Element Implementation:
Has change_state() function: gst_omx_video_enc_change_state

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
SINK: ‘sink’
Pad Template: ‘sink’
SRC: ‘src’
Pad Template: ‘src’

Element Properties:
name : The name of the object
flags: readable, writable
String. Default: “omxh265enc-omxh265enc0”
parent : The parent of the object
flags: readable, writable
Object of type “GstObject”
control-rate : Bitrate control method
flags: readable, writable, changeable only in NULL or READY state
Enum “GstOMXVideoEncControlRate” Default: 1, “variable”
(0): disable - Disable
(1): variable - Variable
(2): constant - Constant
(3): variable-skip-frames - Variable Skip Frames
(4): constant-skip-frames - Constant Skip Frames
bitrate : Target bitrate
flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
Unsigned Integer. Range: 0 - 4294967295 Default: 4000000
quant-i-frames : Quantization parameter for I-frames (0xffffffff=component default)
flags: readable, writable, changeable only in NULL or READY state
Unsigned Integer. Range: 0 - 4294967295 Default: 4294967295
quant-p-frames : Quantization parameter for P-frames (0xffffffff=component default)
flags: readable, writable, changeable only in NULL or READY state
Unsigned Integer. Range: 0 - 4294967295 Default: 4294967295
quant-b-frames : Quantization parameter for B-frames (0xffffffff=component default)
flags: readable, writable, changeable only in NULL or READY state
Unsigned Integer. Range: 0 - 4294967295 Default: 4294967295
iframeinterval : Encoding Intra Frame occurance frequency
flags: readable, writable, changeable only in NULL or READY state
Unsigned Integer. Range: 0 - 4294967295 Default: 0
SliceIntraRefreshEnable: Enable Slice Intra Refresh while encoding
flags: readable, writable, changeable only in NULL or READY state
Boolean. Default: false
SliceIntraRefreshInterval: Set SliceIntraRefreshInterval
flags: readable, writable, changeable only in NULL or READY state
Unsigned Integer. Range: 0 - 4294967295 Default: 60
bit-packetization : Whether or not Packet size is based upon Number Of bits
flags: readable, writable, changeable only in NULL or READY state
Boolean. Default: false
vbv-size : virtual buffer size = vbv-size * (bitrate/fps)
flags: readable, writable, changeable only in NULL or READY state
Unsigned Integer. Range: 0 - 30 Default: 10
temporal-tradeoff : Temporal Tradeoff value for encoder
flags: readable, writable, changeable only in NULL or READY state
Enum “GstOmxVideoEncTemporalTradeoffType” Default: 0, “Do not drop frames”
(0): Do not drop frames - GST_OMX_VIDENC_DROP_NO_FRAMES
(1): Drop 1 in 5 frames - GST_OMX_VIDENC_DROP_1_IN_5_FRAMES
(2): Drop 1 in 3 frames - GST_OMX_VIDENC_DROP_1_IN_3_FRAMES
(3): Drop 1 in 2 frames - GST_OMX_VIDENC_DROP_1_IN_2_FRAMES
(4): Drop 2 in 3 frames - GST_OMX_VIDENC_DROP_2_IN_3_FRAMES
EnableMVBufferMeta : Enable Motion Vector Meta data for encoding
flags: readable, writable, changeable only in NULL or READY state
Boolean. Default: false
qp-range : Qunatization range for P and I frame,
Use string with values of Qunatization Range
in MinQpP-MaxQpP:MinQpI-MaxQpP:MinQpB-MaxQpB order, to set the property.
flags: readable, writable
String. Default: “-1,-1:-1,-1:-1,-1”
MeasureEncoderLatency: Enable Measure Encoder latency Per Frame
flags: readable, writable, changeable only in NULL or READY state
Boolean. Default: false
EnableTwopassCBR : Enable two pass CBR while encoding
flags: readable, writable, changeable only in NULL or READY state
Boolean. Default: false
preset-level : HW preset level for encoder
flags: readable, writable, changeable only in NULL or READY state
Enum “GstOMXVideoEncHwPreset” Default: 0, “UltraFastPreset”
(0): UltraFastPreset - UltraFastPreset for high perf
(1): FastPreset - FastPreset
(2): MediumPreset - MediumPreset
(3): SlowPreset - SlowPreset
slice-header-spacing: Slice Header Spacing number of macroblocks/bits in one packet
flags: readable, writable, changeable only in NULL or READY state
Unsigned Long. Range: 0 - 18446744073709551615 Default: 0

Element Actions:
“force-IDR” : void user_function (GstElement* object);

Hi,
My bad, it is supported in H264, not H265.

Can you try to dump the H265stream and check the data integrity?
gst-launch-1.0 udpsrc address=${CLIENT_IP} port=${PORT} ! application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse ! ‘video/x-h265,stream-format=byte-stream’ ! filesink location=a.265 -e

DaneLLL,

Thanks. Turns out the fix is to use sync=true instead of sync=false.
K-