How to get the EOS when gstreamer stop recording

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the EOS when gstreamer stop recording

3,030 Views
陈万里
Contributor I

I with gstreamer v4l2 video display and video recording, but I will not be opened by gplay recorded video, but on the Windows can play, I doubt is my pipeline EOS has been added at the end of the massage

0 Kudos
3 Replies

2,114 Views
陈万里
Contributor I

I know CTRL+C can stop but can't play by gplay ,windows  player can .so i think i should add EOS message in pipeline bus ,but i don't know how to add ,

bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_bus_add_watch (bus, callback, NULL);

gboolean callback()
{

    GstMessage *msg;
    g_print(".");
    //if(--counter ==0){
 if(2==2){
 sleep(15);
        g_print(" display over\n");
        GST_MESSAGE_TYPE(msg)=GST_MESSAGE_EOS;
        //g_print(" %s\n",GST_MESSAGE_TYPE(msg));
 printf("ppp\n");
        //gst_element_set_state(pipeline,GST_STATE_READY);
 //printf("READY\n");
 gst_element_send_event(pipeline,gst_event_new_eos());
 gst_element_set_state(pipeline,GST_STATE_PAUSED);
 printf("EOS\n");
        g_main_loop_quit(loop);
        return FALSE;
    }
    return TRUE;
}

0 Kudos

2,114 Views
陈万里
Contributor I

So please help me how to add EOS to pipeline ,and i can play by gplay or gst-launch ,thanks a lot

0 Kudos

2,114 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi

The -e option forces EOS on sources before shutting the pipeline down. This is useful when we write to files and want to shut down by killing gst-launch using CTRL+C or with the kill command

Regards

0 Kudos