How is a video frame rate calculated in a transport stream?

Tim-Philipp Müller t.i.m at zen.co.uk
Fri Feb 15 03:51:45 PST 2013


On Thu, 2013-02-14 at 23:40 -0800, Baby Octopus wrote:

Hi,

> I want to know how is a video framerate calculated in a transport
> stream(frame rate of video/x-raw which comes out of decodebin)

It is rarely "calculated", more often extracted.

> 1. Is it the job of demuxer(tsdemux)?Is it based on dts/pts present in
> transport PES in such a case? If dts/pts id not present how does it get
> calculated?

If the demuxer has that information (e.g. in the headers), it's the job
of the demuxer. I don't think tsdemux has this information.


> 2. Is it the job of videoparse(h264parse)?

If the demuxer provides this info, the video parser will just proxy
this. If not, it may try to see if this info is present in the video
bitstream.

For H264, there's some kind of flag in the SPS that indicates if it's
fixed framerate or not. If not, then I guess you'll guess a framerate of
0/1, which stands for 'variable framerate'.

Cheers 
-Tim



More information about the gstreamer-devel mailing list