20 Replies Latest reply on Aug 22, 2007 4:20 AM by Newsgroup_User

    WMV video in Director

    NikkyD_Designs
      Hi, and thanks in advance to anyone who can help me!

      I have a video (which HAS to be WMV) in my director file, and i need to create buttons for play, stop, fast forward, rewind, back to begining and to alter the sound.

      i tried using behavious on the sprites I made but as im using a windows media video they wouldnt work.

      I've managed to get the coding for the play and stop buttons working with..

      on mouseUp me
      sprite("topup").play()
      end

      but im not sure for the rest of the buttons, and especially the sound.

      I am a complete newbie when it comes to lingo and behaviour scripting, so sorry if this is a stupidly easy question!

      Any help would be greatly appreciated! I have the worst client im doing this for and hes really bearing down my neck!! :(


      Many Thanks

      Nikky
        • 1. Re: WMV video in Director
          Applied CD Level 1
          Hi Nikky,

          We use wmv (and mpg for that matter) all the time, but we play them back through MPEG Advance Xtra ( http://xtras.tabuleiro.com/) The following scripts may work even without the xtra, they’re fairly generic (ie: they use standard lingo, no extensions provided by the xtra). Unlike QT video, MPEG Advance Xtra does not support reverse playback (ie, negative movieRate) The following examples assume your video sprite is named "topup", the behaviors would be attached to various button images or text.

          Play:
          on mouseUp me
          sprite("topup").movieRate = 1
          end

          Pause/Stop:
          on mouseUp me
          sprite("topup").movieRate = 0
          end

          Rewind to start (and resume playing):
          on mouseUp me
          sprite("topup").movieTime = 0
          sprite("topup").movieRate = 1
          end

          Fast Forward (2x is max):
          on mouseUp me
          sprite("topup").movieRate = 2
          end

          Slow Motion Forward:
          on mouseUp me
          sprite("topup").movieRate = 0.5
          end

          Adjusting volume (0 = off, 255 = max):
          sprite("topup").volume = 255
          • 2. Re: WMV video in Director
            NikkyD_Designs Level 1
            Thank you so much, that was a great help!
            The only problem now is that the video isnt working correctly!! it plays for about 2 seconds then freezes, the audio continues playing for about another 4 seconds thaen that stops too. The videos play fine out of director, but when I put them into director they wont play!

            Any ideas?

            Thanks

            Nikky
            • 3. Re: WMV video in Director
              NikkyD_Designs Level 1
              just had another idea...

              I was wondering is it possible to put some coding in to get director to open a video file in another program, i.e. when click on a button windows media player opens out side director, and a video plays.

              could this work??
              • 4. Re: WMV video in Director
                Level 7
                There are xtras out there that can do it easily. Like BuddyAPI
                (www.mods.com.au/budapi). It is free to use up to 2 functions in a
                project... You would use the baOpenFile command:

                baOpenFile(the moviePath&"Moviename.wmv","normal")

                That would open the Moviename.wmv file in whatever program the user has
                associated with wmv (generally Media Player)
                • 5. Re: WMV video in Director
                  NikkyD_Designs Level 1
                  Ahh thanks for the reply, where would i put that line of code?
                  I've installed buddy API,
                  do i attach it as a behavior?
                  do i need the on mouseUp command aswell? like...

                  on mouseUp me
                  baOpenFile(the moviePath&"TopUpCover.wmv","normal")
                  end

                  thank you

                  • 6. Re: WMV video in Director
                    Level 7
                    All you need to do is right click on the sprite that you want to use to
                    open your movie and click on script. Paste this into the script window:

                    --start
                    on mouseUp me
                    baOpenFile(the moviePath&"TopUpCover.wmv","normal")
                    end
                    --end

                    Close the script window and play your program. It should work, assuming
                    the movie is named "TopUpCover.wmv" and it is in the same path as the
                    Director file you are developing.
                    • 7. Re: WMV video in Director
                      NikkyD_Designs Level 1
                      Thanks a million!! I finally figured out what I did wrong... bit of a rookie mistake, but i have never used xtras before.... I didnt put the xtra file in the same folder as the projector! Rookie mistake i gather.... :(

                      I swear this project is going to be the end of me. I finally get the CD working, and send it off... it wont run on his computer(s) the menu works, but when he clicks on the buttons that should open windows media player... nothing happens!!! It works fine on all my computers so why not his??? I have added al the files needed on the CD. I really really dont understand why its not working!

                      If anyone has any ideas please help... my client isn't the easiest of people to work with, and is making things very difficult for me right now!!!

                      Thanks in advance (again)

                      Nikky
                      • 8. Re: WMV video in Director
                        Level 7
                        Make a 'test' version of your program. Change the line that opens media
                        player to this:

                        alert string(baOpenFile(the moviePath&"TopUpCover.wmv","normal") )

                        Now, when the program tries to open that file, it will throw an alert
                        with an error code. Look in the BuddyAPI documentation to find out what
                        the error code means. That will likely tell you what is going wrong.
                        • 9. Re: WMV video in Director
                          NikkyD_Designs Level 1
                          Ok the error code I got was 42, i assume it was an error code, it just jumped up with no other information. I'm looking through the documentation I got with Buddy API and im not finding any thing with errors yet... still looking

                          Thank you again Mike for coming to the rescue!

                          Nikky
                          • 10. Re: WMV video in Director
                            Level 7
                            Any error code greater than 31 means that the command ran successfully.
                            Did you get the 42 message on your computer (the one that works
                            correctly) or on the other one that actually has the problem?

                            If you are getting Buddy telling you that it worked, but the Media
                            Player window did not open, then something screwy is going on. What
                            happens if you doubleclick on the actual file in Windows Explorer? Does
                            it correctly open the movie? Make sure you are doing this on the
                            machine that is experiencing the problem.
                            • 11. Re: WMV video in Director
                              NikkyD_Designs Level 1
                              I cant test this on the computer that has the problem, its a client thats 150 miles away. The problem however becomes worse as this CD is going to be duplicated and sent out to other people as a promotional thing. If it works here, but doesn't work there, how will i know if it will work in other machines that insert it?

                              The weird thing is, i have tested it on every machine in this office, some of them are about to fall apart there so old, and yet they work. The clients i have sent the cd to said they have tried it on 2 machines and it isnt working.

                              This is exactly what my project is.... a menu with a little animation, 4 text buttons come in, you click on each one, and up pops windows media player with a video. Its that simple.

                              Is there any chance it could be the video files? I was supplied them in a huge AVI file, I had to reduce them down in size so they would fit on a CD, so i used a converter and made them the suitable size and wmv files.. All these video files work perfectly on my machines, so i didnt think there was a problem.

                              Thanks

                              Nikky
                              • 12. Re: WMV video in Director
                                Level 7
                                The only way to troubleshoot the problem is to test it on the machine
                                that has the problem, unless you can replicate the problem on a local
                                machine. However you got the CD to the other computer 150 miles away,
                                do the same thing with your test program. Or email them the changed exe
                                file. Or post it on an FTP site where they can download it. Or ask
                                them to double-click the movie file and tell you what happens. My guess
                                is that there is some problem on their computer, but it is simply a
                                guess since I have no way of testing it.
                                • 13. Re: WMV video in Director
                                  NikkyD_Designs Level 1
                                  Right I think were going to have to visit the company and get this sorted. They need it pretty sharpish, at least then I'll be able to know if there is definitely something wrong and its not just them not being able to turn on a computer hehe.

                                  I just rang them, and asked them to test the video files on there own by exploring the disk, they said they are quite jerky and the sound is all broken up. IF it is the compression of the files that is somehow wrong, would re-compressing them help? I could always convert them again from th big avi file to a smaller .avi, rather that the .wmv file. Or is all this a waste of time?

                                  • 14. Re: WMV video in Director
                                    Level 7
                                    The movie quality is probably poor if they are running the movies off of
                                    CD vs off a hard drive. CD access time is much slower than hard drives,
                                    so it is common for movies to run poorly. To fix that, you will need to
                                    compress them at a lower data rate, or using a different codec. Make
                                    sure that when you test the movies on your own computer that you do so
                                    off a CD. It is pretty normal for a developer to think that things are
                                    working because it works fine on his/her computer, then the client gets
                                    the CD and it is terrible. You need to test it in the final format to
                                    be sure.

                                    None of this has anything to do with the original problem, though. If
                                    they could get the movies to play just by doubleclicking them in
                                    Explorer, then there is nothing wrong with the file association. The
                                    best thing to do is to get them a copy of that test projector that tells
                                    you the error code. Have them run it and tell you what error code came
                                    up. Then you can see what exactly is going wrong.
                                    • 15. Re: WMV video in Director
                                      NikkyD_Designs Level 1
                                      Right ok, I'm going to Bristol now to visit the client on Thursday to hopefully get everything sorted out. Ill run the test on their computers and check everything's working. I'm also going to change the video compression to lower. The client was so adamant that he wanted the highest possible size and quality, he doesnt understand "thats not actually possible on cd" all he hears is "I'm too lazy to do it! and wont help him!" I'll just have to force him to understand lol.

                                      Thank you soo soo much for all your help, I dont know what I would of done without all your advice.

                                      Nikky
                                      • 16. Re: WMV video in Director
                                        Level 7
                                        For the quality thing, I have dealt with similar clients before. Have a
                                        demo handy for them. Show the same movie at a few sizes/compression
                                        ratios. Show how it looks off CD and off hard drive. Let them choose
                                        which they want.

                                        Sometimes it works best to copy the files to the hard drive and play
                                        them off the hard drive. You can do that with BuddyAPI's baCopyFile()
                                        command. Depending on how big they are, it can be a time consuming
                                        process, but the quality can be much better. Also, if it is possible to
                                        run them off a DVD, they typically have a higher data rate than CD-ROMs,
                                        though not all computers are guaranteed to have a DVD reader.
                                        • 17. Re: WMV video in Director
                                          NikkyD_Designs Level 1
                                          Yeah i did it on DVD first, but he said he doesn't think anyones got DVD players in their computers (i don't think he knows we reached the 21st century....) theres no reasoning with this client everything's black and white... you should of heard the arguments when i tried to tell him customers wouldn't want to wait for a 2gig file to stream from the internet as he wanted the quality so high and the file to fill the screen...

                                          • 18. Re: WMV video in Director
                                            Level 7
                                            I feel your pain. I have been there. In my case (this was in the early
                                            90s when CD reading speeds were quite a bit slower than now), I had a
                                            client that wanted fullscreen (1024x768 in the days when most people had
                                            800x600) playback with no compression. The movie was 15 minutes long.
                                            It wouldn't fit on CD, and even after I got him past the no compression
                                            thing and got it to fit on CD, he was still adamant about the fullscreen
                                            full quality. I ended up writing a quick and dirty installer that would
                                            copy the movie to the users temp folder while he was working through the
                                            menu system. I also made it at 1/2 the size he wanted and doubled it
                                            during playback. It worked out pretty well, but it was a huge hassle!
                                            You may be able to get away with something I did not have access to back
                                            then.

                                            The newer versions of Flash have a flv conversion tool that you can
                                            convert your movie to flv format. You can get really good quality at a
                                            very small file size this way. You need to make a player application in
                                            Flash and save that as swf. Then bring the swf into Director. It is a
                                            bit of work, but it will stream the video off the cd drive and play
                                            inside the Director window instead of opening the external Media Player.
                                            • 19. Re: WMV video in Director
                                              NikkyD_Designs Level 1
                                              Ahh clients eh, what are we gonna do with them? If only they didn't pay our wages...
                                              Its ok for you, your a programmer (I'm guessing), you have a problem and you write a program to fix it, I'm a graphic designer, my job is to make things look pretty!

                                              Whats the best conversion then for CD's for future reference. They were converted to 1220kbps before which I think might of been a bit high. Would 600kbps be better?

                                              • 20. Re: WMV video in Director
                                                Level 7
                                                A lot of it depends on the codec you use, and I have no experience with
                                                wmv files (I have never seen fit to remove non-Windows users from
                                                viewing movies)... but when I was doing a lot of this stuff, I was using
                                                Quicktime with the Sorenson 3 codec. And I could get reasonable quality
                                                on 8x drives with 600 kb/s. Slower drives would stutter. Today, it
                                                would be pretty rare, I think to find a drive lower than 8x, unless the
                                                user is running a machine from circa Win98.

                                                Also consider lowering the frame rate to 15 f/s (if you have not
                                                already). That is usually enough that no one really notices a quality
                                                loss, but the computer will be twice as efficient at displaying the
                                                frames- thus less stuttering.

                                                You can usually get away with compressing the audio much further than
                                                you think... unless the music is a very important part of the
                                                presentation... like a music video. If it is just a person talking,
                                                then you can usually drop the audio quality a whole lot an no one will
                                                be the wiser. That saves you disk space, and allows the video to have
                                                more bandwidth from the CD access.