How to save rtsp video stream with correct framerate

sulli_xue 912850408 at qq.com
Wed Jun 7 04:00:59 UTC 2017


Hi Michael MacIntosh!Thank you for your kind reply! I've tried your pipeline and unfortunately the result was not good,xvimage's window was frozen with only one static picture and the test.mkv was black with no pictures.Is there something wrong?




------------------ Original ------------------
From: "Michael MacIntosh [via GStreamer-devel]"; 
Date: Tuesday, Jun 6, 2017 2:51 AM
To: "θ–›ι™θΏœ"<912850408 at qq.com>; 
Subject: Re: How to save rtsp video stream with correct framerate




Hey,
     
I'm not sure what framerate you are         getting and what you are expecting, but I am going to assume         because it is an RTP source, and they can be unreliable,         porbably need to drop/duplicate frames.
     
I would try to use the videorate         element:
     
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videorate.html
     
It looks like it only accepts raw         frames, so you might need to do a full transcode to duplicate         frames.
     
So I would try something like this (I         put my changes in red):
     

     
     "gst-launch-1.0 rtspsrc do-timestamp=true is_live=true location=<a class="moz-txt-link-freetext" href="rtsp://admin:admin12345@192.168.1.64:554/h264/ch33/main/av_stream">rtsp://admin:admin12345@192.168.1.64:554/h264/ch33/main/av_stream latency=0 ! tee name=t ! queue ! application/x-rtp, media=video,framerate=25,encoding-name=H264 ! rtph264depay ! decodebin ! videorate ! x264enc ! h264parse config-interval=1 ! matroskamux ! filesink location=\"test.mkv\" t. ! queue ! decodebin ! videoconvert ! xvimagesink"      Hope that helps!
       
     Cheers,
     Michael.
     
     
     On 6/3/2017 12:59 AM, sulli_xue wrote:
     
            Now I know how to save video file with correct framerate,the pipeline is as follow:"gst-launch-1.0 rtspsrc do-timestamp=true is_live=true location=<a class="moz-txt-link-freetext" href="rtsp://admin:admin12345@192.168.1.64:554/h264/ch33/main/av_stream">rtsp://admin:admin12345@192.168.1.64:554/h264/ch33/main/av_stream latency=0 ! tee name=t ! queue ! application/x-rtp, media=video,framerate=25,encoding-name=H264 ! rtph264depay ! h264parse config-interval=1 ! matroskamux ! filesink location=\"test.mkv\" t. ! queue ! decodebin ! videoconvert ! xvimagesink" Just replace "mpegtmux" with "matroskamux" can get correct framerate number 25 by cvGetCaptureProperty(capture,CV_CAP_PROP_FPS).However cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT) still get wrong number and cvSetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES) cannot goto correct position.Could someone help me?Please~ -- View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683188.html Sent from the GStreamer-devel mailing list archive at 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
 	 	 	 	
 	
 	
 	 		If you reply to this email, your message will be added to the discussion below:
 		http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683197.html 	
 	 		 		To unsubscribe from How to save rtsp video stream with correct framerate, click here.
 		NAML



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683217.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170606/6374abb0/attachment-0001.html>


More information about the gstreamer-devel mailing list