Allow adjusting bitrate so that I can get a somewhat usable webm video. The audio is still tinny and unlistenable. Configuration option for that might be helpful, or just adjusting defaults in the wrapper.
--- a/QTfrontend/gameuiconfig.cpp Sat Aug 25 22:55:47 2012 +0200
+++ b/QTfrontend/gameuiconfig.cpp Thu Aug 30 22:13:42 2012 -0400
@@ -123,6 +123,7 @@
void GameUIConfig::reloadVideosValues(void)
{
Form->ui.pageVideos->framerateBox->setValue(value("videorec/fps",25).toUInt());
+ Form->ui.pageVideos->bitrateBox->setValue(value("videorec/bitrate",400).toUInt());
bool useGameRes = value("videorec/usegameres",true).toBool();
if (useGameRes)
{
@@ -232,6 +233,7 @@
setValue("videorec/videocodec", videoCodec());
setValue("videorec/audiocodec", audioCodec());
setValue("videorec/fps", rec_Framerate());
+ setValue("videorec/bitrate", rec_Bitrate());
setValue("videorec/width", res.width());
setValue("videorec/height", res.height());
setValue("videorec/usegameres", Form->ui.pageVideos->checkUseGameRes->isChecked());
@@ -466,6 +468,11 @@
return Form->ui.pageVideos->framerateBox->value();
}
+int GameUIConfig::rec_Bitrate()
+{
+ return Form->ui.pageVideos->bitrateBox->value();
+}
+
bool GameUIConfig::recordAudio()
{
return Form->ui.pageVideos->checkRecordAudio->isChecked();
--- a/QTfrontend/gameuiconfig.h Sat Aug 25 22:55:47 2012 +0200
+++ b/QTfrontend/gameuiconfig.h Thu Aug 30 22:13:42 2012 -0400
@@ -64,6 +64,7 @@
QString audioCodec();
QRect rec_Resolution();
int rec_Framerate();
+ int rec_Bitrate();
bool recordAudio();
#ifdef __APPLE__
--- a/QTfrontend/net/recorder.cpp Sat Aug 25 22:55:47 2012 +0200
+++ b/QTfrontend/net/recorder.cpp Thu Aug 30 22:13:42 2012 -0400
@@ -122,7 +122,9 @@
arguments << prefix;
arguments << config->AVFormat();
arguments << config->videoCodec();
- arguments << "5"; // video quality
+// Could use a field to use quality instead. maybe quality could override bitrate - or just pass (and set) both.
+// The library does support using both at once after all.
+ arguments << QString::number(config->rec_Bitrate()*1024);
arguments << (config->recordAudio()? config->audioCodec() : "no");
return arguments;
--- a/QTfrontend/ui/page/pagevideos.cpp Sat Aug 25 22:55:47 2012 +0200
+++ b/QTfrontend/ui/page/pagevideos.cpp Thu Aug 30 22:13:42 2012 -0400
@@ -203,6 +203,17 @@
framerateBox->setSingleStep(1);
pOptLayout->addWidget(framerateBox, 6, 1);
+ // label for Bitrate
+ QLabel *labelBitrate = new QLabel(pOptionsGroup);
+ labelBitrate->setText(QLabel::tr("Bitrate (Kbps)"));
+ pOptLayout->addWidget(labelBitrate, 6, 2);
+
+ // bitrate
+ bitrateBox = new QSpinBox(pOptionsGroup);
+ bitrateBox->setRange(100, 5000);
+ bitrateBox->setSingleStep(100);
+ pOptLayout->addWidget(bitrateBox, 6, 3);
+
// button 'set default options'
btnDefaults = new QPushButton(pOptionsGroup);
btnDefaults->setText(QPushButton::tr("Set default options"));
@@ -432,6 +443,7 @@
void PageVideos::setDefaultOptions()
{
framerateBox->setValue(25);
+ bitrateBox->setValue(400);
checkRecordAudio->setChecked(true);
checkUseGameRes->setChecked(true);
setDefaultCodecs();
--- a/QTfrontend/ui/page/pagevideos.h Sat Aug 25 22:55:47 2012 +0200
+++ b/QTfrontend/ui/page/pagevideos.h Thu Aug 30 22:13:42 2012 -0400
@@ -37,6 +37,7 @@
PageVideos(QWidget* parent = 0);
QSpinBox *framerateBox;
+ QSpinBox *bitrateBox;
QLineEdit *widthEdit;
QLineEdit *heightEdit;
QCheckBox *checkUseGameRes;
--- a/share/Makefile Sat Aug 25 22:55:47 2012 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# Default target executed when no arguments are given to make.
-default_target: all
-.PHONY : default_target
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The program to use to edit the cache.
-CMAKE_EDIT_COMMAND = /usr/bin/ccmake
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/baphomet/hg/hedgewars/trunk
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/baphomet/hg/hedgewars/trunk
-
-#=============================================================================
-# Targets provided globally by CMake.
-
-# Special rule for the target edit_cache
-edit_cache:
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
- /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : edit_cache
-
-# Special rule for the target edit_cache
-edit_cache/fast: edit_cache
-.PHONY : edit_cache/fast
-
-# Special rule for the target install
-install: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
- /usr/bin/cmake -P cmake_install.cmake
-.PHONY : install
-
-# Special rule for the target install
-install/fast: preinstall/fast
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
- /usr/bin/cmake -P cmake_install.cmake
-.PHONY : install/fast
-
-# Special rule for the target install/local
-install/local: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
- /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
-.PHONY : install/local
-
-# Special rule for the target install/local
-install/local/fast: install/local
-.PHONY : install/local/fast
-
-# Special rule for the target install/strip
-install/strip: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
- /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-.PHONY : install/strip
-
-# Special rule for the target install/strip
-install/strip/fast: install/strip
-.PHONY : install/strip/fast
-
-# Special rule for the target list_install_components
-list_install_components:
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
-.PHONY : list_install_components
-
-# Special rule for the target list_install_components
-list_install_components/fast: list_install_components
-.PHONY : list_install_components/fast
-
-# Special rule for the target package
-package: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
- cd /home/baphomet/hg/hedgewars/trunk && /usr/bin/cpack --config ./CPackConfig.cmake
-.PHONY : package
-
-# Special rule for the target package
-package/fast: package
-.PHONY : package/fast
-
-# Special rule for the target package_source
-package_source:
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
- cd /home/baphomet/hg/hedgewars/trunk && /usr/bin/cpack --config ./CPackSourceConfig.cmake /home/baphomet/hg/hedgewars/trunk/CPackSourceConfig.cmake
-.PHONY : package_source
-
-# Special rule for the target package_source
-package_source/fast: package_source
-.PHONY : package_source/fast
-
-# Special rule for the target rebuild_cache
-rebuild_cache:
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
- /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
-
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-.PHONY : rebuild_cache/fast
-
-# The main all target
-all: cmake_check_build_system
- cd /home/baphomet/hg/hedgewars/trunk && $(CMAKE_COMMAND) -E cmake_progress_start /home/baphomet/hg/hedgewars/trunk/CMakeFiles /home/baphomet/hg/hedgewars/trunk/share/CMakeFiles/progress.marks
- cd /home/baphomet/hg/hedgewars/trunk && $(MAKE) -f CMakeFiles/Makefile2 share/all
- $(CMAKE_COMMAND) -E cmake_progress_start /home/baphomet/hg/hedgewars/trunk/CMakeFiles 0
-.PHONY : all
-
-# The main clean target
-clean:
- cd /home/baphomet/hg/hedgewars/trunk && $(MAKE) -f CMakeFiles/Makefile2 share/clean
-.PHONY : clean
-
-# The main clean target
-clean/fast: clean
-.PHONY : clean/fast
-
-# Prepare targets for installation.
-preinstall: all
- cd /home/baphomet/hg/hedgewars/trunk && $(MAKE) -f CMakeFiles/Makefile2 share/preinstall
-.PHONY : preinstall
-
-# Prepare targets for installation.
-preinstall/fast:
- cd /home/baphomet/hg/hedgewars/trunk && $(MAKE) -f CMakeFiles/Makefile2 share/preinstall
-.PHONY : preinstall/fast
-
-# clear depends
-depend:
- cd /home/baphomet/hg/hedgewars/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
-.PHONY : depend
-
-# Help Target
-help:
- @echo "The following are some of the valid targets for this Makefile:"
- @echo "... all (the default if no target is provided)"
- @echo "... clean"
- @echo "... depend"
- @echo "... edit_cache"
- @echo "... install"
- @echo "... install/local"
- @echo "... install/strip"
- @echo "... list_install_components"
- @echo "... package"
- @echo "... package_source"
- @echo "... rebuild_cache"
-.PHONY : help
-
-
-
-#=============================================================================
-# Special targets to cleanup operation of make.
-
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
- cd /home/baphomet/hg/hedgewars/trunk && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
-