Re: Player/Image Object "always buffer" Problems

2007-06-20 Thread Dave

Hi,


With the switch to and from tool mode, the image and the player are  
one frame apart, e.g. it should run like this:


FramePlayer Image
   22   22   --
   22   22 22

   27   27 22
   27   27 27

   32   3227
   32   3232

But instead it runs:

FramePlayer Image
   22   22 --
   22   22 --

   27   27 --
   27   27 22

   32   3222
   32   3222

So I am getting the buffer from the *previous* frame of the player.


Try not using imageData, use "the text of" or just "put" instead:

  put myVar into image "imageThumbnail"
or:
  set the text of image "imageThumbnail" to myVar



I have changed the code to use the "set the text of" form, but it  
behaves the manner. Also the Stack is flakey, sometimes when I double- 
click on the player object in the IDE to get its property inspector,  
RunRev Crashes with unexpected quit.


Here is the modified function:

local sgOldImageData

 


--
--  PDFGetFrameThumbnail
--
 


function PDFGetFrameThumbnail theFrameNumber,theThumbnailFilePathName
  local myCurrentTime
  local myImageData
  local myFrameRect
  local myWindowID
  local myMovieFilePathName

  --
  --  Set up the Rectangle for the Player Frame
  --
  put the rect of player "PlayerThumbnail" of card 1 of me into  
myFrameRect

  put the windowID of this stack into myWindowID

  --
  --  Calculate the Position in the Movie and Play the Frame
  --
  put the fileName of player "PlayerThumbnail" of card 1 of me into  
myMovieFilePathName
  --set the filename of player "PlayerThumbnail" of card 1 of me to  
empty
  --set the fileName of player "PlayerThumbnail" of card 1 of me to  
myMovieFilePathName


  put theFrameNumber * 24 into myCurrentTime
  set the playSelection of player "PlayerThumbnail" of card 1 of me  
to true
  set the startTime of player "PlayerThumbnail" of card 1 of me to  
myCurrentTime
  set the endTime of player "PlayerThumbnail" of card 1 of me to  
(myCurrentTime + 1)

  start player "PlayerThumbnail" of card 1 of me

  choose pointer tool
  wait .25 seconds with messages

  --
  --  Grab the Frame
  --
  --put empty into image "ImageThumbnail" of card 1 of me
  put empty into myImageData
  set the alwaysBuffer of the templateImage to false
  export snapshot from rect myFrameRect of window myWindowID to  
myImageData as JPEG


  choose browse tool
  wait .25 seconds with messages

  set the text of image "ImageThumbnail" of card 1 of me to myImageData
  if myImageData = sgOldImageData then
breakpoint
  end if

  wait 1 seconds with messages

  put myImageData into sgOldImageData
  return myImageData
end PDFGetFrameThumbnail




On 20 Jun 2007, at 17:42, J. Landman Gay wrote:


There is a subtle difference between imagedata and the content (the  
"text") of an image. In Scott Rossi's example, he also uses "text"  
and it works.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Player/Image Object "always buffer" Problems

2007-06-20 Thread Scott Rossi
Recently, Dave wrote:

> This is weird, it doesn't work here. What happens if you set
> "alwaysBuffer" to true?

Works the same.

 
> I don't understand a couple of things about your snippet:
> 
>>set the currentTime of player 1 to (F * the timeScale of player 1)
> 
> In my case the timeScale is 600, so frame number * timeScale would
> give values that are way off. I multiple by 24 which is (timeScale /
> FramesPerSecond = 24). In this case FPS is 25 (I'm hardwiring this at
> the moment since I can't find out how to get this info from the player).

I just used a relatively large time between frame changes so the updates
would be apparent.  Nothing to do with your code.

 
>>set text of img _display to myVar
> 
> is there a difference between this and:
> 
>   put myImageData into image "ImageThumbnail"

The text of an image references both its imageData and alphaData.


> It would be nice to know what "alwaysBuffer" actually does. It could
> be that there is an old copy of the buffer being used, or RunRev
> doesn't think the image has changed.

At the lower levels, I don't know what Rev is doing, but again, alwaysBuffer
forces the player's content to fall into the object hierarchy of the card,
so you can position objects in front of the player, and thus play content
behind native Rev objects.  When the alwaysBuffer is false, the players
content plays (to use an old Director-ism) direct-to-screen, so the player's
content temporarily overlaps any object in front of the player.

Setting the alwaysBuffer of images should not affect what you are doing.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Player/Image Object "always buffer" Problems

2007-06-20 Thread Trevor DeVore

On Jun 20, 2007, at 9:31 AM, Dave wrote:


Hi All,

More on this.

I changed the code to compare the current image data to the  
previous image data. When I do this, I find that the data returned  
from the snapshot command is the *same* on each iteration (the  
frames should all be different), so it's just moving the same image  
into the image object each time.


Dave,

I haven't tried what you are doing before so I'm not sure why you are  
seeing the behavior you are but if you can't get it to work you could  
try the EnhancedQT external which can export frames in PNG format to  
a variable. I'm not sure if this is documented in the version I have  
online (qtSaveMovieSnapShotToFile
 is though) but it is there and uses the API so it should be  
reliable. I could also just pass you along the handler from the EQT  
external if you wanted to incorporate it into the external you  
already have for this project (seems like you've been working on once  
based on your posts here).


/*
 * Converts a snapshot of a movie to PNG data and places it into  
theVariableName.  You can then

 * assign theVariableName to the text of an image.
 *
 * @type   command
 * @param  movieInputPath
 * @param  theVariableName
 * @param  MaxImageWidth
 * @param  MaxImageHeight
 * @param  MaintainAspectRatio (default true)
 * @param  Time (empty or < 0 to use movie poster frame).
 *
 * @return empty or error
 */


--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
[EMAIL PROTECTED]


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Player/Image Object "always buffer" Problems

2007-06-20 Thread J. Landman Gay

Dave wrote:

Hi All,

More on this.

I changed the code to compare the current image data to the previous 
image data. When I do this, I find that the data returned from the 
snapshot command is the *same* on each iteration (the frames should all 
be different), so it's just moving the same image into the image object 
each time.


Try not using imageData, use "the text of" or just "put" instead:

  put myVar into image "imageThumbnail"

or:

  set the text of image "imageThumbnail" to myVar


There is a subtle difference between imagedata and the content (the 
"text") of an image. In Scott Rossi's example, he also uses "text" and 
it works.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Player/Image Object "always buffer" Problems

2007-06-20 Thread Dave

Hi All,

More on this.

I changed the code to compare the current image data to the previous  
image data. When I do this, I find that the data returned from the  
snapshot command is the *same* on each iteration (the frames should  
all be different), so it's just moving the same image into the image  
object each time.


!STOP PRESS!

I put a breakpoint at the end of the function and I noticed that if I  
switch between Run Mode and IDE Mode then continue, it works!!!


So, why should this have an effect? It seems that the correct image  
is NOT transfered if the run mode isn't changed between frames. Also  
I can't set the "alwaysBuffer" property since if I do it causes a crash!


I've added the code to the function (see below) and it seems to work  
*sometimes* but it still looks like its losing a frame buffer  
somewhere, the Compare Test hit the breakpoint (see function below)


Is there any work--around for this? Help please!!! Deadline rapidly  
approaching.


All the Best
Dave


local sgOldImageData

 


--
--  PDFGetFrameThumbnail
--
 


function PDFGetFrameThumbnail theFrameNumber,theThumbnailFilePathName
  local myCurrentTime
  local myImageData
  local myFrameRect
  local myWindowID
  local myMovieFilePathName

  --
  --  Set up the Rectangle for the Player Frame
  --
  put the rect of player "PlayerThumbnail" of card 1 of me into  
myFrameRect

  put the windowID of this stack into myWindowID

  --
  --  Calculate the Position in the Movie and Play the Frame
  --
  put the fileName of player "PlayerThumbnail" of card 1 of me into  
myMovieFilePathName
  --set the filename of player "PlayerThumbnail" of card 1 of me to  
empty
  --set the fileName of player "PlayerThumbnail" of card 1 of me to  
myMovieFilePathName


  put theFrameNumber * 24 into myCurrentTime
  set the playSelection of player "PlayerThumbnail" of card 1 of me  
to true
  set the startTime of player "PlayerThumbnail" of card 1 of me to  
myCurrentTime
  set the endTime of player "PlayerThumbnail" of card 1 of me to  
(myCurrentTime + 1)

  start player "PlayerThumbnail" of card 1 of me

  choose pointer tool
  wait .5 seconds with messages

  --
  --  Grab the Frame
  --
  put empty into image "ImageThumbnail" of card 1 of me
  put empty into myImageData
  set the alwaysBuffer of the templateImage to false
  export snapshot from rect myFrameRect of window myWindowID to  
myImageData as JPEG


  choose browse tool

  put myImageData into image "ImageThumbnail" of card 1 of me
  if myImageData = sgOldImageData then
breakpoint
  end if

  put myImageData into sgOldImageData
  return myImageData
end PDFGetFrameThumbnail
-

On 20 Jun 2007, at 11:53, Dave wrote:


Hi,

I have a stack with a player object and am image object. I am  
trying to capture fames from a movie. I want to play the movie for  
the one frame, then copy that one into the Image Object/  The  
following function does this job, however only the first frame is  
captured, e.g. it looks like the put myImageData into image  
"ImageThumbnail"  does not work after the first image has been set.


I've had this before and found that the "always buffer" property  
has to be set correctly for it to work. However, as far as I know,  
the "always buffer" on the Player object should be set to true, but  
when I do this RunRev Crashes. Why is this?


Again, something that should have taken a few minutes to do is  
taking up way too much time. Seems like as soon as a I string a few  
"exotic" objects together and try to do something that should be  
possible, get 95% of the way there and then RunRev crashes in some  
strange manner and I spend at least double the amount of time  
trying to fix it!


How can I get this to work? Why is "always buffer" causing such a  
problem?


Anyway, the function is copied below, it works fine if:

always buffer = true on Player Object
always buffer = false on Image Object

But since I can't set  "always buffer" on the Player (since it  
crashes RunRev) it only copies the first frame into the image object.


Anyone with any ideas I'd be really grateful.

Thanks a lot
All the Best
Dave



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Player/Image Object "always buffer" Problems

2007-06-20 Thread Dave

Hi Scott,

This is weird, it doesn't work here. What happens if you set  
"alwaysBuffer" to true?


I don't understand a couple of things about your snippet:


   set the currentTime of player 1 to (F * the timeScale of player 1)


In my case the timeScale is 600, so frame number * timeScale would  
give values that are way off. I multiple by 24 which is (timeScale /  
FramesPerSecond = 24). In this case FPS is 25 (I'm hardwiring this at  
the moment since I can't find out how to get this info from the player).



   set text of img _display to myVar


is there a difference between this and:

 put myImageData into image "ImageThumbnail"

It would be nice to know what "alwaysBuffer" actually does. It could  
be that there is an old copy of the buffer being used, or RunRev  
doesn't think the image has changed.


Thanks a lot,
All the Best
Dave

On 20 Jun 2007, at 12:41, Scott Rossi wrote:


Recently, Dave wrote:


I've had this before and found that the "always buffer" property has
to be set correctly for it to work. However, as far as I know, the
"always buffer" on the Player object should be set to true, but when
I do this RunRev Crashes. Why is this?


Can't tell you why Rev crashes but, for the most part, setting the
alwaysBuffer of a player will often degrade playback performance  
since Rev

tries to layer the player's content like an object.

I tried a simple test with a MOV file and got what I think are the  
results

you're aiming for.  I used the following script in a button with the
alwaysBuffer of the player set to false and the controller hidden.

on mouseUp
  repeat with F = 1 to 20
   set the currentTime of player 1 to (F * the timeScale of player 1)
   export snapshot from rect (rect of player 1) of player 1 to  
myVar as JPEG

   set text of img _display to myVar
   wait 30 with messages
  end repeat
end mouseUp

On my end (OS X 10.4.9, Rev 2.8.1), the display image updates every  
half
second with each frame captured from the movie.  Appeared to work  
with both

JPEG and PNG export.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Player/Image Object "always buffer" Problems

2007-06-20 Thread Scott Rossi
Recently, Dave wrote:

> I've had this before and found that the "always buffer" property has
> to be set correctly for it to work. However, as far as I know, the
> "always buffer" on the Player object should be set to true, but when
> I do this RunRev Crashes. Why is this?

Can't tell you why Rev crashes but, for the most part, setting the
alwaysBuffer of a player will often degrade playback performance since Rev
tries to layer the player's content like an object.

I tried a simple test with a MOV file and got what I think are the results
you're aiming for.  I used the following script in a button with the
alwaysBuffer of the player set to false and the controller hidden.

on mouseUp
  repeat with F = 1 to 20
   set the currentTime of player 1 to (F * the timeScale of player 1)
   export snapshot from rect (rect of player 1) of player 1 to myVar as JPEG
   set text of img _display to myVar
   wait 30 with messages
  end repeat
end mouseUp

On my end (OS X 10.4.9, Rev 2.8.1), the display image updates every half
second with each frame captured from the movie.  Appeared to work with both
JPEG and PNG export.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution