-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
VideoStreamTheora: Identical frames make the audio buggy #66331
Comments
Probably related to #21568, but in this case the video begins with identical frames. |
Hi @DeeJayLSP . Could you paste the ffprobe log of the video that's causing the problem? |
I really don't see a problem there. |
There are 2 encoders that I use: FFmpeg and ffmpeg2theora. For the first, FFmpeg does both the decoding and encoding. For the second, FFmpeg does the decoding, but encoding is done by your local libtheora and libvorbis. While it has some (really avoidable) bugs due to expecting an old version of FFmpeg, as ffmpeg2theora hasn't been updated since 2016 (you also have to do some things like converting the video to another encoder like H.264 or FFV1 before that), its Despite that, a video encoded with both yield the same problem. |
This will be interesting to mention in the Playing videos documentation if we can manage to fix this bug 🙂 |
Well, as long as a video doesn't start with multiple identical frames there will be no bug. |
See the comment below this one. There's a comment right below the |
I don't have a deep understanding of C++, but there is a behavior that I understood well:
|
Ogg-Theora is an awkward file format to work with. The problem is that the format encourages a lot of moving parts. I believe I creator made those moving parts to encourage easier encoder design, but this stuff is hard. https://lwn.net/Articles/382478/ You can read about my attempt I didn't bother to upstream awhile ago. https://hungrymonkey.github.io/seeking-three-moving-windows-ogg-theora/ |
Hello. I use version 4.0.stable and I have a similar problem. The sound is noticeably lagging behind the video. Is there any information whether this issue will be resolved? Thanks. |
I encountered the bug, I used the |
Note that |
I've come across this in the Theora source code and I thought I'd share the info here. The Theora documentation says the default encoding speed level is 0 (the slowest, more quality), but the library is using speed level 1 as default. ffmpeg2theora is setting speed level to 0 when I'll try to get this change into ffmpeg, either as a switch or always speed level 0. |
Godot version
Both 3.5 and 4.0 beta 1
System information
Kubuntu 22.04
Issue description
On videos that start with a black screen, the audio plays incorrectly.
This bug is much more noticeable if the keyframe interval is set to a high value (through
-g
or-g:v
) such as 300 (10 times the frame rate, the max recommended by Theora guides), where the audio only begins playing after the first non-black frame appears, then randomly starts trying to seek to the correct position. This won't happen in video players such as VLC or mpv.On videos that don't start with a black screen, or have a keyframe interval set to 1 (which will result in a very heavy file) the audio begins playing normally.
(Seriously, increasing the keyframe interval is simply an amazing way to reduce Theora file sizes, at the cost of having some very minor motion artifacts, but you can get a video of quality 8 at the same size as quality 6 at low keyframe interval)
Steps to reproduce
-g:v
set to a high number such as 300 is very important)Minimal reproduction project
I'm afraid of inserting a branded video here.
The text was updated successfully, but these errors were encountered: