LC send -1000/sec ticks , Quicktime play - 600 frames/sec
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 87
- Joined: Wed Mar 25, 2015 2:01 am
LC send -1000/sec ticks , Quicktime play - 600 frames/sec
Does anyone have an example of using the send in time command (1000 ticks/sec) with QuickTime's 600 frames/sec to co-ordinate LC animation with QT sound? Or using the move command with QT? I do ha(v|b)e derBrill's animation engine but am just learning how to use it.
Thanks,
Erik Hansen
Thanks,
Erik Hansen
Re: LC send -1000/sec ticks , Quicktime play - 600 frames/se
Hi Erik,
just to be sure:
60 ticks = 1 second
And QuickTime movies usually never have 600 frames per second, that is only the TIMESCALE,
which is not the framerate!, of most QT movies!
Best
Klaus
just to be sure:
60 ticks = 1 second
And QuickTime movies usually never have 600 frames per second, that is only the TIMESCALE,
which is not the framerate!, of most QT movies!
Best
Klaus
Re: LC send -1000/sec ticks , Quicktime play - 600 frames/se
Hi.
If you use "milliseconds", you can get your 1000/second, or any other value, but know that these are not precisely timed, being dependent on all sorts of other machine processes. So you likely cannot sync such events with anything that has its own sense of timing.
Unless that does not matter much with the QT thing you are considering.
Craig Newman
If you use "milliseconds", you can get your 1000/second, or any other value, but know that these are not precisely timed, being dependent on all sorts of other machine processes. So you likely cannot sync such events with anything that has its own sense of timing.
Unless that does not matter much with the QT thing you are considering.
Craig Newman
-
- Posts: 87
- Joined: Wed Mar 25, 2015 2:01 am
Re: LC send -1000/sec ticks , Quicktime play - 600 frames/se
Right, millis. For a teaching video even a rough approximation is good.
Along with the LiveCode Dictionary I have been studying http://lessons.runrev.com/m/4603/l/44283-using-players.
Here is what they say about timescale:
"timeScale (labeled as "Units/sec") - a read-only property that gives the time scale of the currently-loaded movie in number of frames per second. Most QuickTime video movies have a rate of 600 frames per second."
Put (the timescale of player "player 1" of stack "players") shows 1000.
Not sure how I managed to get 1000 but my startTime and endTime are working with the timescale equaling the millis.
Along with the LiveCode Dictionary I have been studying http://lessons.runrev.com/m/4603/l/44283-using-players.
Here is what they say about timescale:
"timeScale (labeled as "Units/sec") - a read-only property that gives the time scale of the currently-loaded movie in number of frames per second. Most QuickTime video movies have a rate of 600 frames per second."
Put (the timescale of player "player 1" of stack "players") shows 1000.
Not sure how I managed to get 1000 but my startTime and endTime are working with the timescale equaling the millis.
Re: LC send -1000/sec ticks , Quicktime play - 600 frames/se
Timescale has nothing to do with frames per seconds.
Timescale is an internal referencing scale to what everything else relates. You find mov with varying timescales mostly 600, I have seen numbers lower than that. A timescale of 1000 has the advantage that it is easier to calculate then the other ones when converting to min:sec:ms
The framerate is independently set from timeScale. Timescale in this setting tells the application how fast and how long to display a frame. A timescale is especially important when sychronizing audio/movie/sprites in one mov.
To convert duration and currentTime to Sec:ms you can use this
No way to get the framerate from this. If you know how many frames you have (e.g. you made your movie from images) and you know the duration of the movie in timeScale then you could calculate the framerate.
So
Kind regards
Bernd
Timescale is an internal referencing scale to what everything else relates. You find mov with varying timescales mostly 600, I have seen numbers lower than that. A timescale of 1000 has the advantage that it is easier to calculate then the other ones when converting to min:sec:ms
The framerate is independently set from timeScale. Timescale in this setting tells the application how fast and how long to display a frame. A timescale is especially important when sychronizing audio/movie/sprites in one mov.
To convert duration and currentTime to Sec:ms you can use this
Code: Select all
on mouseUp
put the currentTime of player 1 into tCurTime
put the duration of player 1 into tDur
put the timeScale of player 1 into tTS
set the numberformat to ".000"
put "CurrentTime in timeScale " & tCurTime & cr & "Duration in timescale " & tDur & cr & "TimeScale " & tTS into field "fRes"
put cr & "CurrentTime in Sec:ms " & tCurTime/tTS & cr & "Duration in Secs:ms " & tDur/tTS after field "fRes"
end mouseUp
So
is not correct."timeScale (labeled as "Units/sec") - a read-only property that gives the time scale of the currently-loaded movie in number of frames per second. Most QuickTime video movies have a rate of 600 frames per second."
Kind regards
Bernd
Re: LC send -1000/sec ticks , Quicktime play - 600 frames/se
I contacted the author of that text and he will rework it."timeScale (labeled as "Units/sec") - a read-only property that gives the time scale of the currently-loaded movie in number of frames per second. Most QuickTime video movies have a rate of 600 frames per second."
It is not from the lesson: using-players.
Kind regards
Bernd
-
- Posts: 87
- Joined: Wed Mar 25, 2015 2:01 am
Re: LC send -1000/sec ticks , Quicktime play - 600 frames/se
Thanks for the information. To be specific:
I run .mp4 and .mov clips of dance routines of 3 to 6 minutes in a player control in their own stack, "Players".
Another stack "Choreographer" represents formation dancers as in ballroom or folkloric dancing.
Both stacks can be visible at the same time, splitting the screen.
"Choreographer" is the name of the application. LiveCode Community, public domain.
Choreographer's buttons have icons with images of dancers
facing here and there and graphic arrows pointing to the next position.
I call each position an event. "100,100,4001" for "x,y,icon".
Generally one "event" per 4 bar phrase but it could be one per bar, one per beat or anything consistent.
You can step through the events (with arrows) or use animation:
"move button theDancer of stack "Choreographer" from thePrev_X,thePrev_Y to the_X,the_Y /
in theMillisecondsPerMove milliseconds without waiting // ???"
Although the movement is strictly linear (X1,Y1 to X2,Y2) it looks curvilinear and realistic.
Using player callbacks I should be able to show a new still screen every for each 4 bars of video.
I would like to sync the "move" commands with the music from mp4 or wav videos for LiveCode animation.
Someone must have done this sort of thing before. Are there examples of such code?
Thanks,
Erik Hansen
I run .mp4 and .mov clips of dance routines of 3 to 6 minutes in a player control in their own stack, "Players".
Another stack "Choreographer" represents formation dancers as in ballroom or folkloric dancing.
Both stacks can be visible at the same time, splitting the screen.
"Choreographer" is the name of the application. LiveCode Community, public domain.
Choreographer's buttons have icons with images of dancers
facing here and there and graphic arrows pointing to the next position.
I call each position an event. "100,100,4001" for "x,y,icon".
Generally one "event" per 4 bar phrase but it could be one per bar, one per beat or anything consistent.
You can step through the events (with arrows) or use animation:
"move button theDancer of stack "Choreographer" from thePrev_X,thePrev_Y to the_X,the_Y /
in theMillisecondsPerMove milliseconds without waiting // ???"
Although the movement is strictly linear (X1,Y1 to X2,Y2) it looks curvilinear and realistic.
Using player callbacks I should be able to show a new still screen every for each 4 bars of video.
I would like to sync the "move" commands with the music from mp4 or wav videos for LiveCode animation.
Someone must have done this sort of thing before. Are there examples of such code?
Thanks,
Erik Hansen