Getting the height and width of a videoclip

William Ziegler billziegler at mac.com
Sun Jan 17 15:52:37 EST 2010


Thanks for the tip Richard, but I'll still need to check the video  
height and width to be sure it fits on the screen in the correct  
place. If it can't be queried once it's in the stack or subStack as a  
videoClip  can I constrain the final imported videoClip through a  
script when I import it from the file? I fit the video, no more than 5  
- 10 seconds worth, in a button that is the correct size, when the  
teacher is previewing it. That is the size I need it for later on for  
a student "reward". Can I play a videoClip within the rect of  a  
button? There doesn't seem to be a lot of references to manipulating  
videoClips as there are with "Players".

Bill



On 17/01/2010 18:38, William Ziegler wrote:
> I have a stack that allows teachers and parents to attach videos for
> students to write sentences about. These videos are created with
> various devices and thus have different heights and widths.  I
> currently store these videos in a default folder, and use a 'Player',
> which I probe for the Height and Width to resize large clips to a set
> maximum size.
>
> Teachers have asked if I could package all the videos into each stack
> to make it easier to send home and/or share lessons with other  
> teachers.
>
> I am having a hard time manipulating videoclips with the PLAY command
> as compared to using a 'Player' with external video files.
>
> Player example:
>
> create player "myPlayer"
> Set the filename of player "myPlayer" to fName
> put the width of  player "myPlayer" into realWidth
> put the height of player "myPlayer" into realHeight
> if the height of player "myPlayer" > 330 then
> put 330/realHeight into theRatio
> set the height of player "myPlayer" to theRatio *RealHeight
> etc.
>
> I know I can set the RATIO of stack based videoclips, but how can I
> find their initial size in order to know if their image will be too
> large?
>
> Is my best option to store the clips in the stack, temporarily export
> them to the hard drive when needed,use the file in a 'Player', then
> delete the file when finished.

NOT REALLY:

1. You cannot (as far as I know) export videoClips or audioClips that
are embedded in a stack

(actually this is an old chestnut I have been banging on about for ages
and ages)

2. If you bung all your video files in a stack the RAM overhead will
skyrocket, and on machines
that don't have buckets of RAM everything will grind to an untimely  
halt.

What you could do (as I did when faced with a similar problem with about
200 videoClips about
7 years ago) is pop each videoClip into its own substack; that way all
your videoClips won't be clogging
up the RAM at once; as you need each clip you can load the substack,
play the thing, and then
close it - thereby offloading the videoClip from the RAM, freeing RAM
for the next one.



More information about the use-livecode mailing list