<div dir="ltr">I'm trying to save encoded h265 data to file using next pilelines:<div>to send:</div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">appsrc</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">name=vsrc</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">videoconvert</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">video/x-raw,format=I420,width=1920,height=1080,framerate=60/1</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">"!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">omxh265enc</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">bitrate=20000000</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">control-rate=2</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">"!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">rtph265pay</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">name=pay0</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pt=96</span></pre></div><div>to receive:</div><div>gst-launch-1.0 --gst-debug-level=2 rtspsrc location=rtsp://<a href="http://10.20.55.68:4510/vd">10.20.55.68:4510/vd</a> latency=0 protocols=GST_RTSP_LOWER_TRANS_TCP ! application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse ! queue ! matroskamux ! filesink location=/home/nvidia/testcompress/video_20mbit_enc.mkv -e sync=false async=false<br></div><div><br></div><div>and it gives me next warnings:</div><div>0:00:13.408891548  8716       0x635370 WARN             matroskamux matroska-mux.c:3558:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid buffer timestamp; dropping buffer<br>0:00:14.371792889  8716       0x635370 WARN             matroskamux matroska-mux.c:3558:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid buffer timestamp; dropping buffer<br>0:00:15.345857558  8716       0x635370 WARN             matroskamux matroska-mux.c:3558:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid buffer timestamp; dropping buffer<br></div><div><br></div><div>and i got corrupted video in result</div><div>i tried to set my own timestamp:</div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">startTime</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">==</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">-</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,0)">startTime</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">it</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">time</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,0,0)">}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,128)">qint64</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ts</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,0)">it</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">time</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">-</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">startTime</span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">1e2</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,0,128)">GST_BUFFER_PTS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">buffer</span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ts</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,0,128)">GST_BUFFER_DTS</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">buffer</span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ts</span><span style="color:rgb(0,0,0)">;</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">i also tried to set do-timestamp option in appsrc:</span></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,0)">g_object_set</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">appsrc</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"do-timestamp"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">true</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,0)">g_object_set</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">appsrc</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"is-live"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">true</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,0)">g_object_set</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">appsrc</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"min-latency"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">but i get corrupted video anyway.</span></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">what is wrong?</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">example of corrupted video:</font></pre><pre style="margin-top:0px;margin-bottom:0px"><a href="https://drive.google.com/open?id=1GsLW9WEWi619YRDZw7ndmd43Nlyq4QSm">https://drive.google.com/open?id=1GsLW9WEWi619YRDZw7ndmd43Nlyq4QSm</a><font color="#000000"><br></font></pre></pre></div></div>