gst-launch-1.0 with -e or without -e

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

gst-launch-1.0 with -e or without -e

bojan74
I know that option -e means "Force EOS on sources before shutting the pipeline down".
But what exactly happens behind?

For example this creates test.mp4 with video stream.
gst-launch-1.0 -e videotestsrc is-live=true ! x264enc ! mp4mux ! filesink location="test.mp4"

But this does not, there is no video stream inside mp4 file.
gst-launch-1.0 videotestsrc is-live=true ! x264enc ! mp4mux ! filesink location="test.mp4"

It looks that -e helps in some way that video stream is added into mp4 file.

I am asking this because also in c code application I have similar problem. I don't get video stream inside mp4 file. So I guess I should call something in code when stream is ended what will create header for video stream inside mp4 file. At the end of c code I set pipeline to GST_STATE_NULL but that doesn't help.
gst_element_set_state(pipeline, GST_STATE_NULL);
Reply | Threaded
Open this post in threaded view
|

Re: gst-launch-1.0 with -e or without -e

killerrats
Administrator
-e makes the the mp4mux throw out the ending header to make the file complete in reading the file in a video player. have the -e not in it and use the following things below, if that doesn't work put in the -e.

what you might do is:

1. gst_element_send_event(pipeline,gst_event_new_eos());

then do your nulling and unreferencing.
------------------------------
Gstreamer 1.16.2
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: gst-launch-1.0 with -e or without -e

Nicolas Dufresne-5
Le mardi 17 janvier 2017 à 10:46 -0800, killerrats a écrit :
> what you might do is:
>
> 1. gst_element_send_event(pipeline,gst_event_new_eos());
>
> then do your nulling and unreferencing.

Indeed -e wills end an EOS event. Though, you should wait for the EOS
message before turning off your pipeline. Otherwise the EOS event might
not yet have been processed by your sinks.

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

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

Re: gst-launch-1.0 with -e or without -e

bojan74
For test I changed code now in the following way:

1. I installed ctrl-c handler
2. When ctrl-c is pressed I call suggested: gst_element_send_event(pipeline, gst_event_new_eos());
3. Inside bus handler I just do:
        case GST_MESSAGE_EOS:
                g_main_loop_quit(loop);
                break;
4. After g_main_loop_run I call gst_element_set_state(pipeline, GST_STATE_NULL);

And it works now! I got video stream inside mp4 file.

Big thank to both of you!
Reply | Threaded
Open this post in threaded view
|

AW: gst-launch-1.0 with -e or without -e

Thornton, Keith
In reply to this post by killerrats
Hi, you failed to mention that it is necessary to wait for the EOS message to arrive at the sink. This can either be done by waiting for the EOS message on the bus or by setting a pad probe on the sink.


-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von killerrats
Gesendet: Dienstag, 17. Januar 2017 19:47
An: [hidden email]
Betreff: Re: gst-launch-1.0 with -e or without -e

-e makes the the mp4mux throw out the ending header to make the file complete in reading the file in a video player. have the -e not in it and use the following things below, if that doesn't work put in the -e.

what you might do is:

1. gst_element_send_event(pipeline,gst_event_new_eos());

then do your nulling and unreferencing.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/gst-launch-1-0-with-e-or-without-e-tp4681497p4681502.html
Sent from the GStreamer-devel mailing list archive at 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