Hi <span><b class="grn">Michael MacIntosh!</b></span>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?<br><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From:</b> "Michael MacIntosh [via GStreamer-devel]"; </div><div><b>Date:</b> Tuesday, Jun 6, 2017 2:51 AM</div><div><b>To:</b> "θ–›ι™θΏœ"<<a href="/user/SendEmail.jtp?type=node&node=4683217&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>>; </div><div><b>Subject:</b> Re: How to save rtsp video stream with correct framerate</div></div><div><br></div><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" target="_blank" rel="nofollow" link="external">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 target="_top" rel="nofollow" link="external"></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 style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" 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 target="_top" rel="nofollow" link="external"></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" target="_blank" rel="nofollow" link="external">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 href="/user/SendEmail.jtp?type=node&node=4683197&i=0" target="_blank" rel="nofollow" link="external">[hidden email]</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="nofollow" link="external">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
    <br>
  

<br>_______________________________________________
<br>gstreamer-devel mailing list
<br><a href="/user/SendEmail.jtp?type=node&node=4683197&i=1" target="_blank" rel="nofollow" link="external">[hidden email]</a>
<br><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="nofollow" link="external">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>

        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1" color="#cccccc">
        <div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683197.html" target="_blank" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683197.html</a>
        </div>
        <div style="color:#666; font: 11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from How to save rtsp video stream with correct framerate, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/How-to-save-rtsp-video-stream-with-correct-framerate-tp4683176p4683217.html">Re: How to save rtsp video stream with correct framerate</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>