4 Replies Latest reply on Apr 19, 2006 8:43 AM by gelau

    MPEG-1 playback problems

    gelau
      Hi all,

      I've imported an MPEG-1 file of 70 minutes with the DirectMedia Xtra (on PC) and Quicktime (for MAC), but I have a few playback problems:

      On PC it works quite well, only the slider won't go beyond a certain point in time (about 50 minutes), fom there it always snaps back from where you dragged it.
      The sprite script for PC :


      on exitframe me
      if sprite(me.spritenum).movietime >= member(sprite(me.spritenum).member).duration -1 then
      go to frame 5
      end if
      end

      On the Mac the MPEG plays very jerky, turning of the "sync to audio" helps but then there's no audio off course. The script is the same, except the first lines to control the Quicktime playback :

      on enterframe me
      sprite(me.spritenum).movierate=1
      end

      on exitframe me
      if sprite(me.spritenum).movietime >= member(sprite(me.spritenum).member).duration -1 then
      go to frame 5
      end if
      end

      I've read that the "member.duration" script can cause a few problems, does anyone has an alternative I can try ?

      Thanks in advance,

      Gerrit
        • 1. Re: MPEG-1 playback problems
          Level 7
          Hi Gerrit,

          First, any reason you're not using the MPEG Advanced Xtra insttead of DirectMeda
          Xtra? This Xtra is the followup to DirectMedia and is better in many ways, one
          being that it is cross platform so you can use the same setup for mac and PC.

          I have had jerky playback on the Mac and the issue was was bad formatting of teh
          MPEG file itself. You can read more on this at:
          http://xtras.tabuleiro.com/support/technotes/mpeg_advance/ma009.htm

          Best solution was to use TMPGEnc to reformat the MPEG files. This program can be
          downladed for free at:
          http://www.tmpgenc.net/

          It may fix the timing issue as well.

          regards
          Dean

          Director Lecturer / Consultant
          http://www.fbe.unsw.edu.au/learning/director/
          http://www.multimediacreative.com.au

          • 2. Re: MPEG-1 playback problems
            Level 7
            I have seen reports that calling the "member.duration" too often (about
            15 times a sec. in your case) since it's a fixed value you can store the
            duration in a property ( beginSprite in score scripts get called )


            property vidDuration

            on beginSprite me
            vidDuration = sprite(me.spritenum).member.duration
            end

            on exitframe me
            if sprite(me.spritenum).movietime >= vidDuration -1 then
            go to frame 5
            else
            go to the frame -- otherwise hang around here
            end if
            end
            • 3. Re: MPEG-1 playback problems
              gelau Level 1
              Hi Dean,

              Thanks for the quick reply. It has been a few years since I worked (very basically) with Director, so I'm using the tools that are available here to play around with. I tried the MPEG Advanced Xtra for PC you mentioned, and the slider issue is solved, except that the file puts itself in pause when you timeslide it, but I suppose that's a standard behaviour for MPEG Advanced (is it possible to let it resume instantly ?)

              The MPEG was encoded with TMPEGEnc since it's my favourite and the file plays fine on the Mac when I play it with the Quicktime player, so I thought it was the scripting that caused the problem. But I'l give it a try with MPEG Advanced for Mac too...

              Thanks again and kind regards!
              • 4. Re: MPEG-1 playback problems
                gelau Level 1
                Thanks JB for the reply, but I'm afraid the script is not changing anything. Following your theory about the "member.duration" calling, maybe the "sprite.movietime" calling messes up the playback too? (Just a guess) Since I know exactly the duration of the movie (4245000 millisec), maybe I can write a countdown script when entering the frame that counts together with the movie duration, or is that tricky ?
                When I attach no script at all to the Quicktime/MPEG sprite and I launch the video manually it plays fine. When using this script to autolaunch :

                on enterframe me
                sprite(me.spritenum).movierate=1
                end

                the file plays jerky...

                So, any ideas are always welcome and thanks again for the suggestions ...

                Kind regards