我使用如下的命令在命令行中是可以保存成功为mp4,并且可以打开的。关键就在于最后的-e,在ctrl+c结束的时候还会额外处理一下。
gst-launch-1.0 rtspsrc location=rtspurl latency=0 ! queue ! rtph264depay ! h264parse ! mp4mux ! filesink location=output.mp4 sync=false -e
但是我用gst_parse_launch函数在qt运行了之后,通过下面的内容关闭pipeline,保存的MP4却像是没有执行过-e一样无法正常的打开
GstEvent *eos_event=gst_event_new_eos();
gst_element_send_event(pipeline,eos_event);
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
所以想问一下有没有人知道怎么用qt通过gstreamer保存rtsp视频,可以不保存为mp4,保存为其他格式进行转换的也可以接收,感谢。
相似问题