Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Could not open file! #42

Closed
JuKu opened this issue Jan 4, 2017 · 3 comments
Closed

Exception: Could not open file! #42

JuKu opened this issue Jan 4, 2017 · 3 comments

Comments

@JuKu
Copy link

JuKu commented Jan 4, 2017

Hi,

I have tried to play an MP4 video, but there i get this exception:

java.lang.Exception: Could not open file!
	at com.badlogic.gdx.video.VideoDecoder.loadStream(Native Method)
	at com.badlogic.gdx.video.VideoPlayerDesktop.play(VideoPlayerDesktop.java:140)
	at com.pentaquin.gameclient.gamestate.IntroScene.initialize(IntroScene.java:69)
	at com.pentaquin.gameclient.Game.initialize(Game.java:48)
	at com.pentaquin.engine.adapter.GameAdapter.create(GameAdapter.java:47)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Exception in thread "LWJGL Application" java.lang.NullPointerException
	at com.badlogic.gdx.video.VideoPlayerDesktop.renderTexture(VideoPlayerDesktop.java:249)
	at com.badlogic.gdx.video.VideoPlayerDesktop.render(VideoPlayerDesktop.java:228)
	at com.pentaquin.gameclient.gamestate.IntroScene.draw(IntroScene.java:238)
	at com.pentaquin.engine.component.scene.SceneComponent.draw(SceneComponent.java:45)
	at com.pentaquin.engine.adapter.GameAdapter.beforeDraw(GameAdapter.java:166)
	at com.pentaquin.engine.adapter.GameAdapter.render(GameAdapter.java:58)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
[VideoPlayer::loadFile] Error opening file: Invalid data found when processing input

@robbiedobbie Which file formats are supported?

@JuKu
Copy link
Author

JuKu commented Jan 4, 2017

How i play the video:

//on initialization
VideoPlayer videoPlayer = VideoPlayerCreator.createVideoPlayer(viewport);
try {
    this.videoPlayer.play(Gdx.files.absolute("./data/video/intro_sequence.mp4"));
} catch (FileNotFoundException e) {
    e.printStackTrace();
}

//...

//in gameloop
videoPlayer.render();

@RBogie
Copy link
Member

RBogie commented Jan 5, 2017

The codec is not supported in the prebuild ffmpeg. To play it safe with licensing, the initial prebuild ffmpeg for the desktop player only supports webm/ogg video. If you want other codecs, you'll have to build your own ffmpeg for now.

@SimonIT
Copy link
Member

SimonIT commented Jun 28, 2021

Look at #68 for some current building hints

@SimonIT SimonIT closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants