[MPlayer-dev-eng] How to Access Audio Stream PTS

Paul Curtis pfc at terrapin.com
Tue Aug 15 00:15:38 CEST 2006


A while ago, I wrote the following:

"This application would allow me to seek around in a video stream, and
begin recording or filtering the stream audio at that point.
Additionally, this would also allow me to create as many tracks as
needed, using ardour to mix/control them at the appropriate time in the
video. The final output would then be remuxed back to the video.

However, to fully utilize mplayer as the video display/transport control
for ardour, I need to have mplayer also provide information on current
timecode for the audio stream. The 'ao_data.pts' looked to be a likely
candidate, but it is not the absolute timecode from the stream, but the
relative pts from the point at which the audio began playing. I have
looked through the 'libao2' code to see if this information is
available, but I don't see it."

I have attached the basic transport patch, but now, to fully synchronize 
'mplayer' with 'ardour' (or any jack application) I need to allow jack 
access to the current position in the stream. As you can see, the 
transport controls are easy to implement. With the patch, you can see 
'mplayer' starting and stopping the JACK transport. As a reference, the 
JACK transport control API is here:
http://jackaudio.org/files/docs/html/transport-design.html

The JackTimebaseCallback() would be called in a similar fashion to the 
JACK process callback 'outputaudio()' (in ao_jack.c). The time base 
callback would provide JACK (and all JACK applications) the current time 
position in the stream. This would mean when 'mplayer' is stopped and 
fast-forwarded, the next time play is pressed in 'mplayer', all the JACK 
applications would seek to the same time position. This allows perfect 
synchronization when adding, say, a voice over track to a video. It 
could also be used to create secondary language tracks, where a 
translator watches the video, and records the second language. This is a 
missing piece in all the Linux based video tools.

I am hoping for pointers on where to get the time information in 
mplayer, and having it available either in the ao_jack driver 
(preferable). If that is not possible, then a pointer to another 
solution would be helpful.

Regards,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ao_jack.diff
Type: text/x-patch
Size: 875 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060814/9051fcf7/attachment.bin>


More information about the MPlayer-dev-eng mailing list