5 Replies Latest reply on Oct 16, 2007 8:59 AM by Applied CD

    Accuracy of  movieTime when used with WMVs?

    Applied CD Level 1
      I’ve got a simple project that I’m pulling my hair out over. I’ve got a client supplied WMV, 17 minutes long, 720 x 405*. The client wants 8 chapter marks that users can click on to navigate within the video, no big deal, right? The video house gave us about 0.5 seconds (15 frames) of transition between chapters that we could use as a target. The problem is, I couldn’t find a number for movieTime that would seek to a frame within this range, either I was catching some video from the chapter before, or I was cutting into the audio for the chapter to come. Changing movieTime in very small increments appears to have no effect, then suddenly the target frame shifts a lot … this sounded to me like a keyframe issue … I thought maybe we can only target keyframes and since Premier’s default keyframe span is 15 frames (the size of our transition) maybe there are no keyframes in the transition where we need them. I had the video house spend three hours increasing the transition time between chapters to 1 second (30 frames) so there should be at least two keyframes in each transition … better, but I still can’t provide an millisecond time that works for all machines. On 6 different machines, half seek exactly to the frame specified; the others are off by as much as a second. Performance doesn’t appear to be an issue, one of our oldest and slowest machines is the most accurate. I can ask the video house to give me a two second transition target, but that’s another 3 hours and frankly, if it doesn’t work after that, I’m gonna have a lot of angry people on the phone.

      * The video house cropped some undesirable material out of the frame making the frame size non-standard.
        • 1. Re: Accuracy of  movieTime when used with WMVs?
          Level 7
          I don't have a good solution for you, but I can commisurate. I have
          never had good luck working with wmv files. I don't know if it is a
          problem with the format, or with Director's handling of the format, but
          I always have wierd problems when I try. I haven't tried in years now.
          Convert them to mpeg and things often work better. Or better yet,

          You can try using a different xtra to control the wmv files. Tabuleiro
          has an excellent "Mpeg Advance Xtra" that I believe will play wmv files.
          It has the ability to set cuepoints inside of Director that should
          provide you with frame-perfect seeking. It is not free, but it is really
          worth the expense. I think they have a free trial that you can use to
          test if it works for you.
          • 2. Re: Accuracy of  movieTime when used with WMVs?
            Applied CD Level 1
            Thanks Mike,

            We’ve actually been using MPEG Advance for years. I initially tried using the xtra and the seek accuracy was bad, I switched to Director’s own internal WMV support and it was no better. I wrote to Mauricio at Tabuleiro and his advice was the same as yours, “stay away from WMV.” He even mentioned that he pulled his own streaming media product out of production because the WMV format was too flaky to be relied upon*.

            This experience leaves me wondering what format is best for high bandwidth applications. MPG 1 works just about everywhere and allows odd-ball frame sizes, but I have a hard time selling customers on the video quality after they’ve seen the original on DVD. MPG 2 looks great (lol, just like the DVD ;-) but is very restrictive on frame size (OK, probably a unique problem for this project) but the files are huge and MPG 2 codecs are wide spread but not universal. MPG 4 looks nice and it’s small, but is it too new? WMV is small, good looking, and well supported on Windows, but as you can see, flakey. We ruled out QT long ago because 99.999999999% of our audience is corporate Windows users and we don’t want to force a download just to use our products (many of them must get permission from IT admins to install anything on their desktops). DV-AVI can look good depending on the underlying compressor but the files are huge. FLV is real cool when streaming from the web but is lacking in quality when compared to what’s achievable on burned media. My vote for this project would be MPG 4 but I’m getting shouted down that it’s too new and chancy for this client.

            *For anyone that is considering WMV: We have not had a problem with WMV in the past using MPG Advance Xtra. The active X control slider bar works poorly but it’s easy to make a custom slider that works well and looks better. We’ve masked the video in MIAW’s, dynamically allowed the video sprite to be stretched to full screen, and performed various other manipulations all without a problem (except DTS which never works anyway). This is the first time we’ve needed accurate time seeking and at least for us, this has been a weakness.

            PS: Just found out from the video house that the keyframe spacing was a whopping 5 seconds (150 frames) so that could be part of our problem. The final decision (not mine) was to cut the video into discrete segments that can be played back to back. Hopefully I’ll get a chance to test my keyframe theory at a later time.

            - Bob
            • 3. Re: Accuracy of  movieTime when used with WMVs?
              Applied CD Level 1
              Well, we reversed direction and decided to re-encode the video with a much lower keyframe interval and that fixed it. Lowering the keyframe interval from 5 seconds to 1 second (the lowest option available in Cleaner) gave us the accuracy we needed to effectively target the middle of a 1 second transition without picking up video or audio from either end. The cost was a 14% increase in file size. So, the take home message: time seek accuracy is effected by the number of keyframes and while some machines can effectively target intermediate frames without displaying video artifacts, most will not.
              • 4. Re: Accuracy of  movieTime when used with WMVs?
                I have a similar situation with a long WMV file to be broken up into "chapters." My solution was to break the segments into individual files but I still need to play the entire video.

                Is there a way to play video files in sequence in Director? I havge tried several ways but nothing has worked so far.
                • 5. Re: Accuracy of  movieTime when used with WMVs?
                  Applied CD Level 1
                  Sure, here’s a very simple method that should work but could easily be improved upon:

                  Place your WMVs into score channel 1, one after another in the proper order. The length of the sprite isn’t all that important; I like to use 3 frames.

                  Paste the following script into your cast, make sure the script type = behavior in the property inspector.

                  Place a copy of this script in the frame script channel at the end of each video sprite.

                  That should do it, some quick notes:

                  I like using a time comparison in the conditional vs. mediaStatus because mediaStatus could have a number of values where you’d still want to loop in the frame, for example, #playing, #pause, #buffering etc…

                  I subtract 200 from the video duration because WMVs are notorious for reporting incorrect durations. One would assume that sprite(1).currentTime = sprite(1).member.duration would be a good test of when to move to the next frame, however, we’ve found in many cases duration will be over reported and currentTime never reaches duration, so you end up in the hold loop forever. 200 is just an arbitrary number (about 6 frames @ 30fps) to protect you from sloppy reporting of the actual duration.