Author Topic: Plugin: ags_theora Video Player  (Read 11966 times)  Share 

Re: Plugin: ags_theora Video Player
« Reply #40 on: 21 Apr 2010, 22:12 »
Here you go:

[code]

int FMVX; // x co-ordinate of video
int FMVY; // y co-ordinate of video
int VideoCut; // tells AGS when the video needs to be played

function repeatedly_execute_always()
{
     if (VideoCut == 1) { // Play FMV
   if (video) {
      if (!video.ended) {
         video.Draw(DsOverlay, FMVX, FMVY, RtScreenPixels);
         video.NextFrame ();
      }
              else {
                 VideoCut = 0;
         }

     }
}

function item_interact()
{
               SetGameSpeed (24);
      Wait (10);
          VideoCut = 1;
      FMVX = 70;
      FMVY = 130;
      video = Theora.Open("assets/vid.ogv");
      video.loop = false;
                  
      while (VideoCut != 2) Wait (1);
      video = null;
      Wait (10);
      SetGameSpeed (40);
[/code]


All this code is the room, nowhere else.
« Last Edit: 22 Apr 2010, 03:32 by Xenogia »

Willdon

  • I am god!
Re: Plugin: ags_theora Video Player
« Reply #41 on: 21 Apr 2010, 22:44 »
Here you go:

[code]

int FMVX; // x co-ordinate of video
int FMVY; // y co-ordinate of video
int VideoCut; // tells AGS when the video needs to be played

function repeatedly_execute_always()
{
     if (VideoCut == 1) { // Play FMV
   if (video) {
      if (!video.ended) {
         video.Draw(DsOverlay, FMVX, FMVY, RtScreenPixels);
         video.NextFrame ();
      }
              else {
                 VideoCut = 0;
         }

     }
}

function item_interact()
{
     SetGameSpeed (24);
      Wait (10);
          VideoCut = 1;
      FMVX = 70;
      FMVY = 130;
      video = Theora.Open("assets/vid.ogv");
      video.loop = false;
                  
      while (VideoCut != 2) Wait (1);
      video = null;
      Wait (10);
      SetGameSpeed (40);
[/code]


All this code is the room, nowhere else.

:)  You just made my day! Thank you so much! 


How's your game going?

Re: Plugin: ags_theora Video Player
« Reply #42 on: 23 Sep 2010, 20:58 »
I'm currently experimenting with this plugin to draw animated backdrops for chapter two of The Journey Down, and am experiencing two issues, I was hoping someone here might be able to shed some light on these:

* No matter what method I use to crate my .ogv files, the game ALWAYS starts out by rendering the first frame 100% pink. Once it's looping, it's gone. Just the very, very first frame of the first time. Any thoughts on this?

* As Willdon (I think) stated, walk-behinds override the animation, is there any way to work around this problem?

-

Is this plugin perhaps not the way for me to go? Are there any alternatives?

Sorry for digging up this old thread. I realize this may cause some confusion but this was the obvious place to post my questions.

Re: Plugin: ags_theora Video Player
« Reply #43 on: 04 Nov 2010, 02:35 »
Hi there.

Thank you very much for the great plugin.

Could you help me?
I can't make sense of the x,y coords!!
They don't seem to correspond to the room coords, no matter what kind of relativity I choose.

Thanks!

Re: Plugin: ags_theora Video Player
« Reply #44 on: 05 Nov 2010, 03:01 »
no response yet, but another problem suddenly popped up - and maybe they are related in a way?
Theora *vid=open() will always return null if inside the editor. it won't regardless of debug/non-debug mode!
BUT (and it's a big one) - if I compile an EXE, it does load the video.
Anything?
I checked Dx5 and D3D and original DLL and ? and?

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Plugin: ags_theora Video Player
« Reply #45 on: 05 Nov 2010, 19:59 »
My guess is that hitting both F5 and Strg+F5 in the editor will run the exe in the Debug folder. For every command related to files, AGS correctly uses the Compiled path, maybe with the exception of Theora commands?
Try copying the video(s) to the Debug folder.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Re: Plugin: ags_theora Video Player
« Reply #46 on: 05 Nov 2010, 21:53 »

Thanks for the reply Khris,
However it's a "new" behavior.. it was working and then *pop*...
Also, I didn't use the keyboard to run it (just pressed the menu items), so...

Do you have any idea regarding the x,y position problem?

Thanks!

Re: Plugin: ags_theora Video Player
« Reply #47 on: 17 Nov 2010, 00:01 »
Scotch,
Could you please take a look and help me here?

Thanks!!!

Monsieur OUXX

  • Mittens Serf
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Plugin: ags_theora Video Player
« Reply #48 on: 08 Mar 2011, 16:21 »
Sorry for digging out the thread. I was considering PM'ing only scotch, but I thought maybe someone else could help.

Whatever values I enter in "scale", the video always appeared scaled up in the background. I used the source of the demo and copy-pasted it in my own game, I only changed the "scalex" and "scale" values.

I think I have AGS 3.1.2. I just replaced the name of the file with the name of my own video. My video's resolution (900 something by 600 something) is larger than my game's resolution (320x240), that's why I need to scale it down.

By the way, my computer doesn't enable hardware acceleration for some reason (I've got a sublaptop).

Sidenote: I don't understand why the coordinates and scale values used in the "hardware acceleration" instruction of the demo are not the same as the values used in the "no hardware acceleration"? Surely the hardware acceleration doesn't change the size in pixels of the game?
     

Monsieur OUXX

  • Mittens Serf
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Plugin: ags_theora Video Player
« Reply #49 on: 11 Mar 2011, 08:38 »
Bump. Nobody's using this plugin? Scotch doesn't answer either. :'-(
     

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Re: Plugin: ags_theora Video Player
« Reply #50 on: 11 Mar 2011, 10:00 »
I was sure that I replied to this. Well, I am but I never tried scaling. I tried like once or twice,it worked,but I'm not currently using anything will scale. I will however look into this and try to scale. Just for you.

PS: If I manage to scale it, you must find me a bride. m0ds or Calin plx.

Monsieur OUXX

  • Mittens Serf
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Plugin: ags_theora Video Player
« Reply #51 on: 11 Mar 2011, 11:45 »
Just for you.

Oh Dual, what's happening to us?

m0ds or Calin plx.

You just ruined it. Stop playing with my feelings.

More seriously: I suspect it has somethingt o do with the fact I have no hardware acceleration. To be sure that you're in the same situation, use the function to test that in the sample code.

Also, I'm scaling *down* (that is: I use a scaling factor < 1.0). I don't think it should have any impact, since it's all DirectX 3D floating variables with "1.0f"=="100%", but just in case.

     

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Re: Plugin: ags_theora Video Player
« Reply #52 on: 11 Mar 2011, 11:57 »
Awwww, cute.

Now, as I recalled, scaling (up or down), unfortunately works only on Direct3D.
So, yep that pretty much sums it up.

Now.

BRIDE!

Monsieur OUXX

  • Mittens Serf
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Plugin: ags_theora Video Player
« Reply #53 on: 11 Mar 2011, 14:06 »
Now.

BRIDE!

You don't deserve one.

Now, as I recalled, scaling works only on Direct3D.

But that doesn't make any sense, as inside the demo code the DrawEx instruction has scale factors different fom 1.0 even in its non-accelerated version.

First things first: Are we talking about 2 different things when we chat about hardware acceleration? (1/DX5 vs. D3D, 2/if(System.HardwareAcceleration) {...})
     

Re: Plugin: ags_theora Video Player
« Reply #54 on: 23 May 2011, 17:11 »
I have a problem with this module. There is a room which has a video as background (and which we don't see the player character). When the player goes into that room and leaves, the flipped sprites become invisible. At first, I didn't understand why the player character becomes invisible while walking but I realised that only the flipped frames are invisible. Is there a solution to this?

mode7

    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • I can help with web design
    •  
  • mode7 worked on a game that was nominated for an AGS Award!
Re: Plugin: ags_theora Video Player
« Reply #55 on: 23 May 2011, 18:45 »
Switch to Direct Draw.
However, depending on the resolution and use of alpha blended sprites in your game this might not be the perfect solution.

Re: Plugin: ags_theora Video Player
« Reply #56 on: 23 May 2011, 18:49 »
I read that it needs to be D3D mode for scaling, and I use that. Also I use lots of high resolution sprites, some with alpha blending. Thanks for the advice anyway.

mode7

    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • I can help with web design
    •  
  • mode7 worked on a game that was nominated for an AGS Award!
Re: Plugin: ags_theora Video Player
« Reply #57 on: 23 May 2011, 19:48 »
Well you could of course flip the sprites beforehand in Photoshop or something

Re: Plugin: ags_theora Video Player
« Reply #58 on: 23 May 2011, 19:54 »
Well you could of course flip the sprites beforehand in Photoshop or something
Okay, I'll do this if I can't find any other method. It would take a really long time and would be a waste of memory though. Maybe I can just give up and delete that room..

Monsieur OUXX

  • Mittens Serf
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Plugin: ags_theora Video Player
« Reply #59 on: 24 Aug 2011, 16:28 »
HELP!

When I use video.DrawEx (to draw the video's frame on the background) and THEN draw a sprite manually onto the background, the video is still on top.

Is it the expected behavior? How can I draw stuff on top of the video?
This is rather blocking for my game...

[code]
      if(System.HardwareAcceleration) {
        //the game is not designed to take advantage of hardware acceleration
      } else {
        video.DrawEx(DsBackground,   160.0, 150.0,   1.0,  1.0,  0.0, RtScreen);
      }
     
      video.NextFrame();

   
      //overwrite something
      DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
      surface.DrawImage(0, 0,  bg.Graphic,  0,  320,  156);
      surface.Release();
[/code]

As you can see in both cases I target the background : DsBackground, GetDrawingSurfaceForBackground.