-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[3.x] Support WebM seeking operation #57744
base: 3.x
Are you sure you want to change the base?
Conversation
see #14430 |
Thanks for your feedback, since I'm not an expert in video decoding, but I'll try my best to fix this issue. |
@jamie-pate i have fix the issue, and please verify it on 1ede4ca. Thanks! |
@John-Gdi nice work! Do you know how to fix VideoStreamWebm playing slowly in Html5? I really want to know where the problem is. |
Video decoding will always perform poorly in HTML5 for two reasons:
There isn't a good way to work around this, as WebAssembly cannot make use of the browser's native video decoding functionality (which would allow for hardware-accelerated decoding). Theora might perform better as it's less demanding on the CPU, but I wouldn't expect it to be fantastic there either. |
@@ -62,7 +62,11 @@ VPXDecoder::VPXDecoder(const WebMDemuxer &demuxer, unsigned threads) : | |||
} | |||
|
|||
m_ctx = new vpx_codec_ctx_t; | |||
if (vpx_codec_dec_init(m_ctx, codecIface, &codecCfg, m_delay > 0 ? VPX_CODEC_USE_FRAME_THREADING : 0)) | |||
|
|||
// disable multi thread for decoder to make some vp8 and vp9 video files work properly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also here where chromium removed the flag: https://bugs.chromium.org/p/webm/issues/detail?id=1395
You would likely need a whole new way to play video in the html version.. using the built in video element to create a texture for webgl (like this https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Animating_textures_in_WebGL ). godot's OS.native_video_play https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-native-video-play call would be another way, but docs say they are only currently implemented for ios You could possibly just call out to the browser with javascript to play the video fullscreen with the video element though see #17495 |
Oh, god. I can't handle this work now.(crying...... :< ) |
make the attached vp8 and vp9 webm file plays properly <- this commit does not appear to create a significant performance regression, and I can confirm that the video which is broken in the reproduction plays correctly with up to 4x video streams being decoded concurrently. (probably need a better way to measure performance though than decoding 4 concurrent video streams) perf.log i7-8750H When playing a file that was encoded with vp9 and did not fail to playback in the previous version of godot the frame rate was roughly the same for both commits, and only slightly slower than the godot-videodecoder plugin...
|
Thanks for your test, and hope this pr can satisfy some pepole's needs |
|
"This is a proof-of-concept and not a production-grade library." It looks like it's for encoding video files from raw frames... Also probably not real time |
@jamie-pate @Calinou |
Ogg Theora shouldn't be low definition, it depends on how you encoded the video, like any encoder. |
|
Your video encoding bitrate is set to 6 Mb/s, which is quite low by today's standards, especially for Ogg Theora which is less efficient than H.264 or VP9. For comparison, 1080p60 H.264 video on YouTube is around 10 Mb/s, but even that is considered low quality nowadays (and that's for a more efficient format). To make things worse, you're using the Realtime encoding speed preset, which favors speed over quality (for a given bitrate). Use a encoding slower preset to get better quality with the same bitrate – it doesn't affect decoding speed. |
Great, after modifying the settings, the effect is much better now. |
The current lack of Also all previous proposals and issues have been closed. I'm very happy to see someone is working on this, may I ask what is left for it to be merged? Are there any plans for ogv seek support as well? |
Please test the PR locally and report if it works 🙂
This was being worked on in #32539, but it needs to be salvaged. |
I would love to, but the Windows artifacts are apparently already expired. And I don't feel competent enough to compile and build Godot with these changes. |
I tested it on my end (GNU/Linux), and it doesn't appear to work. The video just goes back to the beginning. |
@John-Gdi Could you look into testing your PR with the file linked by YeldhamDev above? |
Support webm video seeking operation with minimal modification. Currently, it only support 3.x version since master 4.0 version has abandoned webm format support.
Kapture.2022-02-06.at.11.49.43.mp4