encoder: See description

Features, Fixes, etc:
- Added encoding 'Mode' selection which allows users to choose between Normal (Single Frame), Temporal (Single + Last Frame) and Sequential (VFW Default).
- Fixed several compiler warnings with mismatched types and unused variables.
- 'Keyframe Interval' and 'Bitrate' now default to 0 (Encoder decides).
- 'Quality' now defaults to 100.0%.
- Added default Quality and Keyframe Interval to log.
- 'Bitrate', 'Quality', 'Configure' and 'About' are hidden when the encoder does not support them.
- Encoder States are stored in-memory during an OBS session.

ToDo:
- Save/Load encoder state from disk.
This commit is contained in:
Michael Fabian Dirks
2017-06-08 09:39:07 +02:00
parent 0311777e7a
commit 0437f1bef3
3 changed files with 276 additions and 85 deletions
+27 -5
View File
@@ -28,6 +28,11 @@ namespace VFW {
obs_encoder_info obsInfo;
std::string FourCC, FourCC2;
std::vector<uint8_t> stateInfo;
int32_t defaultQuality;
int32_t defaultKeyframeRate;
bool hasConfigure, hasAbout;
};
bool Initialize();
bool Finalize();
@@ -65,11 +70,28 @@ namespace VFW {
private:
VFW::Info* myInfo;
HIC hIC;
std::vector<char> vbiInput, vbiOutput;
BITMAPINFO *biInput, *biOutput;
std::vector<char> inBuffer, outBuffer;
COMPVARS cv;
uint32_t width, height, fpsNum, fpsDen;
uint32_t userKeyframeInterval, userBitrate, userQuality;
std::vector<char>
m_bufferInput,
m_bufferInputBitmapInfo,
m_bufferPrevInput,
m_bufferPrevInputBitmapInfo,
m_bufferOutput,
m_bufferOutputBitmapInfo;
BITMAPINFO
*m_inputBitmapInfo,
*m_prevInputBitmapInfo,
*m_outputBitmapInfo;
uint32_t
m_width, m_height,
m_fpsNum, m_fpsDen,
m_keyframeInterval,
m_bitrate, m_quality;
bool
m_useNormalCompress,
m_useTemporalFlag,
m_useBitrateFlag,
m_useQualityFlag;
};
};
+1
View File
@@ -36,6 +36,7 @@
#define PROP_KEYFRAME_INTERVAL "KeyframeInterval"
#define PROP_MODE "Mode"
#define PROP_MODE_NORMAL "Mode.Normal"
#define PROP_MODE_TEMPORAL "Mode.Temporal"
#define PROP_MODE_SEQUENTIAL "Mode.Sequential"
#define PROP_CONFIGURE "Configure"