Gst.parse-launch vs manual pipeline creation

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

Gst.parse-launch vs manual pipeline creation

Krutskikh Ivan
Hi,

I use gstreamer 1.8.X with python and gi. For convenience I use Gst.parse-launch() for creating pipelines. But the more I use those approach, I stumble upon issues:

1) Sometimes set_state(Gst.State.NULL) results in gstreamer exception about some elements that should be manually set to NULL state. Sometimes (like on handling EOS message) it works, sometimes it crashes with segmentation fault with my whole multithread app =(. I came up with a workaround for simple pipelines ( no tee's etc.): I set src element to state_null and after that the whole pipeline. This kind of works, but only with straight pipelines. 

2) I cannot re-use my pipeline after it was set to state NULL. That's less of a problem: I can just re-init my pipeline from scratch.

Are both of those issues the results of my lazy approach of using Gst.parse-launch() instean of creating pipeline manually? And how can I fix this?

Thanks in advance

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

Re: Gst.parse-launch vs manual pipeline creation

Olivier Crête-3
On Mon, 2016-06-20 at 17:04 +0300, Krutskikh Ivan wrote:

> I use gstreamer 1.8.X with python and gi. For convenience I use
> Gst.parse-launch() for creating pipelines. But the more I use those
> approach, I stumble upon issues:
>
> 1) Sometimes set_state(Gst.State.NULL) results in gstreamer exception
> about some elements that should be manually set to NULL state.
> Sometimes (like on handling EOS message) it works, sometimes it
> crashes with segmentation fault with my whole multithread app =(. I
> came up with a workaround for simple pipelines ( no tee's etc.): I
> set src element to state_null and after that the whole pipeline. This
> kind of works, but only with straight pipelines.  

Are you doing something else than setting the pipeline to PLAYING then
back to NULL? What is your pipeline?


> 2) I cannot re-use my pipeline after it was set to state NULL. That's
> less of a problem: I can just re-init my pipeline from scratch.
>
> Are both of those issues the results of my lazy approach of using
> Gst.parse-launch() instean of creating pipeline manually? And how can

Normally, parse_launch() should work multiple times, unless you have
pipelines with sometimes pads like demuxers or decodebin, in that case,
the "auto-linking" only happens the first time and you need to re-
create it.

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

Re: Gst.parse-launch vs manual pipeline creation

Krutskikh Ivan
Hi!

I basically construct pipeline to interact with Ip video cams. A very simple template:

rtspsrc name=source latency=100 ! rtph264depay ! mpegtsmux name=mux  ! queue !  multisocketsink sync-method=1  name=sink

This one is used for video distribution over http in python. I experienced both of above problems on it.

2016-06-21 3:04 GMT+03:00 Olivier Crête <[hidden email]>:
On Mon, 2016-06-20 at 17:04 +0300, Krutskikh Ivan wrote:
> I use gstreamer 1.8.X with python and gi. For convenience I use
> Gst.parse-launch() for creating pipelines. But the more I use those
> approach, I stumble upon issues:
>
> 1) Sometimes set_state(Gst.State.NULL) results in gstreamer exception
> about some elements that should be manually set to NULL state.
> Sometimes (like on handling EOS message) it works, sometimes it
> crashes with segmentation fault with my whole multithread app =(. I
> came up with a workaround for simple pipelines ( no tee's etc.): I
> set src element to state_null and after that the whole pipeline. This
> kind of works, but only with straight pipelines.  

Are you doing something else than setting the pipeline to PLAYING then
back to NULL? What is your pipeline?


> 2) I cannot re-use my pipeline after it was set to state NULL. That's
> less of a problem: I can just re-init my pipeline from scratch.
>
> Are both of those issues the results of my lazy approach of using
> Gst.parse-launch() instean of creating pipeline manually? And how can

Normally, parse_launch() should work multiple times, unless you have
pipelines with sometimes pads like demuxers or decodebin, in that case,
the "auto-linking" only happens the first time and you need to re-
create it.

--
Olivier Crête
[hidden email]
_______________________________________________
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: Gst.parse-launch vs manual pipeline creation

Krutskikh Ivan
The log goes:


(python:16580): GStreamer-CRITICAL **:
Trying to dispose element demux, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.


(python:16580): GStreamer-CRITICAL **:
Trying to dispose element source, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.


(python:16580): GStreamer-CRITICAL **:
Trying to dispose element pipeline0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.


2016-06-22 17:22 GMT+03:00 Krutskikh Ivan <[hidden email]>:
Hi!

I basically construct pipeline to interact with Ip video cams. A very simple template:

rtspsrc name=source latency=100 ! rtph264depay ! mpegtsmux name=mux  ! queue !  multisocketsink sync-method=1  name=sink

This one is used for video distribution over http in python. I experienced both of above problems on it.

2016-06-21 3:04 GMT+03:00 Olivier Crête <[hidden email]>:
On Mon, 2016-06-20 at 17:04 +0300, Krutskikh Ivan wrote:
> I use gstreamer 1.8.X with python and gi. For convenience I use
> Gst.parse-launch() for creating pipelines. But the more I use those
> approach, I stumble upon issues:
>
> 1) Sometimes set_state(Gst.State.NULL) results in gstreamer exception
> about some elements that should be manually set to NULL state.
> Sometimes (like on handling EOS message) it works, sometimes it
> crashes with segmentation fault with my whole multithread app =(. I
> came up with a workaround for simple pipelines ( no tee's etc.): I
> set src element to state_null and after that the whole pipeline. This
> kind of works, but only with straight pipelines.  

Are you doing something else than setting the pipeline to PLAYING then
back to NULL? What is your pipeline?


> 2) I cannot re-use my pipeline after it was set to state NULL. That's
> less of a problem: I can just re-init my pipeline from scratch.
>
> Are both of those issues the results of my lazy approach of using
> Gst.parse-launch() instean of creating pipeline manually? And how can

Normally, parse_launch() should work multiple times, unless you have
pipelines with sometimes pads like demuxers or decodebin, in that case,
the "auto-linking" only happens the first time and you need to re-
create it.

--
Olivier Crête
[hidden email]
_______________________________________________
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