7 Replies Latest reply on Jun 15, 2008 11:50 PM by pvansch

    crossfade quicktime video

    whitestar7
      Hi There,

      I have put together alot of quicktime movies in After Effects which I have brought into Director (with DTS on).

      I need to be able to crossfade from one movie to another on a mouse click. I have tried to use BilleniumSoft xtra for this but it didnt work.

      I am guessing I will have to use some lingo to maybe make a screen capture of the current stage and get the first frame of the quicktime video which it will crossfade into, but I have no idea how to do this.

      Really desperate here as on a tight deadline, any help is really appreciated
        • 1. crossfade quicktime video
          Brian Stew Level 2
          This is a copy form a post I made earlier. It does exactly what you suggest (take a snapshot of the current screen, moves to a new location and fades the snapshot out). You do need to turn DTS off when taking the snapshot, or it will just be a black square there. Some will argue that relying on framerate for timing the fade is crude and unpredictable and in principle I agree (but any modern computer can play back even high framerates these days). If you're familiar with timeout objects use that instead.

          ==============


          Here is one way to do it:

          1. On the navigation button for screen "A", attach this:

          on mouseDown me
          member("myvideo").directToStage = FALSE
          myImage = window("stage").image
          member("stageimage").image = myImage
          end

          on mouseUp me
          go to "B"
          end

          2. Create a 'dummy' graphic member called "stageimage". Put a small rectangle in it. Unerneath your screen "B" in the Score (where you want to navigate to), drag it directly into the Score; not on to the Stage. This will keep it centered. The sprite channel should be higher than any other elements in "B"; in my example #10.

          3. Create a Scorescript where screen "B" starts (you don't need additional cells for the fade from "A" at all), and put this in:

          on enterFrame me
          if sprite(10).blend > 1 then
          sprite(10).blend = sprite(10).blend - 2 --the last number determines the speed of the fade
          else
          sprite(10).visible = false
          member("myvideo").directToStage = TRUE
          end if
          end

          --add a 'go to the frame' after this.


          Remember the difference between visible = 0 and blend = 0; the latter will only make the sprite opaque but it will still be functional as a button for instance. It will also cover any button functionality underneath! You don't want that here. A sprite with visibilty turned off (0 or false) will disable it and also let buttons underneath work as expected. So after the sprite with the image from screen "A" has reached opaque, it is turned completely off too.
          If the jump from A to B occurs several times (possibly), you should attach this to the sprite that fades:

          on beginsprite me
          sprite(me.spritenum).visible = 1
          end

          It will ensure that it is always ON and visible before each new fade.

          You can of course reuse this several places, and you don't need new members for each Stage image.



          • 2. Re: crossfade quicktime video
            whitestar7 Level 1
            Thanks for this,

            will give this a go and will reply with result asap
            • 3. Re: crossfade quicktime video
              whitestar7 Level 1
              Hi there,

              one of the problems I have is that if I turn DTS off, the clips dont playback smoothly as I am using fairly large quicktime movies, also I get the wonderful flicker when DTS is on, this is driving me mental!
              • 4. Re: crossfade quicktime video
                Level 7
                whitestar7 wrote:
                > one of the problems I have is that if I turn DTS off, the clips dont
                > playback smoothly as I am using fairly large quicktime movies,

                Just switch it back on after taking a snapshot:-

                on mouseDown me
                sprite("myvideo").directToStage = FALSE
                myImage = window("stage").image
                sprite("myvideo").directToStage = true
                member("stageimage").image = myImage
                end

                > also I get the wonderful flicker when DTS is on, this is driving me
                > mental!

                What sort of flicker (image tearing, missing frames...)? Are they large
                videos in terms of pixels? Have you tried it on a different computer? Does
                the flicker persist outside the authoring environment?

                Andrew


                • 5. crossfade quicktime video
                  Brian Stew Level 2
                  Actually i wrote this in the Scoresript in section "B" (where you go to):

                  on enterFrame me
                  if sprite(10).blend > 1 then
                  sprite(10).blend = sprite(10).blend - 2 --the last number determines the speed of the fade
                  else
                  sprite(10).visible = false
                  member("myvideo").directToStage = TRUE
                  end if
                  end

                  ...but it should be more explicit "myNewVideo" of course. I.e. the 'old' video member has its DTS turned off a split second before the snapshot of the Stage is taken, and then the 'new' video member has its DTS turned on by Lingo when the fade-in is finished; as in the script. Actually the 'new' video member should reside in the Cast with DTS off (it will be turned on in time by Lingo).

                  On my system video with DTS off actually looks pretty good - but with DTS on it looks even better. Does the files look good when playing them through the Qt Player? Is there a lot of other stuff going on beside the video on that Stage?


                  • 6. Re: crossfade quicktime video
                    whitestar7 Level 1
                    hi guys,

                    thanks for your help, the flicker is at the beginning of the quicktime movie, a poster on this forum (Rob Dillon) suggested the following:


                    "The video is flickering at the start because the data rate is too high for Quicktime to stream the file as it starts. There isn't enough data available when Quicktime starts to play the file. The solution is very simple. Set the QT member to be stopped when it loads. Place the QT sprite in the timeline a few frames before you want it to start playing. You can hide the sprite by setting its directToStage property to false and placing another sprite in front of it. I usually place QT sprites behind the background sprite(s). This will allow Director to get the Quicktime player ready to stream the file. When you want to play the QT file, change the directToStage property to true and set the movieRate to 1. It should play smoothly. "

                    This has definately worked in stopping the flicker but now there is a 7 second delay whilst the lingo is switching the DTS to True, there is nothing else on the screen at the time of the QT movie playing. If I disable the DTS switching on and off, it plays through faster but I get the flicker back

                    • 7. Re: crossfade quicktime video
                      pvansch
                      Hey whitestar7, did you get this working?