<html><head>
<meta http-equiv="Content-Type" content="text/html; CHARSET=UTF-8">
<meta name="GENERATOR" content="GtkHTML/3.30.3"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>
Hello,</div><br><br>
The comment for AVCodecContext::time_base seems to indicate this variable can be interpreted two ways, depending if the content is fixed-fps or not. However, I don't see in the code how this is accounted for, for example, in mpegtssenc.c, where it wants to determine the pcr_packet_period, it appears to rely on this value being set to the 1/fps, but it does not do any explicit checks if the content is fixed-fps or not. Should this value really just be 1/fps always? A previously developer set time_base to 1/1000 in our application to indicate milliseconds, but this caused the mpeg2-ts output to have a PCR value every 100 packets which didn't meet the once every 100ms MPEG2-TS specification. Changing the time_base to 1/fps, which was 1/25 in this case, allowed a PCR at least once every 100ms. I'm worried about the side-effects this may cause and want to understand the true meaning for AVCodecContext::time_base. It there a way to tell if a codec is fixed-fps?<br><br>
Thank you,<br>
Will<br><br><br>
avcodec.h:<br><br>
typedef struct AVCodecContext {<br>
...<br><br>
/**<br>
* This is the fundamental unit of time (in seconds) in terms<br>
* of which frame timestamps are represented. For fixed-fps content,<br>
* timebase should be 1/framerate and timestamp increments should be<br>
* identically 1.<br>
* - encoding: MUST be set by user.<br>
* - decoding: Set by libavcodec.<br>
*/<br>
AVRational time_base;<br>
...<br><br>
mpegtsenc.c:<br>
..<br>
} else {<br>
// max delta PCR 0.1s<br>
service->pcr_packet_period =<br>
pcr_st->codec->time_base.den/(10*pcr_st->codec->time_base.num);<br>
}<br>
...<br><br><br></body></html>