H265 UDP streaming problem

classic Classic list List threaded Threaded
7 messages Options
mp
Reply | Threaded
Open this post in threaded view
|

H265 UDP streaming problem

mp
Hello!

I have a problem with streaming H.265 video on UDP as it works only when the
receiver starts listening BEFORE the sender starts streaming. It is the same
for MPEG-TS and RTP protocol. With H.264 there is no such problem.

Exemplary sender pipeline:
gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert !
"video/x-raw, format=(string)I420" ! x265enc name=encoder  ! 'video/x-h265,
stream-format=(string)byte-stream, alignment=(string)au' ! rtph265pay
mtu=1400 ! udpsink host=127.0.0.1 port=1234

Exemplary receiver pipeline:
gst-launch-1.0 -v udpsrc port=1234 do-timestamp=true !
application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse !
queue ! avdec_h265 ! xvimagesink

Does anyone have any idea how to solve this problem?

Thanks, best regards,
Matevz



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: H265 UDP streaming problem

Nicolas Dufresne-5
Le jeudi 14 janvier 2021 à 05:41 -0600, mp a écrit :
> Hello!
>
> I have a problem with streaming H.265 video on UDP as it works only when the
> receiver starts listening BEFORE the sender starts streaming. It is the same
> for MPEG-TS and RTP protocol. With H.264 there is no such problem.
>
> Exemplary sender pipeline:
> gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert !
> "video/x-raw, format=(string)I420" ! x265enc name=encoder  ! 'video/x-h265,

Look through "gst-inspect-1.0 x265enc" properties. You likely want to configure
the key frame interval (alal key-int-max property) in order to allow the
receiver to sync and start.

> stream-format=(string)byte-stream, alignment=(string)au' ! rtph265pay
> mtu=1400 ! udpsink host=127.0.0.1 port=1234
>
> Exemplary receiver pipeline:
> gst-launch-1.0 -v udpsrc port=1234 do-timestamp=true !
> application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse !
> queue ! avdec_h265 ! xvimagesink
>
> Does anyone have any idea how to solve this problem?
>
> Thanks, best regards,
> Matevz
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: H265 UDP streaming problem

Marc Leeman
In reply to this post by mp
use config-interfal with the payloader.


On Thu, 14 Jan 2021 at 14:00, mp <[hidden email]> wrote:

>
> Hello!
>
> I have a problem with streaming H.265 video on UDP as it works only when the
> receiver starts listening BEFORE the sender starts streaming. It is the same
> for MPEG-TS and RTP protocol. With H.264 there is no such problem.
>
> Exemplary sender pipeline:
> gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert !
> "video/x-raw, format=(string)I420" ! x265enc name=encoder  ! 'video/x-h265,
> stream-format=(string)byte-stream, alignment=(string)au' ! rtph265pay
> mtu=1400 ! udpsink host=127.0.0.1 port=1234
>
> Exemplary receiver pipeline:
> gst-launch-1.0 -v udpsrc port=1234 do-timestamp=true !
> application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse !
> queue ! avdec_h265 ! xvimagesink
>
> Does anyone have any idea how to solve this problem?
>
> Thanks, best regards,
> Matevz
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
g. Marc
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: H265 UDP streaming problem

mkonstapel

And/or on a h265parse element behind the encoder. In fact, you'll probably need both Nicolas' and Nick's suggestions: the receiver needs both a key frame and the information the config-interval inserts into the stream (SPS and PPS) to start decoding.

I don't know why it would work with h264; I'd expect the same issue.

Kind regards,
Michiel

On 18-01-2021 08:33, Marc Leeman wrote:
use config-interfal with the payloader.


On Thu, 14 Jan 2021 at 14:00, mp [hidden email] wrote:
Hello!

I have a problem with streaming H.265 video on UDP as it works only when the
receiver starts listening BEFORE the sender starts streaming. It is the same
for MPEG-TS and RTP protocol. With H.264 there is no such problem.

Exemplary sender pipeline:
gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert !
"video/x-raw, format=(string)I420" ! x265enc name=encoder  ! 'video/x-h265,
stream-format=(string)byte-stream, alignment=(string)au' ! rtph265pay
mtu=1400 ! udpsink host=127.0.0.1 port=1234

Exemplary receiver pipeline:
gst-launch-1.0 -v udpsrc port=1234 do-timestamp=true !
application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse !
queue ! avdec_h265 ! xvimagesink

Does anyone have any idea how to solve this problem?

Thanks, best regards,
Matevz





_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: H265 UDP streaming problem

Marc Leeman
Indeed, H.265 and H.264 (and MPEG4pt2) should be very similar.

gst-launch-1.0 videotestsrc ! x265enc ! rtph265pay config-interval=1 !
rtpsink uri=rtp://239.1.2.3:1234
st-launch-1.0 rtpsrc uri=rtp://239.1.2.3:1234?encoding-name=H265 !
rtph265depay ! h265parse ! avdec_h265 ! videoconvert ! xvimagesink

gst-launch-1.0 videotestsrc ! x264enc ! rtph264pay config-interval=1 !
rtpsink uri=rtp://239.1.2.3:1234
gst-launch-1.0 rtpsrc uri=rtp://239.1.2.3:1234?encoding-name=H264 !
rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

Both work, though the default GOP size seems rather large. It seems
that the H264 parser only starts passing data at @I-Frame, while the
H265 parser passes data before the I-Frame (started with green image,
that got cleared up once the I-Frame was there, with H264, there was
no video before the I-Frame).


On Fri, 22 Jan 2021 at 15:15, Michiel Konstapel <[hidden email]> wrote:

>
> And/or on a h265parse element behind the encoder. In fact, you'll probably need both Nicolas' and Nick's suggestions: the receiver needs both a key frame and the information the config-interval inserts into the stream (SPS and PPS) to start decoding.
>
> I don't know why it would work with h264; I'd expect the same issue.
>
> Kind regards,
> Michiel
>
> On 18-01-2021 08:33, Marc Leeman wrote:
>
> use config-interfal with the payloader.
>
>
> On Thu, 14 Jan 2021 at 14:00, mp <[hidden email]> wrote:
>
> Hello!
>
> I have a problem with streaming H.265 video on UDP as it works only when the
> receiver starts listening BEFORE the sender starts streaming. It is the same
> for MPEG-TS and RTP protocol. With H.264 there is no such problem.
>
> Exemplary sender pipeline:
> gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! videoconvert !
> "video/x-raw, format=(string)I420" ! x265enc name=encoder  ! 'video/x-h265,
> stream-format=(string)byte-stream, alignment=(string)au' ! rtph265pay
> mtu=1400 ! udpsink host=127.0.0.1 port=1234
>
> Exemplary receiver pipeline:
> gst-launch-1.0 -v udpsrc port=1234 do-timestamp=true !
> application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse !
> queue ! avdec_h265 ! xvimagesink
>
> Does anyone have any idea how to solve this problem?
>
> Thanks, best regards,
> Matevz
>
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
g. Marc
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
mp
Reply | Threaded
Open this post in threaded view
|

Re: H265 UDP streaming problem

mp
Thank you very much guys!

I added key-int-max to x265 with lower value than default (which is 250).
But the main trick was to add "h265parse config-interval=1" before mpegtsmux
in the streamer.

Thanks again



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: H265 UDP streaming problem

Marc Leeman
Wait,

You're using RTP on top of a TS stream?

I have seen some old cameras doing that, but not anything recent.

On Wed, 27 Jan 2021 at 12:00, mp <[hidden email]> wrote:

>
> Thank you very much guys!
>
> I added key-int-max to x265 with lower value than default (which is 250).
> But the main trick was to add "h265parse config-interval=1" before mpegtsmux
> in the streamer.
>
> Thanks again
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
g. Marc
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel