[vlc-devel] Timing model used by VLC player

Todd Huang huangtodd at hotmail.com
Wed Jul 23 07:59:57 CEST 2008

    I am trying to use VLC player to play back the image data composed of AVC/H.264 video and AAC audio muxed in MPEG2 TS format (ISO 13818-1) streamed out from a media server. Since the latest release 0.8.6i (Windows) of VLC can't play H.264 data, I just use the 0.8.5 release.
    At first, the VLC seems to work smoothly. I can lively see the video and hear the sound clearly. About five minutes later, the video starts to be blocked. By the way, the warning message "late picture skipped" is frequently shown in the Message window.
    By checking the source code of the function RunThread() in src\video_output\video_output.c, this warning message will be shown when the following IF statements are true:
            if( !p_picture->b_force &&                p_picture != p_last_picture &&                display_date < current_date + p_vout->render_time &&                config_GetInt( p_vout, "drop-late-frames" ) )
    I am wondering whether this problem is caused by the incorrect timing model used in the TS header of my testing image, especially the PTS and PCR values. I have the following questions about the timing setting and wish anyone could give me your comment.
1. By checking the source code of the function PCRHandle() in modules\demux\ts.c, VLC seems to use only the 33-bit PCR_base (in 90KHz) value. Why does the VLC skip the extra 9-bit PCR_ext (in 27MHz) value?
2. Is there any relationship between the values of PTS and PCR? Currently, these two values are set to be increased with the same value in my tested data with different initial value. For example, (supposed 15 frames per second)
  PCR = 1000, PTS = 100 in 1-st PES packet (START Indicator=1 in TS header),
  PCR = 7006, PTS = 6106 in 2-nd PES packet,.........
  PCR = 13012, PTS = 12112 in 3-rd PES packet, ......
  Is the setting of PCR correct? Could anyone tell me how to correctly generate the PCR value in the TS?
News, entertainment and everything you care about at Live.com. Get it now!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080723/a0291767/attachment.html>

More information about the vlc-devel mailing list