<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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);">
Found that issue I had set DTS to AV_NOPTS_VALUE.  Once DTS and PTS are set to frame count I get the correct timing.  Now just have to solve the frozen frame issue. 
<span id="🙂">🙂</span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Libav-user <libav-user-bounces@ffmpeg.org> on behalf of william keeling <WilliamKeeling@hotmail.com><br>
<b>Sent:</b> Wednesday, April 22, 2020 4:01 PM<br>
<b>To:</b> libav-user@ffmpeg.org <libav-user@ffmpeg.org><br>
<b>Subject:</b> [Libav-user] PTS timing issues</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I am trying to create a program that encodes a PCM audio source to AAC and muxing that with a hardware encoded H.264 stream.  I have it all working other than the video stream PTS issues.  The audio stream timebase is 1/44100 and video stream timebase is 1/30
 (30 FPS fixed). As I create the packets and pass them to av_write_frame() I get the messages " <span>[flv @ 0x1666f80] Timestamps are unset in a packet for stream 1. This is deprecated and will stop working in the future. Fix your code to set the timestamps
 properly </span>[flv @ 0x1666f80] Encoder did not produce proper pts, making some up." if the initail PTS is set to 0 or "<span>[flv @ 0x6bbf80] Timestamps are unset in a packet for stream 1. This is deprecated and will stop working in the future. Fix your
 code to set the timestamps properly </span>[flv @ 0x6bbf80] Packets are not in the proper order with respect to DTS" if PTS is non zero.  The container format is FLV (flash video).  The video stream is encode by Raspberry Pi GPU using MMAL with the callback
 format FFMPEG packet and writing with av_write_frame.   </div>
<div style="text-align:start; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="text-align:right"><br>
</span></div>
<div style="text-align:start; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="text-align:right">How can I trace the code of av_write_frame? I get to mux.c line 747
</span><span style="text-align:right; font-family:Calibri,Helvetica,sans-serif">"</span><span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)">ret = s-></span><a href="https://www.ffmpeg.org/doxygen/4.0/structAVFormatContext.html#a20d80ac07e38ff5c268d15aaf2798b98" style="text-align:right; color:rgb(70,101,162); font-family:monospace,fixed; font-size:13px; text-indent:-53px; background-color:rgb(251,252,253)"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt">oformat</span></a><span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)">-></span><a href="https://www.ffmpeg.org/doxygen/4.0/structAVOutputFormat.html#a45acfafceda2496ff21c13368c438f35" style="text-align:right; color:rgb(70,101,162); font-family:monospace,fixed; font-size:13px; text-indent:-53px; background-color:rgb(251,252,253)"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt">write_packet</span></a><span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)">(s,
 pkt);" and then I do not know how to find the source for the function stored in format context for a H.264 stream.</span></div>
<div style="text-align:start; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)"><br>
</span></div>
<div style="text-align:start; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)">No matter how I set the timebase and/or the PTS I get 1 frame a second -- any Ideas? </span></div>
<div style="text-align:start; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)"><br>
</span></div>
<div style="text-align:start; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)">Thanks</span></div>
<div style="text-align:start; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="text-align:right; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; text-indent:-53px; background-color:rgb(251,252,253)">William </span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span></span><span><br>
</span><span></span><br>
</div>
</div>
</body>
</html>