theoraenc bitrate problems (with and without GES)
amindfv at mailbox.org
amindfv at mailbox.org
Mon Apr 3 08:11:25 UTC 2023
I'm using GES to create a video with an ogg container and a theora video stream. I find that setting a bitrate value for the theora stream results in a consistently low video quality.
I set the bitrate like so:
GstPreset *preset;
preset = GST_PRESET (gst_element_factory_make ("theoraenc", "theorapreset"));
g_object_set (preset, "bitrate", 400000, NULL);
gst_preset_save_preset (preset, "this_is_a_test");
And sure enough, in .local/share/gstreamer-1.0/presets/GstTheoraEnc.prs I see:
[this_is_a_test]
name=theorapreset
parent="NULL"
qos=false
min-force-key-unit-interval=0
bitrate=400000
etc.
Regardless of what I set this bitrate value to, however, the bitrate of the output file hovers around 390 kb/s. Before I had set a bitrate value at all, the bitrate of the output file was 1874 kb/s, and visibly much higher quality.
Part of this problem, I assume, is that "bitrate" and "quality" are mutually exclusive settings, so when "bitrate" isn't set the quality default (=48) roughly corresponds to the 1874 kb/s bitrate? But then why does the bitrate setting seem to be totally ignored when it's set?
I've tested without GES and encoding profiles, simply with a one-liner. For example:
gst-launch-1.0 videotestsrc ! video/x-raw,width=1280,height=720 ! theoraenc bitrate=4000000 ! oggmux ! filesink location=/tmp/foo.ogg
This doesn't result in consistent ~390 kb/s like with GES, but it also doesn't result in the requested bitrate.
What's going on?
Any help with this would be very appreciated!
Thanks,
Tom
More information about the gstreamer-devel
mailing list