VLC and precise timing information

This forum is about all development around libVLC.
dmochow
New Cone
New Cone
Posts: 2
Joined: 02 Feb 2011 19:57

VLC and precise timing information

Postby dmochow » 02 Feb 2011 20:02

Hello,
Not sure if this is the right section for this post but here goes.

I need to synchronize an external hardware device to the vlc media player's playback of a video via the parallel port. That is, I need to send out precise timing information about the time of playback (or say, number of frames shown) to the parallel port. I have thought of several ways to do this; for example, keeping track of number of frames shown in conjunction with the frame rate etc.

My questions are:
1) How often does the playback timer get incremented, where is this incrementation display in the source code, and how accurate is this timer?
2) Is there a data structure in the source code which already keeps track of the precise playback time elapsed that I could access and simply send out to the parallel port?

Thanks in advance,
JPD

fishstyc
Blank Cone
Blank Cone
Posts: 40
Joined: 19 Oct 2010 12:39

Re: VLC and precise timing information

Postby fishstyc » 02 Feb 2011 22:03

I can't really help you, but I am posting here also since I have a question that's a bit related.

What I do know is that the function libvlc_media_player_get_position( libvlc_media_player_t *p_mi )
returns the position of p_input_thread, which advances in blocks and as a consequence is not very accurate, and only updates once in a while.

I was staring at the code a bit, and I was wondering if maybe I could add a new function to libvlc (maybe libvlc_media_player_get_output_position( libvlc_media_player_t *p_mi ))
that would make use of es_out (is this the 'output stream'?) and a thing that I've come across called p_clock (which looks to me like the timer used for playback).

I don't know if I am looking in the right direction, but I think, once I understand how the code works, that such a function wouldn't be so hard to implement.

Maybe a VLC developer can shed some light on this...

dmochow
New Cone
New Cone
Posts: 2
Joined: 02 Feb 2011 19:57

Re: VLC and precise timing information

Postby dmochow » 04 Feb 2011 22:49

What is the goal of the function that you want to write? We've been measuring the timing of the video frames using an oscilloscope and can shed some light on the timing issue if that is relevant to your work.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests