<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p>I found some work arounds with trying to get the timestamp of the frame by using AVFormatContext which I didn't really understand through the priv_data.</p>
<pre><code><span>AVPacket</span><span>*</span><span> packet</span><span>;</span><span>
av_read_frame</span><span>(</span><span>formatCtx</span><span>,</span><span> packet</span><span>);</span><span>
</span><span>RTSPState</span><span>*</span><span> rtspState </span><span>=</span><span> formatCtx</span><span>-></span><span>priv_data</span><span>;</span><span> 
</span><span>RTPDemuxContext</span><span> </span><span>*</span><span>rtpdemux </span><span>=</span><span> rtspState</span><span>-></span><span>rtsp_streams</span><span>[</span><span>packet</span><span>-></span><span>stream_index</span><span>]-></span><span>transport_priv</span><span>;</span></code></pre>
<p>as well as </p>
<pre><code><span>RTSPState</span><span> </span><span>*</span><span>state </span><span>=</span><span> _formatCtx</span><span>-></span><span>priv_data</span><span>;</span><span> 
</span><span>RTSPStream</span><span> </span><span>*</span><span>stream </span><span>=</span><span> state</span><span>-></span><span>rtsp_streams</span><span>[</span><span>0</span><span>];</span><span> 
</span><span>RTPDemuxContext</span><span> </span><span>*</span><span>d<p>I found some work arounds with trying to get the timestamp of the 
frame by using AVFormatContext which I didn't really understand through 
the priv_data.</p><pre><code><span>AVPacket</span><span>*</span><span> packet</span><span>;</span><span>
av_read_frame</span><span>(</span><span>formatCtx</span><span>,</span><span> packet</span><span>);</span><span>
</span><span>RTSPState</span><span>*</span><span> rtspState </span><span>=</span><span> formatCtx</span><span>-></span><span>priv_data</span><span>;</span><span> 
</span><span>RTPDemuxContext</span><span> </span><span>*</span><span>rtpdemux </span><span>=</span><span> rtspState</span><span>-></span><span>rtsp_streams</span><span>[</span><span>packet</span><span>-></span><span>stream_index</span><span>]-></span><span>transport_priv</span><span>;</span></code></pre><p>as well as </p><pre><code><span>RTSPState</span><span> </span><span>*</span><span>state </span><span>=</span><span> _formatCtx</span><span>-></span><span>priv_data</span><span>;</span><span> 
</span><span>RTSPStream</span><span> </span><span>*</span><span>stream </span><span>=</span><span> state</span><span>-></span><span>rtsp_streams</span><span>[</span><span>0</span><span>];</span><span> 
</span><span>RTPDemuxContext</span><span> </span><span>*</span><span>demux </span><span>=</span><span> stream</span><span>-></span><span>transport_priv</span><span>;</span><span> 
demux</span><span>$B"*(B</span><span>timestamp</span></code></pre><p>I'd like to ask how can we call AVFormatContext from C++ side, is it through <code>av_read_frame</code> ? Is it possible to use python bindings or <code>VideoCapture</code> already wraps ffmpeg so there is no need to use <code>av_read_frame</code> but just call <code>VideoCapture</code>?</p>emux </span><span>=</span><span> stream</span><span>-></span><span>transport_priv</span><span>;</span><span> 
demux</span><span>$B"*(B</span><span>timestamp</span></code></pre>
<p>I'd like to ask how can we call AVFormatContext from C++ side, is it through <code>
av_read_frame</code> ? Is it possible to use python bindings or <code>VideoCapture</code> already wraps ffmpeg so there is no need to use
<code>av_read_frame</code> but just call <code>VideoCapture</code>?</p>
<br>
</div>
</body>
</html>