Video in Background Issues

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Xero
Posts: 152
Joined: Sat Jun 23, 2018 2:22 pm

Video in Background Issues

Post by Xero » Sat Jun 23, 2018 2:47 pm

Hi!
First time poster.
I used Macromedia Director way back in the way back. Just getting started in LC and learning capabilities, so please excuse the dumb look on my face when I read replies! :D
OK, I am writing an app for video analysis of runners. It involves:
1 video playback and 2 video playback on screen (working on this, but am confident I can work it out)
- Got play, pause, frame-by-frame fwd and back, and play speeds sorted.
Series of vector graphics drawn over video- namely lines, circles and angle tools (working on it).
Other features that I will need to think about.
My current problem is with the videos. I am using LiveCode Community (trialling to make sure it can do what I need it to).
1. There are some videos (.mov and .mp4) that just won't play- seems that the videos immediately go to the end, and cannot be played, returned to the start, frame-by-framed, etc. AVI's and Mpg's work perfectly well. Would be great to be able to use all supported formats. Not sure why .movs don't work.
2. I am trying to get vector graphics (line) over the videos while playing. I have set buffer to true and when I am coding, it is over it, but when testing, it goes behind. The controller is in the background, but the video isn't. Buffer true or false is exactly the same. Can't get it behind vectors. What am I missing?
Thanks in advance for any help.
XdM

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

Re: Video in Background Issues

Post by Klaus » Sun Jun 24, 2018 2:16 pm

Hi Xero,

1. welcome to the forum!

2. You are probably using "play videoclip..."
This is not a bad idea per se, but this way you are limiting the supported video formats to, you guessed, to (SOME) AVI and MPG files. If LC can play them depends on the compression used in the AVI container. MPG should always play fine, but is of course not very small in filesize due to the quite old MPG1 format.

I advice to use a PLAYER object, which will only work with external files, but will support more formats than just AVI and MPG...

Videos are displayed as some kind of OVERYLAY, means they float above all other LC objects and you cannot put anything on top of them. This can be worked around only with the player object by setting its "alwaysbuffer" to true in the inspector.

Hope that helps!


Best

Klaus

Xero
Posts: 152
Joined: Sat Jun 23, 2018 2:22 pm

Re: Video in Background Issues

Post by Xero » Mon Jun 25, 2018 5:03 am

Hi Klaus,
Thanks for the reply.
Excuse my lack of proper terminology, I am just getting back into the language.
I used the player widget on the toolbar. Drag and drop. I am then using separate buttons with the controller turned off (so later I can make some funky buttons) as per the tutorial about making a video player/ video library. I am gathering that is "using a PLAYER object", right? But I am still limited to AVI/ MPG formats. MOVs just don't work at all, which is surprising seeing it's a QT player object...
I am also getting the issue that when I start from scratch, everything works fine, but when I save and come back to it, the video often doesn't appear, play etc. I need to delete player obj and put new one on, with same video, to get it to work again. Seems glitchy.
As for the buffer, I have set the buffer to true, and have coded in card script to set buffer as true "on opencard" so that it will always set itself as true.
I have attached a screenshot or two to show what's happening.
XdM
LC Buffer on EDIT mode.jpg
LC Buffer on TEST mode.jpg

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

Re: Video in Background Issues

Post by Klaus » Mon Jun 25, 2018 1:17 pm

Hi Xero,

OK, you ARE using a player object! :-)
But this is NOT a QuickTIme player (anymore)!

QT was the only multimedia-engine on Mac and Win that LC had been using until version 7 of LC.
Then they switched to the underlying OS multimedia-engine, which should be WMP on Windows and AVFoundation on the Mac.

But you can still force a player object ot use QT by setting:
...
set the dontUseQT of player "your player name here" to FALSE
...
Default is TRUE for all players on Win and Mac.

Hint:
Once you have set a property in the inspector this will get saved with the stack, so no need to "set the alwaysbuffer of player xyt to TRUE" everytime "on opencard".

That SHOULD work, does on a Mac, but maybe this is a Windows issue?
Looks like you should not relay on this "feature", sorry.

When a video does not play, you should set its filename again, and not delete the whole player object. No idea what might go wrong on oyur side, often this is a pathname prob,lem, but you were talking about the SAME video file, right? That's puzzling...

Best

Klaus

Xero
Posts: 152
Joined: Sat Jun 23, 2018 2:22 pm

Re: Video in Background Issues

Post by Xero » Mon Jun 25, 2018 1:59 pm

Thanks Klaus.
Do not get me started on Windows. I'm ready to throw my Windows 10 computer out of a window!!!
I might give QT a try instead of OS MM engine... See if that works.
As for the video not paying... When I reset the path to the same path, or a different video, it just doesn't work. When I delete and replace player, it works. Hoping that using QT will solve this. Again, Windows 10 needs to be thrown out of a window, so if I don't use their stuff, I may get results.
Sadly, being able to load videos, and use vectors on top of then is the prime reason why I am using Livecode to make an app. If it doesn't work, I might need to try something else.
I know this was an issue with early versions of Macromedia Director, and it was a pain. Was hoping it was solved. I know that apps available for purchase have the ability to draw over video, so it must be able to be done!!!
Will keep hacking away at it.
thanks!
XdM

Xero
Posts: 152
Joined: Sat Jun 23, 2018 2:22 pm

Re: Video in Background Issues

Post by Xero » Mon Jun 25, 2018 2:18 pm

Standalone allows drawing over video.
Just need to sort out video path now, as it doesn't play video.
Glitchy, but works if you trust it...
:lol:
XdM

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

Re: Video in Background Issues

Post by Klaus » Mon Jun 25, 2018 2:44 pm

Hi Xero,

great you got it working!

Use relative pathnames for videos/audios/external images like this:
Put the video(s) into the same folder as your stack that will made into a standalone.
Or create a folder if you have more videos.
Then use a relative path for the filename in the inspector, where relative means relative to the stack/later standalone!
## With extra folder for videos
my_videos/nice_video.mpg
## or if in same folder as stack its just
nice_video.mpg

This will also work in the runtime. If you need to set filename in the runtime, use -> specialfolderpath("resources") to find your videos/media that you have added via the "Copy files" tab in the standalone builder settings:

Code: Select all

...
put specialfolderpath("resources") & "/nice_video.mpg" into tVideoFile
set the filename of player "your player here" to tVideoFile
...
You get the picture :-)


Best

Klaus

Post Reply

Return to “Multimedia”