How to save rtsp video stream with correct framerate
Michael MacIntosh
mmacintosh at linear-systems.com
Mon Jun 5 19:01:54 UTC 2017
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=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=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
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170605/820d2d63/attachment.html>
More information about the gstreamer-devel
mailing list