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

examples/video: add a WebM video #3065

Open
11 tasks
hajimehoshi opened this issue Aug 15, 2024 · 8 comments
Open
11 tasks

examples/video: add a WebM video #3065

hajimehoshi opened this issue Aug 15, 2024 · 8 comments
Labels
Milestone

Comments

@hajimehoshi
Copy link
Owner

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

We want to make a proof of concept to play a WebM video.

https://github.com/xlab/libvpx-go is available. In the long run, we have to develop a pure Go WebM decoder.

Why is this needed?

Now we can play MPEG videos but the file size tends to be large compared to WebM videos.

@hajimehoshi hajimehoshi added this to the v2.9.0 milestone Aug 15, 2024
@TotallyGamerJet
Copy link
Contributor

WebM is just the container for VP8, VP9, and AV1. There is already a reader written in Go for webm. You could also use the x/image/vp8 package to actually decode the video frames. Hopefully this can be a good starting point

https://github.com/ebml-go/webm
https://pkg.go.dev/golang.org/x/image/vp8

@hajimehoshi
Copy link
Owner Author

Thanks, but VP9, AV1, and Opus are not supported in a pure Go way yet, right?

@TotallyGamerJet
Copy link
Contributor

Correct. I just tried to use the vp8 package but i couldn't get it to work. Kept giving me Golden / Alt frames are not implemented. So it seems the package is not feature complete

@TotallyGamerJet
Copy link
Contributor

Actually there is an opus package but idk if it works or not.

https://github.com/pion/opus

@realskyquest
Copy link

Is the api for webm player gonna be based on the mpeg and will it replace the use of mpeg.

I support the change from mpeg to webm, it's mature and is common format in web, it will definitely reduce size.

This will be a complicated new feature.

@hajimehoshi
Copy link
Owner Author

I don't plan to add a feature for WebM to Ebitengine itself so far. I just plan to update the example to use WebM, even though this uses Cgo.

@hajimehoshi
Copy link
Owner Author

By the way, there are some projects to use Wasm and Wazero to run C libraries in the pure Go way:

https://github.com/wasilibs
https://github.com/ncruces/go-sqlite3

@realskyquest
Copy link

Well, wazero works fine and it's tested on production environment. I guess gen2brain only has webp, the support for webm have to be done using libwebm.

I remember reading this blog about using wazero, they did appreciate the crossplatform capabilities in exchange for performance hit.

https://www.dolthub.com/blog/2023-05-19-wasm-in-go/
https://github.com/gen2brain/webp
https://github.com/webmproject/libwebm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants