If xvimagesink window is closed, the filesink continues recording but frame is frozen

lynn lynn at emailrps.com
Fri Jul 31 11:13:10 PDT 2015


Steps to Recreate:

When recording, a window pops up showing the live video and a file is
created that stores the recorded video. This is done in parallel. If the "x"
in the window is clicked to close the live video window, the video file
still increments in size and time; however, the last frame is frozen for the
time period in the video of when the "x" was clicked until when the file
recording is stopped.

Running this on Ubuntu 12.04. Here is an excerpt of my code:

CVideoMgr::CVideoMgr() {

.......

    gst_init (NULL,NULL) ;
    gError = NULL;
        
    // Create the command line string to be parsed into the pipeline
    char pipeString[3000] ;
    strcpy (pipeString, "v4l2src name=video_in ! "
        "videoflip name=video_flip ! "
        "timeoverlay valign=bottom halign=right shaded-background=true "
        "name=time_overlay ! "
        "clockoverlay halign=left valign=bottom shaded-background=true "
        "time-format=\"%m/%d/%Y %H:%M:%S\" name=clock_overlay ! "
        "videoscale ! "
        "ffmpegcolorspace name=video_color ! "
        "tee name=video_tee video_tee. ! queue ! "
        "videorate name=video_rate ! "
        "x264enc tune=zerolatency name=video_encoder ! "
        "video/x-h264, width=") ;
    strncat (pipeString, width, strlen(width)) ;
    strncat (pipeString, ", height=", 9) ;
    strncat (pipeString, height, strlen(height)) ;
    strncat (pipeString, ", framerate=", 12) ;
    strncat (pipeString, framerate, strlen(framerate)) ;
    strcat (pipeString, "/1 ! "
        "av_muxer. autoaudiosrc name=audio_in ! "
        "audio/x-raw-int, rate=8000, channels=1, depth=16 ! "
        "audioconvert name=audio_convert ! "
        "queue ! av_muxer. avimux name=av_muxer ! "
        "filesink name=file_sink " ) ;
    
    if (config->videoDisplayEnabled) {
        strcat (pipeString, "video_tee. ! "
        "queue ! videoscale ! videorate ! "
        "video/x-raw-yuv, width=") ;
        strncat (pipeString, dWidth, strlen(dWidth)) ;
        strncat (pipeString, ", height=", 9) ;
        strncat (pipeString, dHeight, strlen(dHeight)) ;
        strncat (pipeString, ", framerate=", 12) ;
        strncat (pipeString, dFramerate, strlen(dFramerate)) ;
        strncat (pipeString, "/1 ! ", 5) ;
    
        strncat (pipeString, "xvimagesink", 11) ;
    }
     
    pipeline = gst_parse_launch (pipeString, &gError) ;
    g_assert (pipeline != NULL) ;
    
    if (gError != NULL) {
        printf ("*** Main Pipeline Error ***  %s\n\n", gError->message) ;
    }
    
    videoSrc    = gst_bin_get_by_name (GST_BIN(pipeline), "video_in") ;
    g_assert (videoSrc) ;
    videoFlip   = gst_bin_get_by_name (GST_BIN(pipeline), "video_flip") ;
    g_assert (videoFlip) ;
    fileSink    = gst_bin_get_by_name (GST_BIN(pipeline), "file_sink") ;
    g_assert (fileSink) ;
    
    g_object_set (videoSrc, "device", videoPort.c_str(), NULL) ;
    g_object_set (videoFlip, "method", videoRotateMethod, NULL) ;
}

Any idea what I can do to allow the video to keep on recording as normal?

Thanks in advance!



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/If-xvimagesink-window-is-closed-the-filesink-continues-recording-but-frame-is-frozen-tp4672937.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list