Video

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

dalkin
Posts: 83
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Video

Post by dalkin » Fri Mar 25, 2011 5:46 am

If I import a .WMV as a control to a sub-stack, I can see it in the assets of the stack, but I'm not quite sure how to call its play with a button referencing the Player object. In the inspector for the Player, it asks for the path of the video which, surely, is the path to the Movie object imported as a control. How do I reference the "Play" button to call the embedded movie (ID 1025).

Code: Select all

on mouseup 
start player 1 
end mouseup
as per the documentation doesn't seem to work. The end result I'm after is to bundle the movie with the application in a standalone under Windows.

As always, any help appreciated
If you're skating on thin ice you might as well dance.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Video

Post by BvG » Fri Mar 25, 2011 10:37 am

importet movies do not run in a player. I think there are additional restrictions of imported videos vs. referenced videos used in players.

to play a videoclip (imported video) you use the play command directly:

play videoClip "my imported video"
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

dalkin
Posts: 83
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Re: Video

Post by dalkin » Fri Mar 25, 2011 11:44 am

Thanks for that. I've attached a snapshot of the setup. If I import a movie, it appears as an asset in the sub-stack, but how is it referenced to play as a standalone? Even if I code the "Start video" button as

on mousedown
play videoClip "Cartooning.wmv"
end mousedown

and then switch to Run mode, I get the spinning beach-ball of death (developing on a Mac under Snow Leopard) and I have to force-quit livecode. And yes, I do have Flip4Mac installed.
Screen shot 2011-03-25 at 9.31.27 PM.png
Screen shot 2011-03-25 at 9.31.27 PM.png (89.26 KiB) Viewed 9802 times
If you're skating on thin ice you might as well dance.

Klaus
Posts: 11205
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Video

Post by Klaus » Fri Mar 25, 2011 12:37 pm

Hi dalkin,

sorry, that will not work!

When using "play videoclip xyz" LiveCode is VERY limited in the supported formats!
If I remember corectly, these are supported formats and bideo codecs:
Format/Codec
1. MOV/Cinepack
2. AVI/?
3. MPG/MPEG 1
THAT's ALL!
These are outdated since a very long time and one should avoided them if possible!

Same limitation applies to "play audioclip xyz":
1. uncompressed AIFF and WAV files
2. (compressed) AU format.

It is more that time that RunRev to give the media plaback engine a complete overhaul!
QuickTime is OK on a Mac, not so OK on WIndows (it is not pre-installed!) and not available
on Linux at all :?

LiveCode uses some veeeeery old system routines to "play videoclip/audioclip" and does NOT
use QuickTime or Video for Windows for that. That's why you cannot "play" the movie.

You will need to use external files within a player object.


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3302
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Video

Post by bn » Fri Mar 25, 2011 12:42 pm

Hi Dalkin,

you actually try to play an imported video which should work with the "play videoClip" command.

But you also show a player. As Björnke pointed out you can not play an imported movie with a player object, only referenced movies.

I attach a little stack with an embedded movie that works for me.

Kind regards

Bernd
Attachments
playVideoClip.livecode.zip
(66.14 KiB) Downloaded 443 times

Klaus
Posts: 11205
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Video

Post by Klaus » Fri Mar 25, 2011 1:19 pm

Hi all,

obviously I have to correct my above mentioned limitations.
Looks like QuickTime DOES the job with "play videoclip xyz",
at least with natively supported formats (which WMV is NOT!)
I have no idea when this has changed!? :shock:

Nevertheless, on should use a player object if possible, because
it will support more playable formats. :)


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3302
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Video

Post by bn » Fri Mar 25, 2011 1:42 pm

Hi Dalkin, Klaus,

just tried to play a .wmv as imported videoclip. It did not work although I have Flip4Mac installed. (just showed a black stripe and some text)

Basically Klaus's restriction apply. On a Mac only a restricted set of codecs and containers is supported.

I usually do as Klaus recommends: use a player object and play a referenced movie.

Kind regards

Bernd

dalkin
Posts: 83
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Re: Video

Post by dalkin » Sat Mar 26, 2011 12:22 am

Thanks for the input folks. Where it stands at the moment is this:

If I import a Quicktime movie as a control (embedded in stack), I can make it play ( thanks for the tips) with

Code: Select all

play videoClip "MyVideo.mov"
but there is no way to set "show controller" or send a "stop playing command" to the embedded Quicktime. It seems that there are no controls once you start playing a video. Closing the card doesn't stop the movie playing in the background (my video is 48 minutes long LOL) so that's not going to work!

So back to the referenced Player object.

If I reference a Quicktime from my Mac HD, the player works just fine with the referenced path, but building the standalone breaks the referenced path. The only way I was able to fix this was to set the referenced path to "Cartooning.mov", which doesn't allow it to be previewed in the authoring process and then to physically move the Quicktime to the same folder as the sub-stack containing the card that has the controls to call the referenced movie. Fine on a Mac, it plays like a dream. But it won't work on Windows (either with Quicktime installed under Windows, or if the referenced file is a WMV).

Can it possibly be true then that LiveCode can't play video in .mov or wmv format on a standalone built for Windows, even when Quicktime for Windows is installed and all .WMV files are set to open in Windows Media Player?
If you're skating on thin ice you might as well dance.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Video

Post by Dixie » Sat Mar 26, 2011 1:33 am

Hi...

It sounds like that you have a path problem....
I am able to play .mov files in a windows standalone.

Code: Select all

on preOpenStack
  set itemDel to "/"
  set the defaultfolder to item 1 to -2 of (the effective fileName of this stack) 
  set the fileName of player 1 to "./nameOfTheMovie.mov"
end preOpenStack
Just using the above works... with this script, when running as a standalone, put the .mov file into the bundle on the Mac, and under windows place it next to the .exe file.

be well

Dixie

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Video

Post by BvG » Sat Mar 26, 2011 1:53 am

Not sorry to be blunt, but you simply don't know what you are doing. Blaming it in LiveCode not working, won't help you with that. Instead, please trust us that these things are perfectly possible, if you learn how to do them. Please read all entries in the documentation for all terms you use. Please look at the tutorials, and other resources available, for example:

http://runrev.com/developers/lessons-an ... nferences/
http://lessons.runrev.com/
http://downloads.runrev.com/userguide/userguide.pdf
http://revonline2.runrev.com/
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Klaus
Posts: 11205
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Video

Post by Klaus » Sat Mar 26, 2011 1:11 pm

Hi dalkin,
dalkin wrote:If I import a Quicktime movie as a control (embedded in stack), I can make it play ( thanks for the tips) with

Code: Select all

play videoClip "MyVideo.mov"
Yes.
dalkin wrote:but there is no way to set "show controller" or send a "stop playing command" to the embedded Quicktime.
There is! A look under "play" in the dictionary might open your eyes! :D
But the control you have is very basic with "play".
dalkin wrote:It seems that there are no controls once you start playing a video.
Yes, the "controller" bar is a QuickTime only feature!
But you can do via sript with some variations of "play".
dalkin wrote:Can it possibly be true then that LiveCode can't play video in .mov or wmv format on a standalone built for Windows,
even when Quicktime for Windows is installed and all .WMV files are set to open in Windows Media Player?
No, it can't!

I don't know if QuickTime can play WMV files on Windows nowadays, but this sound like a path problem, as Bernd already mentioned.
Check his script!

And check these stacks here, invaluable resources:
http://www.runrev.com/developers/lesson ... nferences/

Best

Klaus

dalkin
Posts: 83
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Re: Video

Post by dalkin » Sun Mar 27, 2011 10:46 pm

SOLVED Hi folks. I'm grovellingly grateful for everyone taking the time to help me with this:
Not sorry to be blunt, but you simply don't know what you are doing.
True. In life I'm a cartoonist and I'm very good at my job. I don't natively write code but I'm prepared to spend as much time as I can to develop new skills. Take a look at my latest project at http://www.homesalebureau.com.au if you like. What has attracted me to LiveCode is the willingness of people to help others who, like me, want to push the envelope in their core areas of expertise. I've always been positive that LiveCode is the best platform for this. In the end, the thing that worked was Dixie's contribution:

Code: Select all

on preOpenStack
  set itemDel to "/"
  set the defaultfolder to item 1 to -2 of (the effective fileName of this stack) 
  set the fileName of player 1 to "./nameOfTheMovie.mov"
end preOpenStack
NB: but without the "." before /nameOfTheMovie.mov
I have spent 2 days with the tutorials, guides, lessons and trawling the forums and from my POV nothing else worked. There is no tutorial in the LiveCode documentation that offers a solution for this, there is no user-submitted stack in the Resources centre that offers a solution and the documentation in the user guide is seriously inadequate. So for anyone in a similar position, if you want to play a Quicktime movie on a standalone in the Windows environment, the only solution that seems to work is to put Dixie's script into the Stack script of the Stack containing the card which calls the movie, then in the Player source, set the path to /nameOfTheMovie.mov, build the standalone for Windows, and physically movie the movie asset to the same folder as the .EXE file that launches the app.
If you're skating on thin ice you might as well dance.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3302
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Video

Post by bn » Mon Mar 28, 2011 12:21 am

Hi Dalkin,

I think this would give you also the pathnames of a standalone for Window and Mac

http://lessons.runrev.com/spaces/lesson ... esides-in-

Kind regards

Bernd

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Video

Post by Dixie » Mon Mar 28, 2011 3:11 am

Hi Dalkin.

look at page 349 in the 'User's guide' to read about absolute and relative file paths. The lesson the Bernd pointed you to is also a good explanation about placing files in your standalone depending whether you are using Mac or Windows...

The '.' before the slash denotes that the file path is a relative one. It is the relative path from the defaultFolder.

Like the cartoon... err, don't like estate agents ...:-)

be well

Dixie

dalkin
Posts: 83
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Re: Video

Post by dalkin » Mon Mar 28, 2011 3:31 am

Many thanks. I don't like Estate Agents either, but they pay well ;-)
If you're skating on thin ice you might as well dance.

Post Reply

Return to “Rich Media”