Jump to content


Photo

Ultra Animo - Media Playback Dll (splash/intros)


  • Please log in to reply
40 replies to this topic

#1 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 04 April 2009 - 04:24 PM


UltraAnimo
v1.5.0.0


Description
With this dll, you can (re)play any type of media (as long as the right codec is installed). By playback, I mean you can:
--Play Pause Resume/Stop
--Set or get playback position
--Set or get volume
--Set or get video size and where it is played
--Set or get fullscreen mode
--Get video information (real size, length, quality)

Downloads
Dll, gml and small gm6 demo
--Location on Website (with more details)
--Code Preview (gml code only)
--Direct Download (whole package)
Demo Media Player (pretty cool!)
--Media Player (a media player by snabelost)

Dll size is only 377Kb but the download file is 2Mb (contains demo source[gm6] and demo executable).

Screen shots
...

Quick Example
PRE
// CREATE EVENT
ua_Init();
ua_LoadFile("Intro.mpg",window_handle());
ua_ShowsFullScreen(true);
showing_video=false;
PRE
// STEP EVENT
if (showing_video) { // if still showing video
if (ua_Status()!=global.UAS_PLAYING) { // if not playing anymore
showing_video=false; // not showing
ua_Fini(); // remove control, dll and cleanup.
}
}


Notices
--The video is played asynchronously, meaning, your game keeps running while the video is showing. So you have to keep checking the video's status until it is finished. In the future, I may add a feature to play in synchronous mode (game stops while video runs).
--The mouse cursor is not hidden over the video control (except when fullscreen), I intend to fix this in a later version.
--Messages sent to video control are relayed back to GM (eg GM can detect clicking (and even pressing keys) over the video control). This is not really a bug, in fact it may even be an advantage.
--Misshandling the dll calls my cause some serious errors (not serious as in damaging, but they end up crashing your game). Unfortunately, I can't handle this correctly. So, if for example you try to play a file without loading it first, the dll doesn't babysit your faulty code, you get a game crash (with a load of error messages). Please make sure you code this correctly by not asuming error handling on the dll part.
--To know if a format is supported, run it first through Windows Media Player.
--To know if a format is supported programmatically, use ua_LoadFile() and check for it's resulting value. If it starts with "Error loading file" and the file does exist and is not damaged then it's a codec problem. Of course, this message does not raise any errors in your game, nor does it crash the game.
--Proprietary formats such as MOV files cannot be played by default codecs (thanks to Caniac for finding this out). Since I do not want to force any format restrictions, I'll attempt to fix problems like these by hinting at how they can be tackled (links to codecs, etc).

Codecs
CCCP codec pack, supports a lot of codecs. (recommended pack).
3ivx codec supports MOV files.
Xvid open source codecs for MPEG support.
K-Lite Different K-Lite comparisons.

Credits
It is mandatory (in force) that you give credit to both creators of the dll and player:
-dll and enhancements: Christian Sciberras / Covac Software
-the actual media player control: Lord Dr. Andrei J. Sagura II von Orechov
Also, thanks to Mordi's great menu system, which I borrowed to make the demo program.
Lastly, a person worth mentioning is Sindarin, which gave the idea for this dll, and helped in forming its final shape at various stages.

Have fun with it!

Best regards,
Christian Sciberras

Edited by uuf6429, 10 April 2009 - 11:15 AM.

  • 1

#2 newbie013

newbie013

    GMC Member

  • GMC Member
  • 96 posts
  • Version:GM8

Posted 04 April 2009 - 05:35 PM

So you have provide by your game the codecs of the media files you use with this dll O_O
  • 0

#3 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 04 April 2009 - 07:46 PM

I have yet to check this, but I asume you can play any simple file without requiring special codecs (thus not needing to distribute the codec with your game). You see, any computer (even not fully up to date) have a basic set of codecs installed by default.

Kind regards,
Chris.

Edited by uuf6429, 04 April 2009 - 07:47 PM.

  • 0

#4 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 04 April 2009 - 10:42 PM

So you have provide by your game the codecs of the media files you use with this dll O_O


Yes. Additional 627Kb for the Xvid setup package is not that bad when you have this kind of functionality, or you can get by, by using with the ugly MCI Game Maker video splash functions which have nearly half the functionality of this dll and when the codecs are not available will make your game crash...

What's the return value for ua_IsFullScreen? I keep getting 1 for no matter if I am playing the video in fullscreen or windowed.

Edited by Sindarin, 05 April 2009 - 12:01 AM.

  • 0
GM 8.1 / GM:HTML5 User

#5 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 05 April 2009 - 02:09 PM

What's the return value for ua_IsFullScreen? I keep getting 1 for no matter if I am playing the video in fullscreen or windowed.

Hmm... should be a GM boolean. I'll double check it.

Edit: I've checked it and even if it does seem to be interfaced correctly, it looks like it keeps returning false when no video is loaded and true when a video is loaded. But it does seem to change when changing screen mode.

Any idea of temporaly fixing this is by (insert each line of code before the return statement of each mentioned script):
-add a global variable "global.ua_ScreenMode=false;" inside ua_Init().
-add a the statement "global.ua_ScreenMode=argument0;" inside ua_ShowsFullscreen().
-add the statement "return global.ua_ScreenMode;" inside ua_IsFullscreen().
This is not a very good solution since fullscreen is canceled when a window pops up (default dll behaviour) and because of this code, it still thinks that fullscreen is enabled.
I'll investigate this bug further, you can use this suggestion till a fix is found.

Kind regards,
Chris.

Edited by uuf6429, 05 April 2009 - 05:23 PM.

  • 0

#6 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 05 April 2009 - 05:32 PM

If you don't want to mess with codecs then just use an old version of .wmv.
  • 0

#7 freaked

freaked

    freak up!

  • New Member
  • 890 posts

Posted 06 April 2009 - 09:54 AM

Wouldn't it be better to use use your ActiveX dll to embed VLC and then play the video ?
It doesn't even require the codecs
  • 0

#8 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 06 April 2009 - 11:28 AM

Wouldn't it be better to use use your ActiveX dll to embed VLC and then play the video ?
It doesn't even require the codecs

But it would require VCL media player.
  • 0
GM 8.1 / GM:HTML5 User

#9 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 06 April 2009 - 01:27 PM

Well, it's another option lol. But this is more direct, faster and better since it doesn't use a lot of system information (unlike GMAX).
Also, you will have to make your own scripts to do the basic movie stuff with GMAX (load play pause etc).

Also, for your information, VLC doesn't require codecs since it has it's own (public codecs). So, if you install VLC, you can still use this dll with those codecs. Otherwise, you can distribute small codecs with your game.
  • 0

#10 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 07 April 2009 - 08:15 AM

I dont seem to find the set position script or any fast forward or rewind scrips...
*EDIT
i found the pos script

//ua_SetStreamPos
// Sets stream position
// Argument0 = position
// returns - integer
return external_call(global._ua_SetMediaStreamPos,argument0);

Edited by snabelost, 07 April 2009 - 09:36 AM.

  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#11 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 07 April 2009 - 09:24 AM

Yes, some scripts are yet to be done, but if you check the init script you can find all of the existing features.
set/get position is possible (global._ua_SetMediaStreamPos and global._ua_GetMediaStreamPos)
rewind can be done via calling ua_Stop() and ua_Play() after each other
fast forward, there's not function for this, but I suppose you could skip frames by using StreamPos functions.

Kind regards,
Chris.
  • 0

#12 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 07 April 2009 - 09:53 AM

Ok, i hawe the ua_FastForward and the ua_Rewind scrips to make it a bit easier
FAST FORWARD:
poss=ua_GetStreamPos
poss+=10000000
ua_SetPos(poss)

REWIND:
poss=ua_GetStreamPos
poss-=10000000
ua_SetPos(poss)

*EDIT
I cant get the ua_About to work properly, it only returns 4...

Edited by snabelost, 07 April 2009 - 10:43 AM.

  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#13 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 07 April 2009 - 11:13 AM

That looks ok. I'll check it on mine and include it in the demo.

Hmm ua_About should return a string about the player's creator. Make sure you use ua_Init first.
  • 0

#14 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 07 April 2009 - 11:46 AM

Sry, dont ment to bother you but i cant use the ua_CheckVideo, i just get a system message and a bug alert and a halt or ignore button, maby in using the script wrong... else dose ewerything gwork great
  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#15 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 07 April 2009 - 01:41 PM

I should rename that script, it's a dummy script.
If you rn the demo, you'll find theexample "Cause Fault".
That error message is a new system I'm implementing in my new dlls (not exactly a system message). It handles errors better (and nicer then access violations, etc...).

If you get any other problems/queries, feel free to ask!

Kind regards,
Chris.

Edited by uuf6429, 07 April 2009 - 01:42 PM.

  • 0

#16 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 07 April 2009 - 03:02 PM

K, i just made a little player from ur dll just to se if it works, this is only 30 min of work, dont expect too muche
Download "Mplayer.exe"
  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#17 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 07 April 2009 - 03:56 PM

Wow! Pretty cool! I'll link it in first pos if you don't mind?

Edit: Actually, I find it difficult to believe that that is made with my dll, lol! Very good work!

Edited by uuf6429, 07 April 2009 - 04:02 PM.

  • 0

#18 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 07 April 2009 - 07:38 PM

Wow! Pretty cool! I'll link it in first pos if you don't mind?

Edit: Actually, I find it difficult to believe that that is made with my dll, lol! Very good work!

I made a final update just to show how good this dll can make a media player work!
(its still the same link, just updated it)

ill send a open source when im done cleaning up the mediaplyer

Edited by snabelost, 08 April 2009 - 06:08 AM.

  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#19 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 10 April 2009 - 02:01 AM

There's also the K-Lite Codec pack, I've been using it for a long time: http://www.codecguid...download_kl.htm
  • 0
GM 8.1 / GM:HTML5 User

#20 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 10 April 2009 - 05:19 PM

Ya K-Lite Codec packs are always good it supports almost the codecs.. and I like the video playing asynchronously. Please don't change this or you can keep an alternate to
either play it asynchronously or synchronously.

Another thing; can this loop media?
  • 0

#21 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 10 April 2009 - 06:04 PM

Ya K-Lite Codec packs are always good it supports almost the codecs.. and I like the video playing asynchronously. Please don't change this or you can keep an alternate to
either play it asynchronously or synchronously.

Another thing; can this loop media?

Easely, just check if ua_GetStreamLength = ua_GetStreamPos
and if it is: ua_GetStreampos=0 ua_Play
  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#22 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 11 April 2009 - 06:02 PM

Ya K-Lite Codec packs are always good it supports almost the codecs.. and I like the video playing asynchronously. Please don't change this or you can keep an alternate to
either play it asynchronously or synchronously.

Another thing; can this loop media?

Easely, just check if ua_GetStreamLength = ua_GetStreamPos
and if it is: ua_GetStreampos=0 ua_Play

Thanks .. and happy Easter
  • 0

#23 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 12 April 2009 - 12:46 PM

Now that many people tried (and enjoyed) it, care to name your scores and thoughts about this?

Kind regards,
Chris.
  • 0

#24 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 14 April 2009 - 02:15 PM

8/10
It has almoast all nessesary functions, i would like a pitch, INTERNAL volume settings and some total time get and all the script i added inbuilt, else it rules!
  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#25 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 15 April 2009 - 02:59 PM

Goody! ;)
pitch - Ouch not possible
INTERNAL volume settings - neither :)
total time - Get duration? Isn't it what you're using with position to find percent? I think it's milliseconds.
other scripts - I'm doing some fixes around and then will release a final complete build.

Regards,
Chris.
  • 0

#26 snabelost

snabelost

    GMC Member

  • GMC Member
  • 62 posts

Posted 17 April 2009 - 10:01 AM

Goody! :ph34r:
pitch - Ouch not possible
INTERNAL volume settings - neither ^_^
total time - Get duration? Isn't it what you're using with position to find percent? I think it's milliseconds.
other scripts - I'm doing some fixes around and then will release a final complete build.

Regards,
Chris.

I hawe seen dll s hwo hawe pitch and internal volume settings so its not impossible but you might need to create a new output for the dll only
(if it has its own output you can adjust thaths outputs volume and it will work there too...)
  • 0
Please read and follow the Signature Rules, as a courtesy to other members.

#27 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 17 April 2009 - 10:54 AM

My dll wraps Dr Sagura's, so my dll's features are limited to those in Dr Sagura's.
  • 0

#28 jcoc611

jcoc611

    GMC Member

  • New Member
  • 186 posts

Posted 15 July 2009 - 02:30 AM

This dll plays the videos very slowly
  • 0

Posted Image


#29 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 15 July 2009 - 03:50 PM

More details?
What sort of videos?
What is it's size/rate/fps?
What do you mean by slow, low fps, laggy, slowing overall performance?

Also, I can't see why this could be slow when it doesn't render the videos itself.
  • 0

#30 littleradatz

littleradatz

    GMC Member

  • New Member
  • 9 posts

Posted 17 January 2011 - 06:02 PM

Does anyone have this in their downloads directory or anything like that? The links are broken
  • 0

#31 master123

master123

    GMC Member

  • GMC Member
  • 68 posts
  • Version:GM8

Posted 10 January 2012 - 04:19 AM

Has anyone got the fullscreen problem in gm8 because when you make it go to fullscreen, you cannot get out of fullscreen! Even if you put "esc" button press check it does not work!

help would be appreciated!
  • 0

#32 Razon

Razon

    GMC Member

  • GMC Member
  • 268 posts
  • Version:GM:Studio

Posted 16 January 2012 - 07:55 PM

Here's a mirror download link for it.

http://www.mediafire...n5gyccdhsg5qu8f

Edited by Razon, 31 May 2012 - 11:11 AM.

  • 0

#33 BenBaron

BenBaron

    GMC Member

  • New Member
  • 5 posts

Posted 20 June 2012 - 11:36 AM

Hi guys,

at first thanks for this dll. I am having a problem to find out when a video has ended playing. I am trying to compare if(ua_GetStreamPos == ua_GetStreamLength) and while the functions give correct results and both return the same value at the end of the video it never executes the code within the condition. It also seems the ua_Status is giving weird results, as even in the example (UltraAnimo Demo) it is possible the video is playing but ua_Status returning "paused".

Any advice for me ;-( ?

All the best

Benny
  • 0

#34 Smmh72

Smmh72

    GMC Member

  • New Member
  • 1 posts
  • Version:GM8

Posted 26 November 2013 - 01:17 PM

Hey PLEASE upload it to somewhere else so i can download it, I CANT DOWNLOAD but I NEED IT, tanx.

And the best u can email to me: smmh_72@yahoo.com , tanx a lot! :D


  • 0

#35 Kimidori

Kimidori

    Opened Ultimate Gate

  • GMC Member
  • 552 posts
  • Version:GM8

Posted 26 November 2013 - 02:15 PM

look up 2 post from your.


  • 0

No matter what, cute is justice. If you're watching shows without moe, you should really be questioning your life decisions. The creation of 2D anime girls is the pinnacle of human achievement.


#36 P0TAT0000

P0TAT0000

    GMC Member

  • New Member
  • 2 posts
  • Version:GM:Studio

Posted 30 November 2013 - 03:01 AM

Hey, 

 

First of all, I think this is a pretty good dll. Seems to work well with only one problem. when I try to play the video, it loads choppy, as if it's updating every frame. The video is a .mpeg file if that helps. when I load it in the demo.exe, it loads perfectly without being choppy at all. I'll post a video to better show what's happening. http://www.sendspace.com/file/gd6o0y The beginning shows the code I'm using to start the video, then the compile info at the bottom shows what's happening and the status after wards underneath, then the video begins to play. unfortunately the recorder stopped the video from playing overall for some odd reason, then once that video was finished playing, I went to the demo.exe and played it from there. It played perfectly. I wasn't quite sure what to do to get the video to play as well as it did in your demo.exe from the demo.gm6. Perhaps you could help me out there and tell me what needs to be present in the project in order to play a video nicely. 

 

[UPDATE]

 

11/30/13

Ok, so I figured out what the problem is I think, but I can't seem to solve it. I tried GMMovie as well with no luck, but that dll allows you to place videos in a new window, so I did that and it plays perfectly. I think the problem lies with the the video competing to be shown on the same level. I've unchecked the solid option and visible option on the object that plays the video, but that didn't help at all. I tried placing it in the creation code of the room, but I still need the object to check when it's finished so that didn't work. I tried changing the depth of the object to -1000 and still play the video in the creation code of the room, but that still has not worked. Any suggestions are welcome.


Edited by P0TAT0000, 30 November 2013 - 11:44 PM.

  • 0

#37 TheMagician

TheMagician

    GMC Member

  • GMC Member
  • 632 posts

Posted 04 December 2013 - 09:28 PM

I'm also testing different video player DLLs in GM:S. I found the same problem as you: the videos constantly flicker as if they are switched on and off every step. It has something to do with the focus of the window. If you use show_message() while the video is playing, as soon as the message window opens up the movie plays correctly in the normal game window. I believe something has changed in the internal rendering of the game window which causes the old DLLs to no longer work properly.

Unfortunately my knowledge of DLLs and video playback coding is too limited for me to look into the issue. However, I would be very greatful if one of you tech guys could have a look at it.


  • 0

#38 P0TAT0000

P0TAT0000

    GMC Member

  • New Member
  • 2 posts
  • Version:GM:Studio

Posted 23 December 2013 - 10:30 PM

Ok, so I think I figured out the problem... kind of. I changed the room speed that I called the video in to 0. This made the room update less so it didn't have to render again constantly, however the video played will stop at the end and if you set it up like i did, then you can see the frame it ended on with an object and if it's passed that frame, then it will go to the next room. It's not a perfect fit, but it works for what I need it to do. Hope this helps you too TheMagician.


  • 0

#39 Kimidori

Kimidori

    Opened Ultimate Gate

  • GMC Member
  • 552 posts
  • Version:GM8

Posted 24 December 2013 - 03:55 PM

could you upload the modified example that work with GMS? I tried but the things didn't even load for me.
  • 0

No matter what, cute is justice. If you're watching shows without moe, you should really be questioning your life decisions. The creation of 2D anime girls is the pinnacle of human achievement.


#40 master123

master123

    GMC Member

  • GMC Member
  • 68 posts
  • Version:GM8

Posted 27 December 2013 - 12:55 PM

This also happens if you run it in Ubuntu under wine in gm8.....

And my only way to fix it was to reduce the FPS. If anyone had a general fix that would be awsome!


  • 0

#41 DYFSOFT

DYFSOFT

    GMC Member

  • GMC Member
  • 45 posts
  • Version:GM:Studio

Posted 19 January 2014 - 08:23 PM

Hi guys,

at first thanks for this dll. I am having a problem to find out when a video has ended playing. I am trying to compare if(ua_GetStreamPos == ua_GetStreamLength) and while the functions give correct results and both return the same value at the end of the video it never executes the code within the condition. It also seems the ua_Status is giving weird results, as even in the example (UltraAnimo Demo) it is possible the video is playing but ua_Status returning "paused".

Any advice for me ;-( ?

All the best

Benny

 

This same thing is the problem i have with this dll.

ua_Status is always returning finished while you don't press play. When you press play it's always returning 'playing' even if the video is over...

Furthermore using "if ua_GetStreamLength == ua_GetStreamPos" doesn't work neither

I tried drawing those values like this:

draw_text(32,32,string(ua_GetStreamPos) +"/"+ string(ua_GetStreamLength));

and all i get when i press play it's "14/15" and nothing more no value updates in there

it doesn't start on 0 and goes to 14 but just start on 14 and never goes up to 15...


  • 0