-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Add Ogg Theora support to MovieWriter #107188
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
Conversation
9eb8aad
to
9c542f6
Compare
8d30d3e
to
529ebe9
Compare
I've found out the CPU/GPU times reported at the end of the recording are only for the RenderingServer without including encoding times. So I've added encoding time information to the report by measuring the time it takes to run In my tests with a production build, with the default settings (speed Choosing speed Using CBR with a target bitrate equal to the mean bitrate of the VBR file for equivalent compression takes almost the same time as VBR. It's even slower at speed |
529ebe9
to
fec3797
Compare
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.
Tested locally, it works as expected. Code and documentation looks good to me. I like the addition of the encoding time metric 🙂
Testing project: https://github.com/Calinou/godot-movie-maker-demo
Example output file with the default settings:
Input #0, ogg, from 'out.ogv':
Duration: 00:00:30.00, start: 0.000000, bitrate: 27760 kb/s
Stream #0:0: Video: theora, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 60 tbn
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp, 96 kb/s
The file plays back correctly in mpv.
Encoding speeds (measured on a debug build):
OGV
Done recording movie at path: /tmp/out.ogv
1800 frames at 60 FPS (movie length: 00:00:30:00), recorded in 00:01:41 (29% of real-time speed).
CPU time: 1.40 seconds (average: 0.78 ms/frame)
GPU time: 10.53 seconds (average: 5.85 ms/frame)
Encoding time: 30.79 seconds (average: 17.10 ms/frame)
AVI
Done recording movie at path: /tmp/out.avi
1800 frames at 60 FPS (movie length: 00:00:30:00), recorded in 00:01:35 (31% of real-time speed).
CPU time: 1.39 seconds (average: 0.77 ms/frame)
GPU time: 9.57 seconds (average: 5.32 ms/frame)
Encoding time: 28.88 seconds (average: 16.04 ms/frame)
PNG/WAV
Done recording movie at path: /tmp/out.png
1800 frames at 60 FPS (movie length: 00:00:30:00), recorded in 00:04:01 (12% of real-time speed).
CPU time: 1.56 seconds (average: 0.87 ms/frame)
GPU time: 33.50 seconds (average: 18.61 ms/frame)
Encoding time: 148.37 seconds (average: 82.43 ms/frame)
You can add an OGV
capitalization here so the Project Settings category uses correct casing:
capitalize_string_remaps["nfc"] = "NFC"; |
I agree, I suggest removing the CBR setting if we can't find a good use case for it. |
afb0c54
to
15cf953
Compare
Thanks for all the suggestions, and for saving me from my struggles when writing documentation. I've removed the And rebased it on top of the current master, now with Theora 1.2.0. I forgot to mention it before but I'm using |
15cf953
to
7835891
Compare
I've put everything in one commit. |
81b9079
to
d3f0cc7
Compare
I've tried to address the issues, although I have doubts about the inclusion of CC-BY-SA 3.0 code. I've made a few minor changes to the I've added a check for the video dimensions because the encoding won't work if they aren't even. Since |
d3f0cc7
to
6508aa1
Compare
5d48b91
to
1008afa
Compare
1008afa
to
b671d9f
Compare
5ca9260
to
a8331d9
Compare
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.
Looks pretty good to me!
I notice that, unlike what I might have suggested before, --movie-writer
seems to be exposed in non-editor builds (export templates). I don't know if it actually works that way, but that means that with the changes done to only include the theora encoder in editor builds, OGV won't be available as a format for runtime movie encoding.
I think it's an appropriate tradeoff for now, and we can reconsider it if there's significant demand and the binary size impact is not too big.
0af64af
to
6f24ad4
Compare
6f24ad4
to
c30592e
Compare
I didn't think to check it out. It made sense that it was editor-only.
Don't hesitate to ask me if you change your mind now or later, it's easy to revert. |
Movie Maker mode can now record files in `.ogv` format, which can be directly viewed in Godot's VideoStreamPlayer node along with most video players. This is a lossy format with inter-frame compression, unlike AVI + MJPEG which only performs intra-frame compression. Co-authored-by: Hugo Locurcio <[email protected]> Co-authored-by: Leo de Penning <[email protected]>
c30592e
to
a16b04f
Compare
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.
Looks great to me!
Thanks! Great work 🎉 |
Supersedes #106700.
Movie Maker mode can now record files in .ogv format, which can be directly viewed in Godot's VideoStreamPlayer node along with most video players. This is a lossy format with inter-frame compression, unlike AVI + MJPEG which only performs intra-frame compression.
Thanks to @penninghlhd for the initial implementation from #98416 and @Calinou for the cleanup in #106700. 🙂
What I've done:
oggz-validate
and debugged withoggz-dump
.jpg
module it depends on #106013.I've added many settings, but it can help testing them and decide which ones we want. In the case of
video_bitrate
, it enables CBR and it might provide better encoding speed in some cases. Would it be really bad to provide all these options?TODO
The message
[ffmpeg/demuxer] ogg: Broken file, keyframe not correctly marked.
in FFmpeg is still showing, but it's not really an error and it shouldn't affect operations. I think it's just FFmpeg being finicky.