<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><font face="Comic Sans MS">Hey,</font></p>
    <p><font face="Comic Sans MS">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.</font></p>
    <p><font face="Comic Sans MS">I would try to use the videorate
        element:</font></p>
    <p><font face="Comic Sans MS"><a class="moz-txt-link-freetext" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videorate.html">https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videorate.html</a></font></p>
    <p><font face="Comic Sans MS">It looks like it only accepts raw
        frames, so you might need to do a full transcode to duplicate
        frames.</font></p>
    <p><font face="Comic Sans MS">So I would try something like this (I
        put my changes in red):</font></p>
    <p><font face="Comic Sans MS"></font><br>
    </p>
    <pre wrap="">"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</a>
latency=0 ! tee name=t ! queue ! application/x-rtp,
media=video,framerate=25,encoding-name=H264 ! rtph264depay ! <font color="#ff0000">decodebin ! videorate ! x264enc</font> ! h264parse
config-interval=1 ! matroskamux ! filesink location=\"test.mkv\" t. ! queue
! decodebin ! videoconvert ! xvimagesink"


</pre>
    <font face="Comic Sans MS">Hope that helps!<br>
      <br>
    </font><font face="Comic Sans MS">Cheers,</font><br>
    <font face="Comic Sans MS">Michael.</font><br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 6/3/2017 12:59 AM, sulli_xue wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1496476741853-4683188.post@n4.nabble.com">
      <pre wrap="">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</a>
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: <a class="moz-txt-link-freetext" href="http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683188.html">http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683188.html</a>
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>