VLC use PCR (program clock reference) ?

About encoding, codec settings, muxers and filter usage
ranshalit
Blank Cone
Blank Cone
Posts: 29
Joined: 07 Jul 2012 15:46

VLC use PCR (program clock reference) ?

Postby ranshalit » 01 Sep 2015 07:04

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

betruek
Blank Cone
Blank Cone
Posts: 26
Joined: 02 Jun 2015 07:35

Re: VLC use PCR (program clock reference) ?

Postby betruek » 01 Sep 2015 07:49

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC use PCR (program clock reference) ?

Postby Rémi Denis-Courmont » 01 Sep 2015 08:05

Yes, VLC uses the PCR, or at least it tries to.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

ranshalit
Blank Cone
Blank Cone
Posts: 29
Joined: 07 Jul 2012 15:46

Re: VLC use PCR (program clock reference) ?

Postby ranshalit » 01 Sep 2015 11:00

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC use PCR (program clock reference) ?

Postby Rémi Denis-Courmont » 01 Sep 2015 11:27

A/V sync is done according to PTS, not PCR. PCR is only used to drive buffering.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

ranshalit
Blank Cone
Blank Cone
Posts: 29
Joined: 07 Jul 2012 15:46

Re: VLC use PCR (program clock reference) ?

Postby ranshalit » 01 Sep 2015 11:46

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

ranshalit
Blank Cone
Blank Cone
Posts: 29
Joined: 07 Jul 2012 15:46

Re: VLC use PCR (program clock reference) ?

Postby ranshalit » 01 Sep 2015 17:36

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


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 4 guests