[futurebasic] Re: [FB] Movie and GetMediaSampleReference

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2001 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Sun, 10 Jun 2001 04:30:30 -0400
>The only way I can figure out how to get a sample duration for a
>pre-exiting movie is using  FN GetMediaSampleReference.
>
>But it won't return the appropriate info. Not sure why, if I am shipping
>bad starting sample info , etc.
<snips a plenty>
>Thanks. I hope. :)
>
>Robert Covington

Wahoo. :)

In the midst of despair, comes solutions. :)

SampleNumToMediaTime!  But actually,  GetMediaSampleCount and a little
math, same result.


Some snippage:


FN FBQTOpen(gMovieBlockPtr,gfilename$,gvolRefNum%) // hacked, no window,
movie ptr only.
MyMovie&  = gMovieBlockPtr.MovieH
gduration=FN GETMOVIEDURATION(MyMovie&)
DIM theTime&,theSamp&
theTime&= FN GetMovieTimeScale(MyMovie&)
theTrack& = FN GetMovieTrack(myMovie&,1)
Long if theTrack&
theSamp& = FN GetTrackMedia(theTrack&)
Print "Number of samples : " + STR$( FN GetMediaSampleCount(theSamp&))
Call SampleNumToMediaTime(theSamp&,1,=_nil,mySample&)
Xelse
Beep
End If
Print "Duration: ";gduration
Print "TimeScale is: " ;theTime&
Print "Frames Per Second: "; theTime&/mySample&


This is one time where theMedia has been helpful.

RC