Page 1 of 1

VLC use PCR (program clock reference) ?

Posted: 01 Sep 2015 07:04
by ranshalit
Hello,

Does anyone knows if VLC use the PCR for audio-video sync ?
When I play in vlc a .ts file which has no PCR (if you analyze the file pcr flag =0), then it still seems that video-audio is sync OK, so I'm not sure about the PCR feature:
Is PCR feature used by VLC ?
Is the sync OK just becuase I play the video and not use streaming with vlc that everything is OK ?
Is PCR feature actually required for audio-video sync ?

This is the sample:
https://drive.google.com/file/d/0B22GsW ... sp=sharing

Regards,
Ran

Re: VLC use PCR (program clock reference) ?

Posted: 01 Sep 2015 07:49
by betruek
In MPEG-2 TS specification, PCR is used to synchronize audio, video, subtitle, etc. Audio and video have PTS that is related to PCR. PCR appears repeatedly in the bitstream. So you can synchronize audio and video from any position in the stream. Pavtube video converter will be handled between video decoder and video renderer. You can use this video converter to make sure the video/audio is sync for viewing.

Re: VLC use PCR (program clock reference) ?

Posted: 01 Sep 2015 08:05
by Rémi Denis-Courmont
Yes, VLC uses the PCR, or at least it tries to.

Re: VLC use PCR (program clock reference) ?

Posted: 01 Sep 2015 11:00
by ranshalit
Hi Re'mi, betruek,

Thank you for the response,
I can play the ts video in the link (in my above post), although the PCR flag in it is 0. And there seems to be audio-video sync in the video being played. Does it make sense ? Is it becuase I don't stream the video, but just play it ? As I understand, if PCR flag is 0, it means that VLC will not use the PCR for the sync in such case.


Regards,
Ran

Re: VLC use PCR (program clock reference) ?

Posted: 01 Sep 2015 11:27
by Rémi Denis-Courmont
A/V sync is done according to PTS, not PCR. PCR is only used to drive buffering.

Re: VLC use PCR (program clock reference) ?

Posted: 01 Sep 2015 11:46
by ranshalit
Hi Remi,

Thank you for the time.
If I understand you correctly then this answers my questions:
The encoder, which generate TS stream to VLC is required to:
1. use PCR, 27Mhz, as reference for the muxed PTS value in the stream ?
YES, This is required for VLC demuxing.
2. transfer the PCR value in the mux every cycle time which is less then 100msec (according to ts standard)?
NO, not required for VLC demuxing.

Thank you,
Ran

Re: VLC use PCR (program clock reference) ?

Posted: 01 Sep 2015 17:36
by ranshalit
Hi,

If I may ask one last question in this thread please.
With the attached file there is no PCR sync (pcr flag is always zero), but yet there is still audio-video lips sync when played with VLC.
Does anyone knows how can it be ?

Thank you,
Ran