Hi, I’m using Jetson AGX Xavier and having an issue when terminating Gstreamer app (via OpenCV).
when the encoding pipeline is finished, it just waits forever increasing the output file size unlimitly.
here are the detail,
- Gstreamer by OpenCV frame work
it is writing the opencv mat images and muxing the silence audo stream. it is to playback well with some browser which needs an audio stream.
// // pipeline and open pipeline = "appsrc ! video/x-raw, format=(string)BGR " "! queue ! videoconvert ! video/x-raw, format(string)I420 " "! nvvidconv ! video/x-raw(memory:NVMM), width=4096, height=2060 " "! queue ! omxh265enc qp-range=15,30:5,20:-1,-1 temporal-tradeoff=0 " "control-rate=0 quality-level=3 profile=8 " "! video/x-h265 ! h265parse ! mux. audiotestsrc wave=silence freq=200 ! " "voaacenc ! aacparse ! queue ! mux. mpegtsmux name=mux ! hlssink " "max-files=0 playlist-length=0 target-duration=2 playlist-location=playlist%d.ts location=playlist.m3u8 "; //opencv videowriter video_writer.open(gstr, cv::CAP_GSTREAMER, 0, m_fps, m_size, true); // // in the loop video_writer.write(mat_image); // when terminate // exit the loop above // and call the video_writer.release() if necessary. (but it is called in the destructor) // but the process hangs here. and keeps accumulating output file size increased. video_writer.release() ;
I guess even though there is no image to input, stil the audiotestsrc is feeding the pipeline infinitely.
Could you give me some advice here such as…
is it correct way to add dummy silence audio stream when encode video?
does the pipeline look good? or is there any unecesarry part?