16 Replies Latest reply on Aug 29, 2012 6:59 AM by farhanyun91

    video problem

    angui_p
      hi
      i placed quicktime movies on the timeline, each movie on different frame. when i am going to a frame with a movie i see the first frame of the movie for a second then it disappears, then appears again and starts playing.
        • 1. Re: video problem
          Erhard Zrust
          this flickering is a common issue, a good way of avoiding it is to place the movie off stage (e.g. 10000,10000), start it and place it on stage again. So the flickering is not visible.

          Follow this link for an example

          http://www.shocksites.com/forum/topic.asp?TOPIC_ID=510
          • 2. Re: video problem
            angui_p Level 1
            i tried the code but it doesn't work, i changed it because my movie is on the timeline not inserted dynamically.
            where should i put the code on an empty cast or on exitframe?
            what does the word "movie" refers to?
            thank you.

            the code:

            • 3. Re: video problem
              Erhard Zrust Level 1
              the word movie just refers to a timeout name. With timeout.movie.new an new timeout is created that, after one second calls the handler moveFilm. as this has only to be done once, you can forget the timeout afterwards. the name is just means to reference the timeout afterwards.

              Do you have a button at which the movie should start to play? You could work in the code there. or you insert the code into the beginsprite, that should also work.
              • 4. Re: video problem
                angui_p Level 1
                no the movie starts playing when i jump to its frame.
                do i need the line "on film()" because it doesn't work, without it i get an error message, something about a missing object.
                should the code look like this?


                • 5. Re: video problem
                  angui_p Level 1
                  the message is "expected object"
                  plz help....
                  • 6. Re: video problem
                    marcfairbairn
                    this is ridiculous! what a nightmare just to make a simple Quicktime movie play without flickering... is it too much to expect such an expensive peice of software as director to be able to play video files smoothly without all this hacking around?!?
                    • 7. Re: video problem
                      robdillon Most Valuable Participant
                      There are several reasons why your digital video file may not be playing as you expect. Director uses the player that is installed on the user's computer to play back digital video files. So, if you are attempting to play a Quicktime file, then Director will use the QT player that is installed.

                      The first problem that may arise is that the player that is installed is not current, or, that the player does not contain a needed codec. This problem will manifest itself as either poor playback or, no video if the codec is not available. You can easily test to see if the user has the player and what version it is.

                      A second problem is that the digital video file may not play back as smoothly in Director as it does alone. Since Director uses the installed dv player, there is some additional processor overhead when playing back the dv file. Director is running, so is the player. Even if the Director movie appears to be doing nothing, it is still using processor cycles, this will effect the playback of the dv file.

                      A third problem is the playback media. CD drives and hard drives do not read at the same rate. CD drives have only one play head, hard drives have many. The read rate of a CD drive is usually much lower, the cache size is smaller, and the bus speed is slower than on a hard drive. So you have to compensate for these differences when you produce the dv file.

                      Each of these problems are outside the control of Director. They are all also easily resolved.

                      There are a number of solutions to the problem of stuttering dv files when they begin. How you resolve the problem is a matter of design. You may want the dv file to begin to play when the playback head reaches a specific location in the score, or, you may want the dv file to play on demand, using a set of user controls.

                      If you are setting your dv file on the stage in a paused state, then there should be no problem with playback on demand if the dv file was created to play back properly in the Director environment.

                      To get a properly created dv file to play smoothly from its first frame, you need to give the player an opportunity to start up and to begin to stream the dv file. This is easily accomplished. The exact method is dependent on the design of the movie.

                      The direct to stage property of a dv cast member is an extremely important part of successful dv file playback. Not all of the possible dv file formats allow you to control this property. WMV files are always set to be direct to stage, for instance. The direct to stage property is used to tell Director to set aside a specific area of the stage for the guest dv player application. This means that with direct to stage engaged, the space occupied on the stage by the dv sprite will not be controlled by Director. This allows for a simpler stream of data to the video card, as there's only one set of data for each pixel. Direct to stage can also be exploited to hide the dv sprite.

                      Strategy 1. Hide the dv sprite behind the background. I usually reserve the first ten sprite channels in my score for digital video. I then build the background starting at sprite channel 11. I will place a dv sprite in one of the first ten sprite channels and set its member to be not direct to stage. When I want to play the dv sprite, I change the direct to stage property to true and it will immediately show through any sprite(s) that may be in front of it in the scrore. As an example, if I wanted to play a dv file starting on frame 15, I would place the dv sprite in the score starting on frame 12, with the member set to be not direct to stage and paused. I would segment the sprite at frame 15, and the apply a behavior like this to the sprite starting on frame 15:

                      --------------
                      property thisSprite
                      property thisMember
                      property thisDuration

                      on beginSprite me
                      thisSprite = me.spriteNum
                      thisMember = sprite(thisSprite).member.name
                      thisDuration = member(thisMember).duration
                      member(thisMember).directToStage = true
                      sprite(thisSprite).movieRate = 1
                      end

                      on exitFrame me
                      -- if you want the video to disappear when it is finished...
                      if sprite(thisSprite).movieTime >= thisDuration then
                      sprite(thisSprite).movieRate = 0
                      member(thisMember).directToStage = false
                      sprite(thisSprite).movieTime = 1
                      end if
                      end

                      on endSprite me
                      sprite(thisSprite).movieRate = 0
                      member(thisMember).directToStage = false
                      sprite(thisSprite).movieTime = 1
                      end
                      --------------

                      If you are jumping in to the space where the dv file will play, jump to frame 12 and let the playback head play through to frame 15.

                      Strategy 2. Move the sprite off the visible area of the stage. Set your dv member to be direct to stage and not paused. Position the dv sprite on the stage where you want it be located. Use a behavior something like this:

                      -------------
                      property thisSprite
                      property thisMember
                      property thisDuration
                      property myLocV
                      property thisCounter

                      on beginSprite me
                      thisSprite = me.spriteNum
                      thisMember = sprite(thisSprite).member.name
                      thisDuration = member(thisMember).duration
                      myLocV = sprite(thisSprite).locV
                      sprite(thisSprite).locV = -1000
                      thisCounter = 0
                      end

                      on exitFrame me
                      thisCounter = thisCounter + 1
                      if thisCounter = 1 then
                      sprite(thisSprite).locV = myLocV
                      end if
                      -- if you want to remove the dv sprite when it has finished...
                      if sprite(thisSprite).movieTime >= thisDuration then
                      sprite(thisSprite).locV = -1000
                      sprite(thisSprite).movieRate = 0
                      sprite(thisSprite).movieTime = 1
                      end if
                      end

                      on endSprite me
                      sprite(thisSprite).locV = -1000
                      sprite(thisSprite).movieRate = 0
                      sprite(thisSprite).movieTime = 1
                      end
                      ---------------

                      Strategy 3. Change the visible of the dv sprite. This is nearly identical to the strategy above.

                      ---------------
                      property thisSprite
                      property thisMember
                      property thisDuration
                      property thisCounter

                      on beginSprite me
                      thisSprite = me.spriteNum
                      thisMember = sprite(thisSprite).member.name
                      thisDuration = member(thisMember).duration
                      sprite(thisSprite).visible = false
                      thisCounter = 0
                      end

                      on exitFrame me
                      thisCounter = thisCounter + 1
                      if thisCounter = 1 then
                      sprite(thisSprite).visible = true
                      end if
                      -- if you want to remove the dv sprite when it has finished...
                      if sprite(thisSprite).movieTime >= thisDuration then
                      sprite(thisSprite).visible = false
                      sprite(thisSprite).movieRate = 0
                      sprite(thisSprite).movieTime = 1
                      end if
                      end

                      on endSprite me
                      sprite(thisSprite).visible = false
                      sprite(thisSprite).movieRate = 0
                      sprite(thisSprite).movieTime = 1
                      end
                      ---------------

                      All of these strategies are written to work with quicktime video files. Strategies 2 and 3 will also work with WMV files, although you'll have to change the reference to the movieRate and movieTime.

                      None of these strategies will make a poor video work well.
                      • 8. Re: video problem
                        Level 7

                        "Rob Dillon" <rob@ddg-designs.com> wrote in message
                        news:fiekim$au6$1@forums.macromedia.com...
                        > There are several reasons why your digital video file may not be playing
                        > as you
                        > expect. Director uses the player that is installed on the user's computer
                        > to
                        > play back digital video files. So, if you are attempting to play a
                        > Quicktime
                        > file, then Director will use the QT player that is installed.
                        >
                        > The first problem that may arise is that the player that is installed is
                        > not
                        > current, or, that the player does not contain a needed codec. This problem
                        > will
                        > manifest itself as either poor playback or, no video if the codec is not

                        Wow Rob,
                        I would not even have taken the time to write a reply to a post like
                        this....
                        Seems like the OP is does not know what he is doing anyway. :(

                        What exactly IS the problem, marcfairbairn?

                        Richard.




                        • 9. Re: video problem
                          marcfairbairn Level 1
                          Sorry if my post seemed unworthy of a reply richard. and thanks for your detailed reply rob. I'll try to get my head around it. I posted this message out of frustration, didn't expect any answers. I've seen a lot of message board threads that run like this one, someone who is not a lingo master and just has to use director as a part of there job trying to make movies play smoothly in director - always ends in a long string of lingo that has to be implemented to essentially move a video off stage while it loads and then bring it on stage right? just seems like an annoying work around for what should be a pretty standard feature of director..

                          Something so mundane as playing videos frustrates me every time I'm in director. I mean even some crud like powerpoint manages to play videos pretty smoothly..

                          • 10. Re: video problem
                            Level 7

                            "marcfairbairn" <webforumsuser@macromedia.com> wrote in message
                            news:fifdoa$8kh$1@forums.macromedia.com...
                            > Sorry if my post seemed unworthy of a reply richard. and thanks for your
                            > detailed reply rob. I'll try to get my head around it. I posted this
                            > message
                            > out of frustration, didn't expect any answers. I've seen a lot of message
                            > board
                            > threads that run like this one, someone who is not a lingo master and just
                            > has
                            > to use director as a part of there job trying to make movies play smoothly
                            > in
                            > director - always ends in a long string of lingo that has to be
                            > implemented to
                            > essentially move a video off stage while it loads and then bring it on
                            > stage
                            > right? just seems like an annoying work around for what should be a pretty
                            > standard feature of director..
                            >
                            > Something so mundane as playing videos frustrates me every time I'm in
                            > director. I mean even some crud like powerpoint manages to play videos
                            > pretty
                            > smoothly..
                            >
                            >

                            Seriously,
                            if you explain what the problem is, then someone might be able to help.
                            Rob did a great job in listing the most common issues.

                            I never had big problems with video, but then again, I did never do any
                            "heavy" stuff.

                            Some questions to start with:
                            - What file-format is the video (MPG, Quicktime, AVI.... etc etc)
                            - How big is the file on disk?
                            - What are the pixel sizes? 320x240? 640x480? 800x600? 1024x768? 1200x800?
                            2x4?
                            - What codec did you use? Which settings? What compression?
                            - Does the video have audio, and if so how many channels, which compression
                            if any?
                            - Is the video file on HD or on Cd or on DVD?
                            - Did you try preloading stuff that you need at the same time?
                            - What is the size of the stage? How many other sprite do you use and how
                            many are animated or scripted?
                            - What is the target platform? What are the minimum specs? What are the
                            specs of the authoring machine?
                            - Do you run other programs at the same time or do you have services running
                            in the background?
                            - Does the video play well in its native player? Can you make it "jerky" by
                            starting other programs or by moving windows around on screen?

                            Also:
                            - What did you try already?
                            - What were the results?
                            - Did you ask anywhere else and did you get any answers?
                            - Did you try Google?

                            And lastly:
                            - What is your budget...?
                            ;)

                            Richard.



                            • 11. Re: video problem
                              marcfairbairn Level 1
                              ok, ...

                              - What file-format is the video (MPG, Quicktime, AVI.... etc etc)
                              Have tried mov and mp4

                              - How big is the file on disk?
                              Videos range from under 1mb to around 7mb

                              - What are the pixel sizes? 320x240? 640x480? 800x600? 1024x768? 1200x800?
                              2x4?
                              dimensiona are 1024x512

                              - What codec did you use? Which settings? What compression?
                              Have tried Sorenson, mpg and h.264 - all with the same initial flicker

                              - Does the video have audio, and if so how many channels, which compression
                              if any?
                              yes, audio, stereo, Linear PCM (little Endian)

                              - Is the video file on HD or on Cd or on DVD?
                              Ultimatley to run from cd, but same effect occurs even when running from hard disk

                              - Did you try preloading stuff that you need at the same time?
                              Wasn't aware of the ability to preload video in director, will play with this, but wonder if preloading would be a good solution when videos are very long..?

                              - What is the size of the stage? How many other sprite do you use and how
                              many are animated or scripted?
                              stage size is 1024x768 - no other sprites on screen currently

                              - What is the target platform? What are the minimum specs? What are the
                              specs of the authoring machine?
                              target platform mac, pc, authouring on macbookpro

                              - Do you run other programs at the same time or do you have services running
                              in the background?
                              i run other programs when authoring, but test pc is a clean slate - nothing running

                              - Does the video play well in its native player? Can you make it "jerky" by
                              starting other programs or by moving windows around on screen?

                              plays fine in QT

                              Also:
                              - What did you try already?
                              tried searching for answers, all paths seem to lead to a variation on the "have vid of stage on first frame, move onto stage after first frame"

                              - What were the results?
                              have resolved this issue by placeing this script onto every movie, and placing movie off stage:
                              on exitframe me
                              sprite(me.spriteNum).locH = 512
                              end

                              - Did you ask anywhere else and did you get any answers?
                              answers same as my above script in varying degrees of clomplexity

                              - Did you try Google?
                              : )

                              And lastly:
                              - What is your budget...?
                              Not sure why this should is applicable to a software problem? but budget is not an issue.


                              Anyway, like i said above, I have resolved this so that video doesn't flicker by having it load off screen, was just venting frustation that this is necessary.

                              • 12. Re: video problem
                                farhanyun91

                                i've tried the number one codes to solve my digital vid which is as similar problem as this vid problem where my digital vid doesn't play as smooth as it is when i run my project(movie) through a disk.i copy the codes exactly like the one that is provided above.or do i need to change anything??Enlighten me more please.tq

                                • 13. Re: video problem
                                  Sean_Wilson Adobe Community Professional

                                  You asked a related question in this thread and were given some advice and suggestions. Did you take the advice provided? Again: playing video from a CD/DVD presents access speed issues on top of the CPU intensive task of decompression.

                                  • 14. Re: video problem
                                    farhanyun91 Level 1

                                    yes i do.but still the problem persist.i have compressed the video and reduce the data rate, but still.the same thing happen.and when i used the lingo code above, nothing improve.so what else should i do now?i'd be glad if anyone here can elighten me more on the lingo code above.thank you

                                    • 15. Re: video problem
                                      Sean_Wilson Adobe Community Professional

                                      Did you try the idle/sleep trick? Paste the following into a #movie script (requires the UI Helper xtra to be available). See this article for more detail

                                      on idle 
                                        sleep 1 
                                      end 
                                      
                                      • 16. Re: video problem
                                        farhanyun91 Level 1

                                        I've tried and read the article.nothing happend,still.its okay here is the link of a video that i recorded regarding with my problem.http://www.youtube.com/watch?v=vQLffoAo6R0&feature=plcp.i hope you do have time to watch it and have a better look on my problem.thank you very much btw