How does VLC determine stream time for MPEG4 streams?

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
tomerm
New Cone
New Cone
Posts: 1
Joined: 24 Oct 2011 16:49

How does VLC determine stream time for MPEG4 streams?

Postby tomerm » 24 Oct 2011 16:51

Hi,

I'm currently working on integrating an old (highly customized) video server that my company has.
The old player was a custom built player as well, and the player and server were pretty much built one around the other.
Now trying to integrate it with VLC, I see a lot of problems (particularly after a seek - since at that point everything seems to go out of sync).

Sometimes (not always), after a seek the movie freezes - and when we use VLCJ to play it, the time change callback shows the time is not changing (but new packets are received).
I have checked the rtp timestamps and have tried altering them many times, but nothing seems to work (actually the times in the callback are unaffected) - which implies the problem lies within the mpeg packets (pts?).

I have looked at the times of the mpeg4 packets being released from the server (as an FFmpeg AVPacket) - pts, coded_picture_number, display_picture_number. The things I have noticed are that:
1) pts cycles through the values 2-29 (in increments of 3) and repeats.
2) decoded_picture_number is incremented by 1 each packet
3) display_picture_number is a constant 0

I have two questions:
1) Does anyone know what the problem could be, or why the values are problematic for VLC?
2) What value does VLC use to determine the movie time? pts, decoded_picture_number, display_picture_number? A combination of the values? Some other values?

Thanks,
Tomer

steve333
Blank Cone
Blank Cone
Posts: 64
Joined: 21 Dec 2008 21:24
Location: UK

Re: How does VLC determine stream time for MPEG4 streams?

Postby steve333 » 27 Oct 2011 11:45

Hi,

I'm not a VLC expert so cannot comment on what it's doing in this case, but it generally manages pretty well with a wide range of sources.

Try setting Verbosity Level 2 and check the Messages for synchronisation problems.

You should also look at the PCRs in your stream to see how System Time is being set, as that provides the master reference.

Have a look at Wikipedia (though you really need the official spec).

PTS
http://en.wikipedia.org/wiki/Presentation_time_stamp

PCR (etc.)
http://en.wikipedia.org/wiki/MPEG_transport_stream


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 56 guests