Hi,
I'm developing a c application with the following pipeline: rtspsrc->queue->rtph264depay->h264parse->mpegtsmux->hlssink Iv've managed to get everything to work as expected except one thing. When I manually stop the pipeline from playing state to null state like this: void * gst_main_loop(void *loop) { g_main_loop_run(loop); return 0; } int rtsp_client_stop_stream(rtsp_client_t *rtsp_client) { gst_element_set_state (rtsp_client->pipeline, GST_STATE_NULL); g_main_loop_unref(rtsp_client->loop); pthread_join(*(rtsp_client->pthread), NULL); //free the pointer gst_object_unref (GST_OBJECT (rtsp_client->pipeline)); rtsp_client->pthread = NULL; rtsp_client->loop = NULL; rtsp_client->pipeline = NULL; return 0; } The stream stops but the EXT-X-ENDLIST tag in the hls playlist file is not set. I'm I doing something wrong which results in this tag not being set? -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Le lundi 08 avril 2019 à 09:00 -0500, joakim a écrit :
> Hi, > I'm developing a c application with the following pipeline: > rtspsrc->queue->rtph264depay->h264parse->mpegtsmux->hlssink > > Iv've managed to get everything to work as expected except one thing. When I > manually stop the pipeline from playing state to null state like this: > > void * > gst_main_loop(void *loop) > { > g_main_loop_run(loop); > return 0; > } > > int > rtsp_client_stop_stream(rtsp_client_t *rtsp_client) { > gst_element_set_state (rtsp_client->pipeline, GST_STATE_NULL); > g_main_loop_unref(rtsp_client->loop); > pthread_join(*(rtsp_client->pthread), NULL); //free the pointer > gst_object_unref (GST_OBJECT (rtsp_client->pipeline)); > rtsp_client->pthread = NULL; > rtsp_client->loop = NULL; > rtsp_client->pipeline = NULL; > return 0; > } > > The stream stops but the EXT-X-ENDLIST tag in the hls playlist file is not > set. I'm I doing something wrong which results in this tag not being set? I guess you should push an EOS event to your pipeline and wait for the matching EOS message on the bus. > > > > -- > 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 |
You were right about pushing an EOS event to the pipeline. I just added one
line to my stop function and then it worked: int rtsp_client_stop_stream(rtsp_client_t *rtsp_client) { gst_element_send_event(rtsp_client->sink, gst_event_new_eos()); gst_element_set_state (rtsp_client->pipeline, GST_STATE_NULL); FILE *fp = NULL; fp = fopen(rtsp_client->playlist_path, "r"); g_main_loop_unref(rtsp_client->loop); pthread_join(*(rtsp_client->pthread), NULL); //free the pointer gst_object_unref (GST_OBJECT (rtsp_client->pipeline)); rtsp_client->pthread = NULL; rtsp_client->loop = NULL; rtsp_client->pipeline = NULL; return 0; } Thank you for the answer! -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |