Question about decodebin and prerolling

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

Question about decodebin and prerolling

Russel Winder
Hi,

I just tried:

   gst-launch-1.0 decodebin uri=dvb://BBC%20NEWS ! x264enc ! mp4mux ! filesink location=news.mp4

but it failed due to not being able to PREROLL.

playbin can handle uri=dvb://BBC%20NEWS, but it seems decodebin cannot.
Hopefully I am missing something fairly obvious.


--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

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

Re: Question about decodebin and prerolling

Tim-Philipp Müller-2
On Thu, 2018-12-20 at 08:41 +0000, Russel Winder wrote:

Hi,

> I just tried:
>
>    gst-launch-1.0 decodebin uri=dvb://BBC%20NEWS ! x264enc ! mp4mux !
> filesink location=news.mp4
>
> but it failed due to not being able to PREROLL.
>
> playbin can handle uri=dvb://BBC%20NEWS, but it seems decodebin
> cannot. Hopefully I am missing something fairly obvious.

Hard to say what the problem is without more info but I would guess
that it's between decodebin and the encoder. Try adding a videoconvert
element. Also note that you will want to pass -e to gst-launch so your
file is finalised properly when you exit later.

Cheers
 Tim

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

Re: Question about decodebin and prerolling

Russel Winder
On Thu, 2018-12-20 at 09:10 +0000, Tim-Philipp Müller wrote:

> On Thu, 2018-12-20 at 08:41 +0000, Russel Winder wrote:
>
> Hi,
>
> > I just tried:
> >
> >    gst-launch-1.0 decodebin uri=dvb://BBC%20NEWS ! x264enc ! mp4mux !
> > filesink location=news.mp4
> >
> > but it failed due to not being able to PREROLL.
> >
> > playbin can handle uri=dvb://BBC%20NEWS, but it seems decodebin
> > cannot. Hopefully I am missing something fairly obvious.
>
> Hard to say what the problem is without more info but I would guess
> that it's between decodebin and the encoder. Try adding a videoconvert
> element. Also note that you will want to pass -e to gst-launch so your
> file is finalised properly when you exit later.
Thanks for thinking about this problem of mine, much appreciated. I am never
sure what to put in these initial "requests for help". If there is something
specific that would help you give advice, I am entirely happy to provide.

I tried:

gst-launch-1.0 -e decodebin uri=dvb://BBC%20NEWS ! videoconvert ! x264enc ! mp4mux ! filesink location=news.mp4

   Setting pipeline to PAUSED ...
   Pipeline is PREROLLING ...
   ^Chandling interrupt.
   Interrupt: Stopping pipeline ...
   ERROR: pipeline doesn't want to preroll.
   Setting pipeline to NULL ...
   Freeing pipeline ...

but got the same result.

gst-launch-1.0 playbin uri=dvb://BBC%20NEWS

puts up a window and plays the BBC News channel. So all the DVB stuff is
present and correct. It just seems that there is something playbin is doing
that decodebin isn't that causes the pipeline not to need prerolling:

   Setting pipeline to PAUSED ...
   Pipeline is live and does not need PREROLL ...
   Setting pipeline to PLAYING ...
   New clock: GstSystemClock
   Redistribute latency...
   Redistribute latency...
   Redistribute latency...
   ERROR: from element /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstXvImageSink:xvimagesink0: Output window was closed
   Additional debug info:
   xvimagesink.c(555): gst_xv_image_sink_handle_xevents (): /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstXvImageSink:xvimagesink0
   Execution ended after 0:00:03.559091765
   Setting pipeline to PAUSED ...
   Setting pipeline to READY ...
   Setting pipeline to NULL ...
   Freeing pipeline ...

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

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

AW: Question about decodebin and prerolling

BGraaf
Hello Russel,

May you send us the output from gst-launch-1.0 playbin -v
uri=dvb://BBC%20NEWS.

Seams something handled different from playbin-side.

Bernhard

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]]
Im Auftrag von Russel Winder
Gesendet: Donnerstag, 20. Dezember 2018 13:27
An: Discussion of the development of and with GStreamer
Betreff: Re: Question about decodebin and prerolling

On Thu, 2018-12-20 at 09:10 +0000, Tim-Philipp Müller wrote:

> On Thu, 2018-12-20 at 08:41 +0000, Russel Winder wrote:
>
> Hi,
>
> > I just tried:
> >
> >    gst-launch-1.0 decodebin uri=dvb://BBC%20NEWS ! x264enc ! mp4mux !
> > filesink location=news.mp4
> >
> > but it failed due to not being able to PREROLL.
> >
> > playbin can handle uri=dvb://BBC%20NEWS, but it seems decodebin
> > cannot. Hopefully I am missing something fairly obvious.
>
> Hard to say what the problem is without more info but I would guess
> that it's between decodebin and the encoder. Try adding a videoconvert
> element. Also note that you will want to pass -e to gst-launch so your
> file is finalised properly when you exit later.

Thanks for thinking about this problem of mine, much appreciated. I am never
sure what to put in these initial "requests for help". If there is something
specific that would help you give advice, I am entirely happy to provide.

I tried:

gst-launch-1.0 -e decodebin uri=dvb://BBC%20NEWS ! videoconvert ! x264enc !
mp4mux ! filesink location=news.mp4

   Setting pipeline to PAUSED ...
   Pipeline is PREROLLING ...
   ^Chandling interrupt.
   Interrupt: Stopping pipeline ...
   ERROR: pipeline doesn't want to preroll.
   Setting pipeline to NULL ...
   Freeing pipeline ...

but got the same result.

gst-launch-1.0 playbin uri=dvb://BBC%20NEWS

puts up a window and plays the BBC News channel. So all the DVB stuff is
present and correct. It just seems that there is something playbin is doing
that decodebin isn't that causes the pipeline not to need prerolling:

   Setting pipeline to PAUSED ...
   Pipeline is live and does not need PREROLL ...
   Setting pipeline to PLAYING ...
   New clock: GstSystemClock
   Redistribute latency...
   Redistribute latency...
   Redistribute latency...
   ERROR: from element
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstXvImageSink:xvimage
sink0: Output window was closed
   Additional debug info:
   xvimagesink.c(555): gst_xv_image_sink_handle_xevents ():
/GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstXvImageSink:xvimage
sink0
   Execution ended after 0:00:03.559091765
   Setting pipeline to PAUSED ...
   Setting pipeline to READY ...
   Setting pipeline to NULL ...
   Freeing pipeline ...

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

Re: AW: Question about decodebin and prerolling

Russel Winder
On Thu, 2018-12-20 at 15:23 +0100, Bernhard Graaf wrote:
> Hello Russel,
>
> May you send us the output from gst-launch-1.0 playbin -v
> uri=dvb://BBC%20NEWS.
>
> Seams something handled different from playbin-side.

Well that was informative! :-) I did as suggested and immediately discovered that the
playbin is using uridecodebin not decodebin, so I tried:

gst-launch-1.0 uridecodebin uri=dvb://BBC%20NEWS ! x264enc ! mp4mux ! filesink location=news.mp4

and it worked. Well when I say worked, I got video but no audio.

Huge step forward, but not a complete solution as yet.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

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

AW: AW: Question about decodebin and prerolling

BGraaf
You need to decode audio as well, something like:
gst-launch-1.0 uridecodebin uri=dvb://BBC%20NEWS name=d ! queue ! x264enc !
mp4mux name=m ! filesink location=news.mp4 d. ! queue ! audioencoder ! m.


-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]]
Im Auftrag von Russel Winder
Gesendet: Donnerstag, 20. Dezember 2018 17:25
An: Discussion of the development of and with GStreamer
Betreff: Re: AW: Question about decodebin and prerolling

On Thu, 2018-12-20 at 15:23 +0100, Bernhard Graaf wrote:
> Hello Russel,
>
> May you send us the output from gst-launch-1.0 playbin -v
> uri=dvb://BBC%20NEWS.
>
> Seams something handled different from playbin-side.

Well that was informative! :-) I did as suggested and immediately discovered
that the
playbin is using uridecodebin not decodebin, so I tried:

gst-launch-1.0 uridecodebin uri=dvb://BBC%20NEWS ! x264enc ! mp4mux !
filesink location=news.mp4

and it worked. Well when I say worked, I got video but no audio.

Huge step forward, but not a complete solution as yet.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

AW: AW: Question about decodebin and prerolling

BGraaf
And don't forget the -e, otherwise the file may be corrupted.
 

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]]
Im Auftrag von Bernhard Graaf
Gesendet: Donnerstag, 20. Dezember 2018 16:47
An: 'Discussion of the development of and with GStreamer'
Betreff: AW: AW: Question about decodebin and prerolling

You need to decode audio as well, something like:
gst-launch-1.0 uridecodebin uri=dvb://BBC%20NEWS name=d ! queue ! x264enc !
mp4mux name=m ! filesink location=news.mp4 d. ! queue ! audioencoder ! m.


-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]]
Im Auftrag von Russel Winder
Gesendet: Donnerstag, 20. Dezember 2018 17:25
An: Discussion of the development of and with GStreamer
Betreff: Re: AW: Question about decodebin and prerolling

On Thu, 2018-12-20 at 15:23 +0100, Bernhard Graaf wrote:
> Hello Russel,
>
> May you send us the output from gst-launch-1.0 playbin -v
> uri=dvb://BBC%20NEWS.
>
> Seams something handled different from playbin-side.

Well that was informative! :-) I did as suggested and immediately discovered
that the
playbin is using uridecodebin not decodebin, so I tried:

gst-launch-1.0 uridecodebin uri=dvb://BBC%20NEWS ! x264enc ! mp4mux !
filesink location=news.mp4

and it worked. Well when I say worked, I got video but no audio.

Huge step forward, but not a complete solution as yet.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


_______________________________________________
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: AW: AW: Question about decodebin and prerolling

Russel Winder
In reply to this post by BGraaf
On Thu, 2018-12-20 at 16:47 +0100, Bernhard Graaf wrote:
> You need to decode audio as well, something like:
> gst-launch-1.0 uridecodebin uri=dvb://BBC%20NEWS name=d ! queue ! x264enc !
> mp4mux name=m ! filesink location=news.mp4 d. ! queue ! audioencoder ! m.

I am a real beginner at this sorry, playbin has done it all for me to date!

There doesn't seem to be a 'audioencoder' element.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

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

AW: AW: AW: Question about decodebin and prerolling

BGraaf
Audioencoder is only a synonymous for what encoder you want to use (mpgeg,
ac3, and so on).

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]]
Im Auftrag von Russel Winder
Gesendet: Donnerstag, 20. Dezember 2018 19:37
An: Discussion of the development of and with GStreamer
Betreff: Re: AW: AW: Question about decodebin and prerolling

On Thu, 2018-12-20 at 16:47 +0100, Bernhard Graaf wrote:
> You need to decode audio as well, something like:
> gst-launch-1.0 uridecodebin uri=dvb://BBC%20NEWS name=d ! queue ! x264enc
!
> mp4mux name=m ! filesink location=news.mp4 d. ! queue ! audioencoder ! m.

I am a real beginner at this sorry, playbin has done it all for me to date!

There doesn't seem to be a 'audioencoder' element.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

Re: AW: AW: Question about decodebin and prerolling

Russel Winder
In reply to this post by BGraaf
On Thu, 2018-12-20 at 16:53 +0100, Bernhard Graaf wrote:
> And don't forget the -e, otherwise the file may be corrupted.

Indeed.

Of course the problem is how to translate the gst-launch-1.0 graph into Rust
code.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

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

Re: AW: AW: AW: Question about decodebin and prerolling

Russel Winder
In reply to this post by BGraaf
On Thu, 2018-12-20 at 18:41 +0100, Bernhard Graaf wrote:
> Audioencoder is only a synonymous for what encoder you want to use (mpgeg,
> ac3, and so on).
>

I had been hoping it was a smart element working according to the format of
input, otherwise you have to know ahead of time what formats are in use.

As it happens the test file has a52 format, and the MPEG-4 file should have
AAC (I believe, this is not a fact!) Whilst there is an a52dec element, the
faac element is not in the bad plugin as reported at  
https://gstreamer.freedesktop.org/documentation/plugins.html

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

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

AW: AW: AW: AW: Question about decodebin and prerolling

BGraaf
Mp4mux is supporting these audio formats (gst-inspect-1.0 mp4mux):
  SINK template: 'audio_%u'
    Availability: On request
    Capabilities:
      audio/mpeg
            mpegversion: 1
                  layer: [ 1, 3 ]
               channels: [ 1, 2 ]
                   rate: [ 1, 2147483647 ]
      audio/mpeg
            mpegversion: 4
          stream-format: raw
               channels: [ 1, 8 ]
                   rate: [ 1, 2147483647 ]
      audio/x-ac3
               channels: [ 1, 6 ]
                   rate: [ 1, 2147483647 ]
      audio/x-alac
               channels: [ 1, 2 ]
                   rate: [ 1, 2147483647 ]
      audio/x-opus
        channel-mapping-family: [ 0, 255 ]
               channels: [ 1, 8 ]
                   rate: [ 1, 2147483647 ]

Therefore you should use avenc_ac3

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]]
Im Auftrag von Russel Winder
Gesendet: Donnerstag, 20. Dezember 2018 20:07
An: Discussion of the development of and with GStreamer
Betreff: Re: AW: AW: AW: Question about decodebin and prerolling

On Thu, 2018-12-20 at 18:41 +0100, Bernhard Graaf wrote:
> Audioencoder is only a synonymous for what encoder you want to use (mpgeg,
> ac3, and so on).
>

I had been hoping it was a smart element working according to the format of
input, otherwise you have to know ahead of time what formats are in use.

As it happens the test file has a52 format, and the MPEG-4 file should have
AAC (I believe, this is not a fact!) Whilst there is an a52dec element, the
faac element is not in the bad plugin as reported at  
https://gstreamer.freedesktop.org/documentation/plugins.html

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

Re: Question about decodebin and prerolling

Russel Winder
Bernhard,

Thanks for that bit of info. Armed with that and all the previous stuff, I
have now got a Rust program that records DVB to MPEG4 files. Couple that with
a small Rust program to schedule recording events using at, I think I have
exactly what the user asked for. :-)

Thanks for you help, it aided me find out what I needed to know.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

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

Re: Question about decodebin and prerolling

Russel Winder
As a postscript to the whole playbin/decodebin/uridecodebin thing, I
discovered that:

1. playbin creates a dvbsrc to handle DVB.
2. uridecodebin creates a dvbbasebin to handle DVB.
3. dvbsrc and dvbbasebin have subtly different properties for controlling DVB.
4. uridecodebin (using dvbbasebin), queue, x264enc, avenc_ac3, mp4mux, and
filesink seem to work nicely in Rust to make a DVB → MP4 recorder.
5. decodebin.rs and encodebin.rs in the GStreamer_Rs examples were very
helpful.

If anyone has an opportunity (and desire :-) ) to take a look at:

https://github.com/Me-TV/Me-TV/blob/master/src/bin/me-tv-record.rs

and send me any constructive critique points (positive or negative), I'd be
very grateful.

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


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

signature.asc (849 bytes) Download Attachment