Decodebin and queue

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

Decodebin and queue

Duchassin Frederic

Hello All,

 

I try using gstreamer API to decode a TS stream.

In order to do this, I use decodebin.

Using this command I get some artefacts on the screen:

 

gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size=20000000 ! tsdemux program-number=275 name=d d. ! multiqueue name=q d. ! q. q. ! decodebin ! queue ! imxipuvideosink q. ! queue ! decodebin ! queue ! audioconvert ! alsasink

 

But using this command, it’s working quite well:

 

gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size =20000000 ! tsdemux program-number=275 name=d d. ! multiqueue name=q d. ! q. q. ! h264parse ! queue! imxvpudec ! queue ! imxipuvideosink q. ! queue ! decodebin ! queue ! audioconvert ! alsasink

 

I suppose that the buffer between parser and decoder is needed in order to decode smoothly. (without this buffer, I get same problem than decodebin)

 

Have you got an idea about a method to add this buffer in decodebin ???

 

Thanks  in advance for your help

 

Frederic

 

 

 


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

Re: Decodebin and queue

Arjen Veenhuizen
What are you streaming? I assume that your stream is RTP payloaded. In that
case you need an rtpmp2tdepay element to strip the rtp headers. Furthermore,
rtpjitterbuffer will help with fixing out-of-order packets, e.g.:

gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size =20000000 !
rtpjitterbuffer ! rtpmp2tdepay ! queue ! tsdemux program-number=275 name=d
d. ! multiqueue name=q d. ! q. q. ! h264parse ! queue! imxvpudec ! queue !
imxipuvideosink q. ! queue ! decodebin ! queue ! audioconvert ! alsasink





--
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: Decodebin and queue

Duchassin Frederic
It's just an UDP stream.(A Transport Stream exactly)
So no need of an RTP buffer or depayloader.

Frederic


-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Arjen Veenhuizen
Envoyé : vendredi 1 septembre 2017 14:13
À : [hidden email]
Objet : Re: Decodebin and queue

What are you streaming? I assume that your stream is RTP payloaded. In that case you need an rtpmp2tdepay element to strip the rtp headers. Furthermore, rtpjitterbuffer will help with fixing out-of-order packets, e.g.:

gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size =20000000 !
rtpjitterbuffer ! rtpmp2tdepay ! queue ! tsdemux program-number=275 name=d d. ! multiqueue name=q d. ! q. q. ! h264parse ! queue! imxvpudec ! queue !
imxipuvideosink q. ! queue ! decodebin ! queue ! audioconvert ! alsasink





--
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: Decodebin and queue

Duchassin Frederic
In reply to this post by Duchassin Frederic

Hello,

 

Nobody can help me about this case ?

Maybe the best way is to build the whole pipeline but due to the fact that the video is sometimes different I had to use different parser/decoder.

So it’s quite complicated and decodebin is perfect for that.

 

BR

 

Frederic

 

De : gstreamer-devel [mailto:[hidden email]] De la part de Duchassin Frédéric
Envoyé : vendredi 1 septembre 2017 09:42
À : 'Discussion of the development of and with GStreamer'
Objet : Decodebin and queue

 

Hello All,

 

I try using gstreamer API to decode a TS stream.

In order to do this, I use decodebin.

Using this command I get some artefacts on the screen:

 

gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size=20000000 ! tsdemux program-number=275 name=d d. ! multiqueue name=q d. ! q. q. ! decodebin ! queue ! imxipuvideosink q. ! queue ! decodebin ! queue ! audioconvert ! alsasink

 

But using this command, it’s working quite well:

 

gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size =20000000 ! tsdemux program-number=275 name=d d. ! multiqueue name=q d. ! q. q. ! h264parse ! queue! imxvpudec ! queue ! imxipuvideosink q. ! queue ! decodebin ! queue ! audioconvert ! alsasink

 

I suppose that the buffer between parser and decoder is needed in order to decode smoothly. (without this buffer, I get same problem than decodebin)

 

Have you got an idea about a method to add this buffer in decodebin ???

 

Thanks  in advance for your help

 

Frederic

 

 

 


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

Re: Decodebin and queue

Nicolas Dufresne-5
Le lundi 04 septembre 2017 à 09:09 +0200, Duchassin Frederic a écrit :

> gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-
> size=20000000 ! tsdemux program-number=275 name=d d. ! multiqueue
> name=q d. ! q. q. ! decodebin ! queue ! imxipuvideosink q. ! queue !
> decodebin ! queue ! audioconvert ! alsasink
>  
> But using this command, it’s working quite well:
>  
> gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size
> =20000000 ! tsdemux program-number=275 name=d d. ! multiqueue name=q
> d. ! q. q. ! h264parse ! queue! imxvpudec ! queue ! imxipuvideosink
> q. ! queue ! decodebin ! queue ! audioconvert ! alsasink
>  
> I suppose that the buffer between parser and decoder is needed in
> order to decode smoothly. (without this buffer, I get same problem
> than decodebin)
>  
> Have you got an idea about a method to add this buffer in decodebin
> ???

I have the impression that this case will work with decodebin3, best is
to give it a try. You can also split your pipeline using parsebin !
queue ! decodebin. Though, overall, I don't understand why adding these
queue will make any difference, maybe you need to tweak the multiqueue
settings ?

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

RE: Decodebin and queue

Duchassin Frederic
I can't use decodebin3. I'm working in a embedded device and gstreamer version is 1.0. Decodebin3 is not installed.
I don't really know why this queue between parser and decoder gives better result...
So what I should do ? build the whole pipeline myself ?

Frédéric

-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Nicolas Dufresne
Envoyé : lundi 4 septembre 2017 15:21
À : Discussion of the development of and with GStreamer
Objet : Re: Decodebin and queue

Le lundi 04 septembre 2017 à 09:09 +0200, Duchassin Frederic a écrit :

> gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-
> size=20000000 ! tsdemux program-number=275 name=d d. ! multiqueue
> name=q d. ! q. q. ! decodebin ! queue ! imxipuvideosink q. ! queue !
> decodebin ! queue ! audioconvert ! alsasink
>  
> But using this command, it’s working quite well:
>  
> gst-launch-1.0 udpsrc address=239.0.0.1 port=1234 buffer-size
> =20000000 ! tsdemux program-number=275 name=d d. ! multiqueue name=q
> d. ! q. q. ! h264parse ! queue! imxvpudec ! queue ! imxipuvideosink q.
> ! queue ! decodebin ! queue ! audioconvert ! alsasink
>  
> I suppose that the buffer between parser and decoder is needed in
> order to decode smoothly. (without this buffer, I get same problem
> than decodebin)
>  
> Have you got an idea about a method to add this buffer in decodebin
> ???

I have the impression that this case will work with decodebin3, best is to give it a try. You can also split your pipeline using parsebin !
queue ! decodebin. Though, overall, I don't understand why adding these queue will make any difference, maybe you need to tweak the multiqueue settings ?

regards,
Nicolas
_______________________________________________
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: Decodebin and queue

Nicolas Dufresne-5
Le lundi 04 septembre 2017 à 15:48 +0200, Duchassin Frederic a écrit :
> I can't use decodebin3. I'm working in a embedded device and
> gstreamer version is 1.0. Decodebin3 is not installed.
> I don't really know why this queue between parser and decoder gives
> better result...
> So what I should do ? build the whole pipeline myself ?

When, everyone can update GStreamer, it's just a matter of effort
really. See by yourself what's the best use of your time.

What probably happens is that your decoder is barely fast enough. You
could also try and increase the latency (see
gst_pipeline_set_latency()).

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

RE: Decodebin and queue

Duchassin Frederic
Hello Nicolas,

I try to increase the latency (using gst_pipeline_set_latency()) but I lost the sound !

BR

Frédéric



-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Nicolas Dufresne
Envoyé : lundi 4 septembre 2017 17:19
À : Discussion of the development of and with GStreamer
Objet : Re: Decodebin and queue

Le lundi 04 septembre 2017 à 15:48 +0200, Duchassin Frederic a écrit :
> I can't use decodebin3. I'm working in a embedded device and gstreamer
> version is 1.0. Decodebin3 is not installed.
> I don't really know why this queue between parser and decoder gives
> better result...
> So what I should do ? build the whole pipeline myself ?

When, everyone can update GStreamer, it's just a matter of effort really. See by yourself what's the best use of your time.

What probably happens is that your decoder is barely fast enough. You could also try and increase the latency (see gst_pipeline_set_latency()).

regards,
Nicolas
_______________________________________________
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: Decodebin and queue

Nicolas Dufresne-5
Le mercredi 06 septembre 2017 à 12:05 +0200, Duchassin Frederic a
écrit :
> Hello Nicolas,
>
> I try to increase the latency (using gst_pipeline_set_latency()) but
> I lost the sound !

How much did you increase it ? Maybe you don't have enough buffering.

>
> BR
>
> Frédéric
>
>
>
> -----Message d'origine-----
> De : gstreamer-devel [mailto:[hidden email]
> p.org] De la part de Nicolas Dufresne
> Envoyé : lundi 4 septembre 2017 17:19
> À : Discussion of the development of and with GStreamer
> Objet : Re: Decodebin and queue
>
> Le lundi 04 septembre 2017 à 15:48 +0200, Duchassin Frederic a écrit
> :
> > I can't use decodebin3. I'm working in a embedded device and
> > gstreamer
> > version is 1.0. Decodebin3 is not installed.
> > I don't really know why this queue between parser and decoder
> > gives
> > better result...
> > So what I should do ? build the whole pipeline myself ?
>
> When, everyone can update GStreamer, it's just a matter of effort
> really. See by yourself what's the best use of your time.
>
> What probably happens is that your decoder is barely fast enough. You
> could also try and increase the latency (see
> gst_pipeline_set_latency()).
>
> regards,
> Nicolas
> _______________________________________________
> 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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Decodebin and queue

Duchassin Frederic
I don't read the latency value.
I just put 1ms.
But I get no error. Just the sound is not present.

BR

Frederic



-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Nicolas Dufresne
Envoyé : mercredi 6 septembre 2017 15:04
À : Discussion of the development of and with GStreamer
Objet : Re: Decodebin and queue

Le mercredi 06 septembre 2017 à 12:05 +0200, Duchassin Frederic a écrit :
> Hello Nicolas,
>
> I try to increase the latency (using gst_pipeline_set_latency()) but I
> lost the sound !

How much did you increase it ? Maybe you don't have enough buffering.

>
> BR
>
> Frédéric
>
>
>
> -----Message d'origine-----
> De : gstreamer-devel [mailto:[hidden email]
> p.org] De la part de Nicolas Dufresne
> Envoyé : lundi 4 septembre 2017 17:19
> À : Discussion of the development of and with GStreamer Objet : Re:
> Decodebin and queue
>
> Le lundi 04 septembre 2017 à 15:48 +0200, Duchassin Frederic a écrit
> :
> > I can't use decodebin3. I'm working in a embedded device and
> > gstreamer version is 1.0. Decodebin3 is not installed.
> > I don't really know why this queue between parser and decoder gives
> > better result...
> > So what I should do ? build the whole pipeline myself ?
>
> When, everyone can update GStreamer, it's just a matter of effort
> really. See by yourself what's the best use of your time.
>
> What probably happens is that your decoder is barely fast enough. You
> could also try and increase the latency (see
> gst_pipeline_set_latency()).
>
> regards,
> Nicolas
> _______________________________________________
> 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

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

Re: Decodebin and queue

Nicolas Dufresne-5
Le mercredi 06 septembre 2017 à 16:49 +0200, Duchassin Frederic a
écrit :
> I don't read the latency value.
> I just put 1ms.
> But I get no error. Just the sound is not present.

By forcing it to 1ms, you are likely reducing the latency, that can
explain why you lost audio (everything is late). Try something in the
range of 400ms. alsasink default latency is 200ms (can be configured
through buffer-time property).

>
> BR
>
> Frederic
>
>
>
> -----Message d'origine-----
> De : gstreamer-devel [mailto:[hidden email]
> p.org] De la part de Nicolas Dufresne
> Envoyé : mercredi 6 septembre 2017 15:04
> À : Discussion of the development of and with GStreamer
> Objet : Re: Decodebin and queue
>
> Le mercredi 06 septembre 2017 à 12:05 +0200, Duchassin Frederic a
> écrit :
> > Hello Nicolas,
> >
> > I try to increase the latency (using gst_pipeline_set_latency())
> > but I
> > lost the sound !
>
> How much did you increase it ? Maybe you don't have enough buffering.
>
> >
> > BR
> >
> > Frédéric
> >
> >
> >
> > -----Message d'origine-----
> > De : gstreamer-devel [mailto:[hidden email]
> > to
> > p.org] De la part de Nicolas Dufresne
> > Envoyé : lundi 4 septembre 2017 17:19
> > À : Discussion of the development of and with GStreamer Objet :
> > Re:
> > Decodebin and queue
> >
> > Le lundi 04 septembre 2017 à 15:48 +0200, Duchassin Frederic a
> > écrit
> > :
> > > I can't use decodebin3. I'm working in a embedded device and
> > > gstreamer version is 1.0. Decodebin3 is not installed.
> > > I don't really know why this queue between parser and decoder
> > > gives
> > > better result...
> > > So what I should do ? build the whole pipeline myself ?
> >
> > When, everyone can update GStreamer, it's just a matter of effort
> > really. See by yourself what's the best use of your time.
> >
> > What probably happens is that your decoder is barely fast enough.
> > You
> > could also try and increase the latency (see
> > gst_pipeline_set_latency()).
> >
> > regards,
> > Nicolas
> > _______________________________________________
> > 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
>
> _______________________________________________
> 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

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Decodebin and queue

Duchassin Frederic
Hello,

I try reading latency of alsasink and I get following result:
min latency : 940000000 ns
max latency : 2940000000 ns

even putting 400ms, 1s, 2s, 5 s there is always problems (image or sound failure)

Had to say that I'm working on an embedded device. (imx6 target)

BR

Frédéric


-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Nicolas Dufresne
Envoyé : mercredi 6 septembre 2017 18:31
À : Discussion of the development of and with GStreamer
Objet : Re: Decodebin and queue

Le mercredi 06 septembre 2017 à 16:49 +0200, Duchassin Frederic a écrit :
> I don't read the latency value.
> I just put 1ms.
> But I get no error. Just the sound is not present.

By forcing it to 1ms, you are likely reducing the latency, that can explain why you lost audio (everything is late). Try something in the range of 400ms. alsasink default latency is 200ms (can be configured through buffer-time property).

>
> BR
>
> Frederic
>
>
>
> -----Message d'origine-----
> De : gstreamer-devel [mailto:[hidden email]
> p.org] De la part de Nicolas Dufresne
> Envoyé : mercredi 6 septembre 2017 15:04 À : Discussion of the
> development of and with GStreamer Objet : Re: Decodebin and queue
>
> Le mercredi 06 septembre 2017 à 12:05 +0200, Duchassin Frederic a
> écrit :
> > Hello Nicolas,
> >
> > I try to increase the latency (using gst_pipeline_set_latency()) but
> > I lost the sound !
>
> How much did you increase it ? Maybe you don't have enough buffering.
>
> >
> > BR
> >
> > Frédéric
> >
> >
> >
> > -----Message d'origine-----
> > De : gstreamer-devel [mailto:[hidden email]
> > to
> > p.org] De la part de Nicolas Dufresne Envoyé : lundi 4 septembre
> > 2017 17:19 À : Discussion of the development of and with GStreamer
> > Objet :
> > Re:
> > Decodebin and queue
> >
> > Le lundi 04 septembre 2017 à 15:48 +0200, Duchassin Frederic a écrit
> > :
> > > I can't use decodebin3. I'm working in a embedded device and
> > > gstreamer version is 1.0. Decodebin3 is not installed.
> > > I don't really know why this queue between parser and decoder
> > > gives better result...
> > > So what I should do ? build the whole pipeline myself ?
> >
> > When, everyone can update GStreamer, it's just a matter of effort
> > really. See by yourself what's the best use of your time.
> >
> > What probably happens is that your decoder is barely fast enough.
> > You
> > could also try and increase the latency (see
> > gst_pipeline_set_latency()).
> >
> > regards,
> > Nicolas
> > _______________________________________________
> > 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
>
> _______________________________________________
> 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: Decodebin and queue

Tim Müller
In reply to this post by Duchassin Frederic
On Fri, 2017-09-01 at 07:41 +0000, Duchassin Frédéric wrote:

Hi Frédéric,

> I try using gstreamer API to decode a TS stream.
> In order to do this, I use decodebin.
> Using this command I get some artefacts on the screen:
>  (snip) 
> But using this command, it’s working quite well:
>  (snip)

You could also try adding a queue between udpsrc and tsdemux.

Additionally, make sure that the kernel-side UDP receive buffer is
large enough. There are two parts to this:

1) sudo /sbin/sysctl -w net.core.rmem_max=33554432

2) udpsrc buffer-size=33554432

These are example values only. You probably don't need 32MB, but the
default is really really small, so it's easy to lose packets.

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: Decodebin and queue

Duchassin Frederic
Hi Tim,

Yes of course I've already make the rmem_max modification. And even with it, it doesn't work.
In fact, Nicolas is right I put queue in video pipe in order to add latency because my audio pipe is quite slow.

BR

Frederic




-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Tim Müller
Envoyé : jeudi 7 septembre 2017 16:08
À : [hidden email]
Objet : Re: Decodebin and queue

On Fri, 2017-09-01 at 07:41 +0000, Duchassin Frédéric wrote:

Hi Frédéric,

> I try using gstreamer API to decode a TS stream.
> In order to do this, I use decodebin.
> Using this command I get some artefacts on the screen:
>  (snip)
> But using this command, it’s working quite well:
>  (snip)

You could also try adding a queue between udpsrc and tsdemux.

Additionally, make sure that the kernel-side UDP receive buffer is large enough. There are two parts to this:

1) sudo /sbin/sysctl -w net.core.rmem_max=33554432

2) udpsrc buffer-size=33554432

These are example values only. You probably don't need 32MB, but the default is really really small, so it's easy to lose packets.

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic http://gstreamer.freedesktop.org/conference/
_______________________________________________
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