Issues with playing movies
Blitz3D Forums/Blitz3D Beginners Area/Issues with playing movies
| ||
Whenever I try to get my code to play a movie it plays the audio but does not show any of the frames of the movie, does anyone know why or have a fix?Include "cwint.bb" Cls movie = OpenMovie("cut\teaser.wmv") If movie=0 Then RuntimeError "Error - Movie not loaded!" If Not(MoviePlaying(movie)) Then RuntimeError "Error - Movie not playing!" w=MovieWidth(movie) h=MovieHeight(movie) x=(WIDTH-w)/2 y=(HEIGHT-h-100)/2 Repeat DrawMovie movie,x,y,w,h Cls Flip Until KeyHit(1) CloseMovie movie |
| ||
codecs? even if wmp or your movie player of choice has oodles of codecs installed blitz might only like the default wma and mpg codecs and throw a hissy at things like divx and other wma's |
| ||
I am not sure what the codec is, do you see any errors in my code which could be causing my problem? |
| ||
a codec is a separate file that handles audio visual data and is separate from this and other programming languages windows media player can play default wmv/wma and mpg/mp3's but without a codec it cannot do divx movies or 'custom' wmv (sound will play on most) so if your movie has been saved with a custom codec that blitz doesnt understand or have access to then just audio is probably all it can access try re-saving the movie under default conditions |
| ||
My movie was made by Windows Movie Maker if that helps. I've tried it as both a wmv and an mpg. Both times I get the same result, the sound plays, but I see nothing. Every other program on my computer is fine with the movie. The second video file is mpeg-2. I have installed FFDshow, which claims to be a directshow codec for mpg files. It did not solve my problem. |
| ||
Um...... forget Codecs. That's not the problem. You're drawing the screen, then clearing it with CLS before you FLIP buffers. Put the CLS after the FLIP and it'll work. |
| ||
i just offered cocecs as ive way too many (non porn) movie clips that are just sound on my box yet not on others |
| ||
I put cls after flip and the end result was the same. To try to eliminate as many issues as possible I used the example code included in the blitz documentation for Directshow changing only the file it selects as the movie to my movie clip. It did the same thing as my code, played the sound but showed no images. |
| ||
Well, whatever else you did, that needed fixing. As does this line:x=(WIDTH-w)/2 y=(HEIGHT-h-100)/2 First, you've got two declarations in one line, so you must either separate them with a colon, or put them on separate lines. Also, I don't see where you've declared WIDTH and HEIGHT so I assume them both to be zero, which would probably mean your movie is being drawn off screen. Try drawing the movie at a fixed screen position with fixed width and height before you worry about getting the position and scale right. One other thing - to ensure maximum compatibility on other systems you need to encode your video with MPEG1. |
| ||
Thanks, HEIGHT and WIDTH being undefined made a big difference =P THe code works fine now. |
| ||
Another happy customer... Leave the money on the fridge on your way out! |