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

Videos (used with VideoPlayer) not packaged in .pck of exported game #14954

Closed
1 task done
cyaoeu opened this issue Dec 22, 2017 · 8 comments · Fixed by #19937
Closed
1 task done

Videos (used with VideoPlayer) not packaged in .pck of exported game #14954

cyaoeu opened this issue Dec 22, 2017 · 8 comments · Fixed by #19937

Comments

@cyaoeu
Copy link

cyaoeu commented Dec 22, 2017

Godot version:

3.0b2

OS/device including version:

Win8, GTX1070

Issue description:

Videos used with VideoPlayer are not packaged in .pck of exported Windows game. Even with Export all and adding *.webm or *.ogv. This means that they don't play at all when you try to play the game outside of the project folder.
Expected behavior is for videos to be packaged in the .pck so they play with just the .exe and the .pck.

Steps to reproduce:

  • Import a video to the project.
  • Add a VideoPlayer node.
  • Set the VideoPlayer node to play the video.
  • Confirm that it plays when playing the project inside the Godot editor.
  • Export the game outside of the project folder.
  • Run the game. The video doesn't play.
  • Move the game inside of the project folder. The video plays again.

Minimal reproduction project:

  • I searched the existing GitHub issues
    for potential duplicates.
@ghost ghost added this to the 3.0 milestone Dec 23, 2017
@reduz
Copy link
Member

reduz commented Jan 16, 2018

you can for now add them manually as you describe. I am trying to see if we can move video decoding to GDNative for 3.1, so this may no longer be an issue then. I will kick for 3.1 and close when this happens.

@reduz reduz modified the milestones: 3.0, 3.1 Jan 16, 2018
@Sslaxx
Copy link

Sslaxx commented Jan 20, 2018

How would you envisage video decoding via GDNative to work?

@DimitriyPS
Copy link

There is an option to migrate this patch to 3.0.2?

@akien-mga
Copy link
Member

There is an option to migrate this patch to 3.0.2?

Well there's no patch yet. Once there's a fix, we can cherry-pick it for the stable branch, yes.

@akien-mga
Copy link
Member

akien-mga commented Mar 14, 2018

I am trying to see if we can move video decoding to GDNative for 3.1, so this may no longer be an issue then.

That's not a solution for 3.0 (and we need one there), and there's no guarantee that this will happen for 3.1, so exporting videos should be fixed. It doesn't hurt to remove that code/move it to gdnative plugins later on.

@emilevdb
Copy link

Is there a workaround for this for HTML5 games?

@Calinou
Copy link
Member

Calinou commented Jun 19, 2018

Is there a workaround for this for HTML5 games?

As far as I know, video decoding is disabled in the HTML5 export because it would be too slow (the assembly code paths present in libvpx cannot be used in WebAssembly).

@leonkrause
Copy link
Contributor

For HTML5, The WebM module is active, though I've never tested it. You'll have to use preloadFile() to load the .webm file before starting the game.

@akien-mga akien-mga changed the title Videos (used with VideoPlayer) not packaged in .pck of exported game (Win) Videos (used with VideoPlayer) not packaged in .pck of exported game Jul 3, 2018
akien-mga added a commit to akien-mga/godot that referenced this issue Jul 3, 2018
Theora and WebM video streams were mistakenly imported with a ResourceImporter,
but those imported ogvstr and webmstr were simply links to the local resource.
While that works fine in the editor, it no longer works when exporting a game
as the "source" ogv and webm files are ommitted and only the ogvstr and webmstr
references were exported.

As discussed with @reduz, it doesn't make sense to import videos, as we only
intend to play them back and not modify them/access their raw data. As such we
use a ResourceFormatLoader instead of an importer, to load the file on the fly.
ogv and webm files linked to this loader are now considered as resources, and
thus exported.

Note: The Theora and WebM loaders lack any kind of validity check beyond the
existence of the target file, but it was already the case with the importer.
Better checks and error reports could be added, but those loaders will eventually
be obsoleted by GDNative plugins anyway.

Fixes godotengine#14954.
malcolmhoward pushed a commit to malcolmhoward/godot that referenced this issue Jul 31, 2018
Theora and WebM video streams were mistakenly imported with a ResourceImporter,
but those imported ogvstr and webmstr were simply links to the local resource.
While that works fine in the editor, it no longer works when exporting a game
as the "source" ogv and webm files are ommitted and only the ogvstr and webmstr
references were exported.

As discussed with @reduz, it doesn't make sense to import videos, as we only
intend to play them back and not modify them/access their raw data. As such we
use a ResourceFormatLoader instead of an importer, to load the file on the fly.
ogv and webm files linked to this loader are now considered as resources, and
thus exported.

Note: The Theora and WebM loaders lack any kind of validity check beyond the
existence of the target file, but it was already the case with the importer.
Better checks and error reports could be added, but those loaders will eventually
be obsoleted by GDNative plugins anyway.

Fixes godotengine#14954.
mjtorn pushed a commit to mjtorn/godot that referenced this issue Aug 3, 2018
Theora and WebM video streams were mistakenly imported with a ResourceImporter,
but those imported ogvstr and webmstr were simply links to the local resource.
While that works fine in the editor, it no longer works when exporting a game
as the "source" ogv and webm files are ommitted and only the ogvstr and webmstr
references were exported.

As discussed with @reduz, it doesn't make sense to import videos, as we only
intend to play them back and not modify them/access their raw data. As such we
use a ResourceFormatLoader instead of an importer, to load the file on the fly.
ogv and webm files linked to this loader are now considered as resources, and
thus exported.

Note: The Theora and WebM loaders lack any kind of validity check beyond the
existence of the target file, but it was already the case with the importer.
Better checks and error reports could be added, but those loaders will eventually
be obsoleted by GDNative plugins anyway.

Fixes godotengine#14954.

(cherry picked from commit 6dc20ad)
akien-mga added a commit to akien-mga/godot that referenced this issue Jul 3, 2019
Theora and WebM video streams were mistakenly imported with a ResourceImporter,
but those imported ogvstr and webmstr were simply links to the local resource.
While that works fine in the editor, it no longer works when exporting a game
as the "source" ogv and webm files are ommitted and only the ogvstr and webmstr
references were exported.

As discussed with @reduz, it doesn't make sense to import videos, as we only
intend to play them back and not modify them/access their raw data. As such we
use a ResourceFormatLoader instead of an importer, to load the file on the fly.
ogv and webm files linked to this loader are now considered as resources, and
thus exported.

Note: The Theora and WebM loaders lack any kind of validity check beyond the
existence of the target file, but it was already the case with the importer.
Better checks and error reports could be added, but those loaders will eventually
be obsoleted by GDNative plugins anyway.

Fixes godotengine#14954.

(cherry picked from commit 6dc20ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants