Hi,

Am 27.07.2010 12:15, schrieb august:
>
> So, I noticed that when I do bgav_seek(), it seeks on both audio and
> video.  However, when I seek on bgav_seek_audio() or bgav_seek_video() using
> the sample accurate api, it only seeks on the audio or video file
> pointers.  Is that right?

Yes. In sample accurate mode all streams can be positioned independently.
In this case, bgav_seek() just calls bgav_seek_[audio|video|subtitle]() for
all active streams.

> I was just wondering if the int64_t time argument for bgav_seek_video()
> is the same thing as a gavl_time_t.  I see they are both int64_t, but
> do they mean the same thing?

No. gavl_time_t is *always* microsecond scale, while the int64_t for the
per-stream seek functions has the timescale of that stream.

> In other words, can I do:
>       gavl_time_t gt = gavl_samples_to_time( samplerate, seekto ) ;
>       bgav_seek_audio( file , 0, seekto );
>       bgav_seek_video( file, 0 , gt );

No. If seekto is the sample position, call

int64_t video_time = gavl_time_rescale(audio_format.samplerate,
                                        video_format.timescale, seekto);

But that's suboptimal because audio samples have a finer granularity than
video frames. The case below has better A/V sync after seeking.

> Also:
>
> gavl_time_t gt = gavl_frames_to_time  (timescale, frame_duration, seekto );
> bgav_seek_video(file , 0, gt );
> bgav_seek_audio( file , 0, gavl_time_to_samples( samplerate, gt  ) );

No, if seekto is the frame number, do:

int64_t video_time = seekto * frame_duration;
bgav_seek_video(file , 0, video_time );
bgav_seek_audio( file , 0, gavl_time_rescale(video_format.timescale, 
audio_format.samplerate, video_time) );

And, as noted above it's better to seek to a *video* position first and then
synchronize the audio stream to that position than vice versa.

Also note, that what you probably want to do is already implemented in
bgav_seek() and bgav_seek_scaled(), so maybe it's easier to use these functions 
instead.

> thanks-august.

Burkhard

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to