Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (468)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 3 4 [5] 6
  ignore  |  Print  
  YUNPM - a Java Media Player  (Read 26083 times)
0 Members and 1 Guest are viewing this topic.
Offline Roquen
« Reply #120 - Posted 2012-08-21 15:56:59 »

I don't know about most people, but when I reach a video in a game (about 95% of the time) I'm hitting the escape key like a skinner rat try to get crack.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #121 - Posted 2012-08-21 15:59:14 »

I don't know about most people, but when I reach a video in a game (about 95% of the time) I'm hitting the escape key like a skinner rat try to get crack.
That doesn't mean we, as developers, shouldn't try Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Cero
« Reply #122 - Posted 2012-08-21 16:00:33 »

I don't know about most people, but when I reach a video in a game (about 95% of the time) I'm hitting the escape key like a skinner rat try to get crack.
I guess you dont play Metal Gear Solid or Final Fantasy games.
There are only few games which have a great elaborate story but no cut-scenes. BioShock was cool, but its more atmosphere and scenery than story and plot.

Sorry for offtopic, just always hits me, since I enjoyed 999 hours of video and 5 of gameplay in MGS4...

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline delt0r

JGO Coder


Medals: 22


Computers can do that?


« Reply #123 - Posted 2012-08-21 16:07:48 »

OT

I here this from some players... But the bulk of players really like cut scenes. People still go on about them in StarCraft 1. I felt ripped off in WC3 when they just zoom in to low poly characters in engine. Its no less "suspension of disbelief  destroying" than a cut scene but somehow cheaper. One thing i don't want to do.. read large blocks of text.

Either way they should always be skippable.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Cero
« Reply #124 - Posted 2012-08-21 16:28:34 »

I here this from some players... But the bulk of players really like cut scenes. People still go on about them in StarCraft 1. I felt ripped off in WC3 when they just zoom in to low poly characters in engine. Its no less "suspension of disbelief  destroying" than a cut scene but somehow cheaper. On thing i don't want to do.. read large blocks of text.
They are pretty bad-ass. Overall SC's story is as good as the gameplay.

Either way they should always be skippable.
Of course.

Offline Roquen
« Reply #125 - Posted 2012-08-21 16:37:10 »

@Riven: agreed.  I even considered writing a pure java codec, but then the patent minefield appears in my head and I slink away.

@Others: I'm not a typical player, but my real point is that if you're considering video playback for cutscenes can you create cutscenes worth all of the effort?
Offline nsigma
« Reply #126 - Posted 2012-08-21 16:45:00 »

Shipping H264 has nothing to do with GPL or LGPL... its a patent issue.

It does specifically with FFMPEG - x264 is one of the key GPL components.  I haven't yet found a definitive list so don't know what else that would be useful is not in the LGPL version.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Cero
« Reply #127 - Posted 2012-08-21 16:45:29 »

@Others: I'm not a typical player, but my real point is that if you're considering video playback for cutscenes can you create cutscenes worth all of the effort?

Its a required skill for at least one in the team to have it, like level design, dialogue writing, making music and sound and so on.
No problem @ video editing and our 3D maya/3ds max skills only get better.
Our first game to have cutscenes will feature visual novel style cutscenes like Infamous with effects and all that. Much more than we could do only with only code, without a major headache...

Offline R.D.

Senior Member


Medals: 2
Projects: 1


"For the last time, Hats ARE Awesome"


« Reply #128 - Posted 2012-08-21 17:35:24 »

Cutscenes in real time are always better. I hate these prerendered excuses for making an event system work. I never liked this about Final Fantasy. I was so amazed when I played Devil May Cry and they had these awesome cutscenes (was my fist PS2 game back then Cheesy) and then FF 10... stupid videos  Cranky
Look at Uncharted how awesome in can be to actually PLAY a cutscene...

I don't have something against such things as Comic Cutscenes as long as they don't pop up every time a cutscene is triggered. It just feels lame when I play this awesome game and then a cutscenes comes and you always see the difference in quality.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #129 - Posted 2012-08-21 17:37:17 »

I think it was awesome in Red Alert 2: a RTS game, with cutscenes after each level with real actors.

<a href="http://www.youtube.com/v/ztM6TGVNKJw?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/ztM6TGVNKJw?version=3&amp;hl=en_US&amp;start=</a>

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel


Medals: 200



« Reply #130 - Posted 2012-08-21 17:56:19 »

Theora is good enough for Blizzard to use it for cutscenes in Starcraft 2 and Diablo 3.
Offline Spasi
« Reply #131 - Posted 2012-08-21 18:05:03 »

It isn't only about cutscenes. You can play video on any surface in a 3D scene with this library.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #132 - Posted 2012-08-21 18:14:19 »

I think it was awesome in Red Alert 2: a RTS game, with cutscenes after each level with real actors.
It isn't only about cutscenes. You can play video on any surface in a 3D scene with this library.
Yup the C&C and Redalert games also had mission update FMV in-game. Some games have even used FMV's as backgrounds during gameplay.
Offline Ultroman

JGO Knight


Medals: 24
Projects: 1


Snappin' at snizzes since '83


« Reply #133 - Posted 2012-08-21 18:17:22 »

Up and coming:
  • Pause, resume, stop
  • Altering volume
  • Reducing overhead by switching from (M)JPEG to (M)YUV (credits: delt0r)
  • Making it easier to integrate inside a game

+

I didn't quite start this project because I need it myself, I just (think I) saw a need, and I came up with this simple solution

=

<3<3<3<3<3<3

- Jonas
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #134 - Posted 2012-08-21 18:35:57 »

YUNPM v0.8.1 is on it's way, with a procedural API, allowing for trivial embedding in a 3D scene.




Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Ultroman

JGO Knight


Medals: 24
Projects: 1


Snappin' at snizzes since '83


« Reply #135 - Posted 2012-08-21 18:48:05 »

You are bloody awesome!

- Jonas
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #136 - Posted 2012-08-21 19:11:29 »

Version 0.8.1 - 0.8.3 of YUNPM



Changes
  • Refactored callback API into procedural API
  • Simplified API, making it trivial to embed in a 3D scene
  • Added a simple sample sumple 3D scene as a proof of concept
  • Removed VideoMetadata from public API (v0.8.2).
  • Fixed bug determining 32-bit / 64-bit JVM (v0.8.3).


Download files


Code, code. (code)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
229  
230  
231  
232  
233  
234  
235  
236  
237  
238  
239  
240  
241  
242  
243  
244  
245  
246  
247  
248  
249  
250  
251  
252  
253  
254  
255  
256  
257  
258  
259  
260  
261  
262  
263  
264  
265  
266  
267  
268  
269  
270  
271  
272  
273  
274  
275  
276  
277  
278  
279  
280  
281  
282  
283  
284  
285  
286  
287  
288  
289  
290  
291  
292  
293  
294  
295  
296  
297  
298  
299  
300  
/*
 * Copyright (c) 2012, Riven
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright notice,
 *       this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Riven nor the names of its contributors may
 *       be used to endorse or promote products derived from this software
 *       without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */


package net.indiespot.media.test;

import static org.lwjgl.opengl.GL11.*;

import java.io.File;
import java.nio.ByteBuffer;

import net.indiespot.media.Movie;
import net.indiespot.media.impl.OpenALAudioRenderer;

import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;
import org.lwjgl.openal.AL;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.PixelFormat;
import org.lwjgl.util.glu.GLU;

import craterstudio.math.EasyMath;
import craterstudio.text.TextValues;

public class TestGameLoop {
   public static void main(String path) throws Exception {

      File movieFile = new File(path);
     Movie movie = Movie.open(movieFile);

      OpenALAudioRenderer audioRenderer = new OpenALAudioRenderer();
      audioRenderer.init(movie.audioStream(), movie.framerate());

      //

      Display.setDisplayMode(new DisplayMode(800, 600));
      Display.setResizable(true);
      Display.setTitle("TestGame");
      Display.setVSyncEnabled(false);

      // create display
     {
         for (int samples = 8; samples >= 0; samples--) {
            try {
               Display.create(new PixelFormat(/* bpp */32, /* alpha */8, /* depth */24,/* stencil */8,/* samples */4));
               break;
            } catch (LWJGLException exc) {
               System.out.println("Failed to create Display with " + samples + " samples");
            }
         }
      }

      // setup projection matrix
     {
         displayWidth = Display.getWidth();
         displayHeight = Display.getHeight();
         {
            glMatrixMode(GL_PROJECTION);
            glLoadIdentity();
            GLU.gluPerspective(60.0f, displayWidth / (float) displayHeight, 0.01f, 100.0f);

            glMatrixMode(GL_MODELVIEW);
            glLoadIdentity();

            glViewport(0, 0, displayWidth, displayHeight);
         }
      }

      // create texture holding video frame
     {
         textureHandle = glGenTextures();
         glBindTexture(GL_TEXTURE_2D, textureHandle);

         glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
         glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
         glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
         glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

         int wPot = EasyMath.fitInPowerOfTwo(movie.width());
         int hPot = EasyMath.fitInPowerOfTwo(movie.height());
         texWidthUsedRatio = (float) movie.width() / wPot;
         texHeightUsedRatio = (float) movie.height() / hPot;

         // 'tmpbuf' should be null, but some drivers are too buggy
        ByteBuffer tmpbuf = BufferUtils.createByteBuffer(wPot * hPot * 3);
         glTexImage2D(GL_TEXTURE_2D, 0/* level */, GL_RGB, wPot, hPot, 0/* border */, GL_RGB, GL_UNSIGNED_BYTE, tmpbuf);
         tmpbuf = null;
      }

      // game loop

      long textureReceiveTook = 0;
      long textureUpdateTook = 0;
      long textureRenderTook = 0;

      long started = System.nanoTime();
      long startedLastSecond = System.nanoTime();
      int videoFramesLastSecond = 0;
      int renderFramesLastSecond = 0;

      while (!Display.isCloseRequested()) {

         // handle input
        {
            while (Keyboard.next()) {
               if (Keyboard.getEventKeyState()) { // on key press
                 if (Keyboard.getEventKey() == Keyboard.KEY_SPACE) {
                     if (audioRenderer.getState() == AudioRenderer.State.PLAYING) {
                        audioRenderer.pause();
                     } else if (audioRenderer.getState() == AudioRenderer.State.PAUSED) {
                        audioRenderer.resume();
                     }
                  }
               } else if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
                  audioRenderer.stop();
               }
            }

            while (Mouse.next()) {
               if (Mouse.getDWheel() != 0) { // on scrollwheel rotate
                 float volume = audioRenderer.getVolume();
                  volume += (Mouse.getDWheel() > 0) ? +0.1f : -0.1f;
                  volume = EasyMath.clamp(volume, 0.0f, 1.0f);
                  audioRenderer.setVolume(volume);
               }

               if (Mouse.getEventButtonState()) { // on mouse-button press
                 if (audioRenderer.getState() == AudioRenderer.State.PLAYING) {
                     audioRenderer.pause();
                  } else if (audioRenderer.getState() == AudioRenderer.State.PAUSED) {
                     audioRenderer.resume();
                  }
               }
            }
         }

        audioRenderer.tick(movie);

         glClearColor(0, 0, 0, 1);
         glClear(GL_COLOR_BUFFER_BIT);

         // position camera, make it sway
        {
            glMatrixMode(GL_MODELVIEW);
            {
               glLoadIdentity();

               long elapsed = (System.nanoTime() - started) / 1_000_000L;
               float angle = 90 + (float) Math.sin(elapsed * 0.001) * 15;

               // inverse camera transformations
              glRotatef(-angle, 0, 1, 0);
               glRotatef(-15f, 0, 0, 1);
               glTranslatef(-3, -1.7f, -0);
            }
         }

         glEnable(GL_TEXTURE_2D);
         glBindTexture(GL_TEXTURE_2D, textureHandle);

        if (movie.isTimeForNextFrame()) {
            // grab the next frame from the video stream
           textureReceiveTook = System.nanoTime();
           textureBuffer = movie.videoStream().readFrameInto(textureBuffer);
            textureReceiveTook = System.nanoTime() - textureReceiveTook;

            if (textureBuffer == null) {
               break;
            }

            textureUpdateTook = System.nanoTime();
            glTexSubImage2D(GL_TEXTURE_2D, 0/* level */, 0, 0, movie.width(), movie.height(), GL_RGB, GL_UNSIGNED_BYTE, textureBuffer);
            textureUpdateTook = System.nanoTime() - textureUpdateTook;

            // signal the AV-sync that we processed a frame
           movie.onUpdatedVideoFrame();

            videoFramesLastSecond++;
         }

         // render scene
        textureRenderTook = System.nanoTime();
         {
            glEnable(GL_BLEND);
            glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

            float h = (float) movie.height() / movie.width() * 2;

            glPushMatrix();

            glBegin(GL_QUADS);
            {
               glColor4f(1, 1, 1, 1);

               // render movie screen

               glTexCoord2f(0 * texWidthUsedRatio, 1 * texHeightUsedRatio);
               glVertex3f(0, 0.1f + h * 0, +1);

               glTexCoord2f(1 * texWidthUsedRatio, 1 * texHeightUsedRatio);
               glVertex3f(0, 0.1f + h * 0, -1);

               glTexCoord2f(1 * texWidthUsedRatio, 0 * texHeightUsedRatio);
               glVertex3f(0, 0.1f + h * 1, -1);

               glTexCoord2f(0 * texWidthUsedRatio, 0 * texHeightUsedRatio);
               glVertex3f(0, 0.1f + h * 1, +1);

               // radiosity / blur on the floor

               for (int i = -15; i <= +15; i++) {
                  glColor4f(1, 1, 1, 0.025f);
                  glTexCoord2f(0 * texWidthUsedRatio, 1 * texHeightUsedRatio);
                  glVertex3f(0, 0, +1);

                  glTexCoord2f(1 * texWidthUsedRatio, 1 * texHeightUsedRatio);
                  glVertex3f(0, 0, -1);

                  glColor4f(1, 1, 1, 0.0f);
                  glTexCoord2f(1 * texWidthUsedRatio, 0 * texHeightUsedRatio);
                  glVertex3f(0, -0.5f * h + Math.abs(i) * 0.01f, -1 + (i * 4) * 0.01f);

                  glTexCoord2f(0 * texWidthUsedRatio, 0 * texHeightUsedRatio);
                  glVertex3f(0, -0.5f * h + Math.abs(i) * 0.01f, +1 + (i * 4) * 0.01f);
               }
            }
            glEnd();
            glDisable(GL_BLEND);
            glDisable(GL_TEXTURE_2D);

            glPopMatrix();
         }
         textureRenderTook = System.nanoTime() - textureRenderTook;

         renderFramesLastSecond++;
         if (System.nanoTime() > startedLastSecond + 1_000_000_000L) {
            startedLastSecond += 1_000_000_000L;

            String a = TextValues.formatNumber(textureReceiveTook / 1_000_000.0, 1);
            String b = TextValues.formatNumber(textureUpdateTook / 1_000_000.0, 1);
            String c = TextValues.formatNumber(textureRenderTook / 1_000_000.0, 1);
            Display.setTitle(//
              "rendering " + renderFramesLastSecond + "fps, " + //
                 "video " + videoFramesLastSecond + "fps, " + //
                 "read blocking: " + a + "ms, " + //
                 "texture update: " + b + "ms, " + //
                 "rendering: " + c + "ms");

            renderFramesLastSecond = 0;
            videoFramesLastSecond = 0;
         }

         Display.update();
      }

      movie.close();
      audioRenderer.close();

      Display.destroy();
      AL.destroy();

      System.exit(0);
   }

   static int displayWidth;
   static int displayHeight;

   static int textureHandle;
   static ByteBuffer textureBuffer;

   static float texWidthUsedRatio;
   static float texHeightUsedRatio;
}

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Roquen
« Reply #137 - Posted 2012-08-21 20:11:32 »

WRT: My previous comment.  I'm not attempt to suggest a given game shouldn't...I'm simply saying carefully consider.  All the time spent creating CG animations, music, lip-sync, voice recording (ugg)...is that the best way to improve the game (esp on a tight budget)?  Would that time be better spent elsewhere?  Learning experience certain has great value (if you can afford it) but is it also the best way to spent time learning?  Important questions.
Offline princec

JGO Kernel


Medals: 285
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #138 - Posted 2012-08-22 00:57:23 »

Absolutely. It's just a thing that was not possible before, generally, easily, that is now possible.

We were going to include video in Revenge of the Titans but back in 2010 there was still no trivial solution to it. In the end we did the story screens as they are, and it was a lot of work and admittedly a better result, but there we go. Now in Ultratron we've got all these video displays in little monitors at the edge of the playfield, and Chaz has rendered every single frame out as png, making the final downloadable rather larger than it should be. If Riven's solution is considerably smaller we might switch to using it.

Cas Smiley

Offline noblemaster

JGO Ninja


Medals: 20
Projects: 9


Age of Conquest makes your day!


« Reply #139 - Posted 2012-08-22 07:12:09 »

@Riven: just here to say great work  Grin

Offline ReBirth
« Reply #140 - Posted 2012-08-22 07:16:20 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Exception in thread "main" java.io.IOException: Cannot run program "./res/ffmpeg32.exe": CreateProcess error=2, The system cannot find the file specified
   at java.lang.ProcessBuilder.start(Unknown Source)
   at net.indiespot.media.impl.FFmpeg.extractMetadata(FFmpeg.java:73)
   at net.indiespot.media.Movie.open(Movie.java:47)
   at com.drabiter.test.VideoPlaybackTest.main(VideoPlaybackTest.java:56)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
   at java.lang.ProcessImpl.create(Native Method)
   at java.lang.ProcessImpl.<init>(Unknown Source)
   at java.lang.ProcessImpl.start(Unknown Source)
   ... 4 more

I tried above code but can't find the file, and I think the problem doesn't lie on my path. Also, is there any way to use this version without lwjgl, like your previous simpler sample code (which uses "oldskool controls")?

Offline delt0r

JGO Coder


Medals: 22


Computers can do that?


« Reply #141 - Posted 2012-08-22 07:23:03 »

ReBirth, its not finding the ffmpeg binary, not lwjgl. This could be because it does not have exe permission, or more likely because you are running the code without the bin directory in the launch directory of your application. 

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Roquen
« Reply #142 - Posted 2012-08-22 07:42:50 »

@princec - Yeah it's great when someone lowers your cost for you.  Only reinvent the wheel if you can't find one in the right size...and then only after you've considered if you're look for the right sized wheel.
Offline ReBirth
« Reply #143 - Posted 2012-08-22 08:06:51 »

@delt0r
It's not something to do with lwjgl Smiley on last sentence I asked why riven's previous code which is shorter can't be used. I fixed problem on that post, I didn't see that slash. However I got this now
1  
Exception in thread "main" java.lang.IllegalStateException: failed to find framerate of video

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #144 - Posted 2012-08-22 10:00:38 »

Version 0.8.4 of YUNPM



Changes
  • Changed the directory structure for libraries
  • Throwing exception if it cannot find the right ffmpeg version, instead of falling back to non-existing ffmpeg version. persecutioncomplex


Download files

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #145 - Posted 2012-08-22 10:03:16 »

Also, is there any way to use this version without lwjgl, like your previous simpler sample code (which uses "oldskool controls")?
The previous version used LWJGL as well. The controls are independent of the rendering engine.


I added JInput controls (part of LWJGL) to handle pause/resume (spacebar) and volume (scrollwheel), as part of v0.8.5

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline ReBirth
« Reply #146 - Posted 2012-08-22 10:28:14 »

Then how about these code
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
VideoRenderer videoRenderer = new OpenGLVideoRenderer(movieFile.getName());
      AudioRenderer audioRenderer = audioEnabled ? new OpenALAudioRenderer() : null;

      if (videoRenderer instanceof OpenGLVideoRenderer) {
         OpenGLVideoRenderer opengl = (OpenGLVideoRenderer) videoRenderer;
         opengl.setFullscreen(false); // uses current desktop resolution
        opengl.setVSync(true);
         opengl.setRenderRotatingQuad(true);
      }

      VideoPlayback playback = new FFmpegVideoPlayback(movieFile);
      playback.setCoupleFramerateToVideo(false);
      playback.startVideo(videoRenderer, audioRenderer);

they dont work anymore right?

also I dunno what the cause of above exception is until now.

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #147 - Posted 2012-08-22 10:30:39 »

I also don't know what the cause is, which is why I made the code throw an exception with the required information, instead of useing a fallback that was bound to fail.



Then how about these code

...

they dont work anymore right?
Indeed. Version 0.8.x is incompatible with version 0.7.x

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline ReBirth
« Reply #148 - Posted 2012-08-22 10:47:45 »

Thanks. FYI I use your test code (inside the jar) and same video (that pigeons vid). Will try with above code.

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 614
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #149 - Posted 2012-08-22 10:54:01 »

Thanks. FYI I use your test code (inside the jar) and same video (that pigeons vid). Will try with above code.
Just download the latest zip and the latest jar. (and use readme.txt if the patch process is not too obvious)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: 1 ... 3 4 [5] 6
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (81 views)
2014-04-15 18:08:23

BurntPizza (73 views)
2014-04-15 03:46:01

UprightPath (84 views)
2014-04-14 17:39:50

UprightPath (67 views)
2014-04-14 17:35:47

Porlus (84 views)
2014-04-14 15:48:38

tom_mai78101 (107 views)
2014-04-10 04:04:31

BurntPizza (167 views)
2014-04-08 23:06:04

tom_mai78101 (263 views)
2014-04-05 13:34:39

trollwarrior1 (214 views)
2014-04-04 12:06:45

CJLetsGame (223 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!