Playing MPEG Video
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Playing MPEG Video
Hello - I am posting this in the Windows Forum because I want to deliver MPEG video on Windows platform without requiring the end user to install QT. I've scoured the forums and User Guide for a clear cut answer on how to do this, but have come up with only bits and pieces of an answer. Maybe someone knows what to do.
I think that LC will play MPEG files through the native windows media player, both because the User Guide indicates that it will, and because I can do it in the authoring environment under some cirumstances. I can make it work by doing the following.
1. Issue a "dontuseqt" command before doing anything else. I have been doing this from the message box, or from a preopen stack handler, and either one works.
2. Manually create a player from the object menu to a card.
3. Manually determine a path to an external .mpg file in the player's property inspector. The first frame of the mpg file then appears on the card, paused.
4. Issue a start player command, and the video begins to play. Stop player will pause the video again.
Problem solved? No.
When I save the stack and then reopen it, the player is there, the video shows up in the source field of the player's property inspector, but the video itself stubbornly refuses to appear.
What am I doing wrong? The solution seems to be so close, yet so far. Any help will be appreciated.
Gene
I think that LC will play MPEG files through the native windows media player, both because the User Guide indicates that it will, and because I can do it in the authoring environment under some cirumstances. I can make it work by doing the following.
1. Issue a "dontuseqt" command before doing anything else. I have been doing this from the message box, or from a preopen stack handler, and either one works.
2. Manually create a player from the object menu to a card.
3. Manually determine a path to an external .mpg file in the player's property inspector. The first frame of the mpg file then appears on the card, paused.
4. Issue a start player command, and the video begins to play. Stop player will pause the video again.
Problem solved? No.
When I save the stack and then reopen it, the player is there, the video shows up in the source field of the player's property inspector, but the video itself stubbornly refuses to appear.
What am I doing wrong? The solution seems to be so close, yet so far. Any help will be appreciated.
Gene
Re: Playing MPEG Video
Hi Gene,
Does your stack contain, any (and I really mean ANY) scripts at all?
Have you turned off "load QuickTime on startup" in the LiveCode preferences?
What is the exact path to the movie according to the property inspector? Please, copy and paste that path here. Don't modify it.
Have you moved the location of the movie, the stack, or both to a different directory?
You can always try toggling the alwaysBuffer of the player object.
Why do you write "issue a start player command"? Why don't you simply press the play button? Have you tried pressing the play button after re-opening the stack?
Best,
Mark
Does your stack contain, any (and I really mean ANY) scripts at all?
Have you turned off "load QuickTime on startup" in the LiveCode preferences?
What is the exact path to the movie according to the property inspector? Please, copy and paste that path here. Don't modify it.
Have you moved the location of the movie, the stack, or both to a different directory?
You can always try toggling the alwaysBuffer of the player object.
Why do you write "issue a start player command"? Why don't you simply press the play button? Have you tried pressing the play button after re-opening the stack?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Playing MPEG Video
Hi Gene,
just to be sure: we are talking about MPG1 video files?
These should indeed work.
EDIT
Hint: The "movie controller" is a QuickTime ONLY feature!
So you need to supply your own controls for start/stop etc. when NOT using QuickTime.
Best
Klaus
just to be sure: we are talking about MPG1 video files?
These should indeed work.
EDIT
Hint: The "movie controller" is a QuickTime ONLY feature!
So you need to supply your own controls for start/stop etc. when NOT using QuickTime.
Best
Klaus
Re: Playing MPEG Video
Bingo! Problem solved! Much thanks to both Mark and Klaus for replying, because I really wanted to know that LC would play video other than QT.
The key element was suggested by Mark, which is Turn off "Load QT at Start" in the preferences.
Early on I discovered that you had to use a "dontuseqt" command to make the MPEG-1 video work, but it didn't do any good after the stack was saved and reloaded, even though I used "dontuseqt" in the preopen stack handler (the earliest that I could think of to get it established). Again, however, QT has to be prevented from loading in the preferences regardless of the "dontuseqt" script. The odd thing is that I don't have QT on the machine, but what the heck, the technique works.
Mark - you asked about the "start movieplayer" command. As Klaus pointed out, the player object only deals with QT, so the controller doesn't show up. But, I knew that I would have to create my own controls, which is not a bad thing anyway. "Start Player" and "Stop Player" both work nicely. The next step is to explore just what I can do to control the position of the video playback, and to poll the position for possible use in bookmarks. What puzzles me is that I do have a player object present (even without QT), and I can use it's properties to determine the path to the MPEG file, and the size of the video on the screen. So, it seems that the player object is necessary. By the way, it seems that the player object can be introduced just as easily with script as from the tools menu.
So...my intuition is that, if denied the use of QT, then the player object will use the native Windows Media Player machinery for video playback, and probably will digest any codec that the particular flavor of Windows Media Player that is on the playback machine will deal with (including, perhaps, DVD quality MPEG-2). I'm going to tinker with that, and what kinds of trick things can be done to controlling playback from script.
Thanks again guys, I really appreciate the help. I'm just getting started with LC, and have been keeping my fingers crossed that it has a rich enough feature set to replace what I have been using in the past. You helped me keep the faith!
The key element was suggested by Mark, which is Turn off "Load QT at Start" in the preferences.
Early on I discovered that you had to use a "dontuseqt" command to make the MPEG-1 video work, but it didn't do any good after the stack was saved and reloaded, even though I used "dontuseqt" in the preopen stack handler (the earliest that I could think of to get it established). Again, however, QT has to be prevented from loading in the preferences regardless of the "dontuseqt" script. The odd thing is that I don't have QT on the machine, but what the heck, the technique works.
Mark - you asked about the "start movieplayer" command. As Klaus pointed out, the player object only deals with QT, so the controller doesn't show up. But, I knew that I would have to create my own controls, which is not a bad thing anyway. "Start Player" and "Stop Player" both work nicely. The next step is to explore just what I can do to control the position of the video playback, and to poll the position for possible use in bookmarks. What puzzles me is that I do have a player object present (even without QT), and I can use it's properties to determine the path to the MPEG file, and the size of the video on the screen. So, it seems that the player object is necessary. By the way, it seems that the player object can be introduced just as easily with script as from the tools menu.
So...my intuition is that, if denied the use of QT, then the player object will use the native Windows Media Player machinery for video playback, and probably will digest any codec that the particular flavor of Windows Media Player that is on the playback machine will deal with (including, perhaps, DVD quality MPEG-2). I'm going to tinker with that, and what kinds of trick things can be done to controlling playback from script.
Thanks again guys, I really appreciate the help. I'm just getting started with LC, and have been keeping my fingers crossed that it has a rich enough feature set to replace what I have been using in the past. You helped me keep the faith!
Re: Playing MPEG Video
Hi Gene,
glad you got it working!
MPG1 files should be even playable with the "play videoclip XYZ" command.
Maybe that will wok for you? No fiddling around with "dontuseqt" etc.
Best
Klaus
glad you got it working!
MPG1 files should be even playable with the "play videoclip XYZ" command.
Maybe that will wok for you? No fiddling around with "dontuseqt" etc.

Best
Klaus
-
- Posts: 66
- Joined: Fri Feb 05, 2010 7:31 pm
Re: Playing MPEG Video
What would be really great would be if LC could somehow interface with VLC http://www.videolan.org/vlc/ to use that as its video engine.
It is multi-platform and does not come with all the baggage of QT, but not sure how the licencing would work as its GPL.
These pages look interesting, and might give a clue to interfacing it to LC
http://wiki.videolan.org/Documentation:WebPlugin
http://code.google.com/p/vlcj/
http://www.capricasoftware.co.uk/vlcj/index.php
http://wiki.videolan.org/Libvlc
It is multi-platform and does not come with all the baggage of QT, but not sure how the licencing would work as its GPL.
These pages look interesting, and might give a clue to interfacing it to LC
http://wiki.videolan.org/Documentation:WebPlugin
http://code.google.com/p/vlcj/
http://www.capricasoftware.co.uk/vlcj/index.php
http://wiki.videolan.org/Libvlc
Re: Playing MPEG Video
mhoneywill,
You can control VLC from the command line, for example to play movies full-screen. It should also be possible to set up VLC as a server and display the movies in revBrowser, but I never tried that.
Best regards,
Mark
You can control VLC from the command line, for example to play movies full-screen. It should also be possible to set up VLC as a server and display the movies in revBrowser, but I never tried that.
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Playing MPEG Video
Hi Klaus - thanks for the extra feedback. I tried "play videoclip xyz.mpg," and got back "could not create movie reference." BTW, I had imported the video into the stack.Klaus wrote:Hi Gene,
glad you got it working!
MPG1 files should be even playable with the "play videoclip XYZ" command.
Maybe that will wok for you? No fiddling around with "dontuseqt" etc.![]()
Best
Klaus
I tried the command both from the command line, and a mousdown handler on a button a card with no joy. I think I'm happy for the time being using the player object aalong with the preconditions already discussed. There doesn't seem to be much extra work or grief in that. Also, I think I'm more comfortable holding video files external to the executable rather than imported into the stack. It's unsubstantiated at this point, but I have a fear that the extra payload might impair the load time of the standalone program. Anyway, it makes it easier to update the videos if they are outside the main program.
Thanks again - Gene
Re: Playing MPEG Video
Hi Gene,
although your MPG1 files do not seem to work, you do NOT need to IMPORT
video- or audioclips to be able to play them with the "play" command"!
This will also work for external files.
Best
Klaus
although your MPG1 files do not seem to work, you do NOT need to IMPORT
video- or audioclips to be able to play them with the "play" command"!
This will also work for external files.
Best
Klaus
Re: Playing MPEG Video
Hi friends,
maybe this is of interest for you?
http://forums.runrev.com/phpBB2/viewtop ... =4&t=13168
Best
Klaus
maybe this is of interest for you?
http://forums.runrev.com/phpBB2/viewtop ... =4&t=13168
Best
Klaus