[Live-devel] fPresentationTime fDurationInMicroseconds value setup

Ross Finlayson finlayson at live555.com
Tue Jan 26 18:08:31 PST 2010

>I need to understand the value of fPresentationTime 
>fDurationInMicroseconds. Those two are used in almost all 
>I have an IP camera, which sends out video frames in the oder of 
>pps, sps, I, P, P, P...(29 times) in a second.  So should the 
>fPresentationTime/ fDurationInMicroseconds be set as 1000/32 
>(including both pps ,sps and vidoe frames) ms or 1000/30 (only the 
>video frames) ms?

Note that "fPresentationTime" and "fDurationInMicroseconds" are 
separate variables, and both should be set (although, if you know 
that your framer will always be reading from a live source (rather 
than a file), you can probably omit setting 

(Note: Because you mention "PPS" and "SPS", I assume that you're 
referring specifically to H.264 video.)

"fDurationInMicroseconds" should be set to 1000000/framerate  for the 
NAL unit that ends a video frame (Note: This will be the NAL unit for 
which your reimplemented "currentNALUnitEndsAccessUnit()" virtual 
function will return True), and should be set to 0 for all other NAL 

Similarly, all NAL units that make up a single video frame (including 
any PPS and SPS NAL units) should be given the same 
"fPresentationTime" value (i.e., the presentation time of the video 

>It looks the framer put several video frames in a single RTP packet.

No, it's the "H264VideoRTPSink" class (i.e., our implementation of 
the RTP payload format for H.264) that takes care of packing NAL 
units into RTP packets.  You don't need to know or care about this. 
Just feed the "H264VideoRTPSink" one NAL unit at a time.

Ross Finlayson
Live Networks, Inc.

More information about the live-devel mailing list