Skip to content

Commit

Permalink
enc-h264, enc-h265: Apply Profile, Level and Tier before Resolution a…
Browse files Browse the repository at this point in the history
…nd Frame Rate

Co-authored-by: Qiang Wen <Qiang.Wen@amd.com>
  • Loading branch information
Xaymar and heishanbaishui committed Jul 18, 2018
1 parent 95c6a51 commit c292f6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Source/enc-h264.cpp
Expand Up @@ -1309,14 +1309,14 @@ Plugin::Interface::H264Interface::H264Interface(obs_data_t* data, obs_encoder_t*
/// Static Properties
m_VideoEncoder->SetQualityPreset(static_cast<QualityPreset>(obs_data_get_int(data, P_QUALITYPRESET)));

/// Frame
m_VideoEncoder->SetResolution(std::make_pair(obsWidth, obsHeight));
m_VideoEncoder->SetFrameRate(std::make_pair(obsFPSnum, obsFPSden));

/// Profile & Level
m_VideoEncoder->SetProfile(static_cast<Profile>(obs_data_get_int(data, P_PROFILE)));
m_VideoEncoder->SetProfileLevel(static_cast<ProfileLevel>(obs_data_get_int(data, P_PROFILELEVEL)));

/// Frame
m_VideoEncoder->SetResolution(std::make_pair(obsWidth, obsHeight));
m_VideoEncoder->SetFrameRate(std::make_pair(obsFPSnum, obsFPSden));

try {
m_VideoEncoder->SetCodingType(static_cast<CodingType>(obs_data_get_int(data, P_CODINGTYPE)));
} catch (...) {
Expand Down
10 changes: 5 additions & 5 deletions Source/enc-h265.cpp
Expand Up @@ -904,16 +904,16 @@ Plugin::Interface::H265Interface::H265Interface(obs_data_t* data, obs_encoder_t*
//m_VideoEncoder->SetUsage(Usage::Transcoding);
m_VideoEncoder->SetQualityPreset(static_cast<QualityPreset>(obs_data_get_int(data, P_QUALITYPRESET)));

/// Frame
m_VideoEncoder->SetResolution(std::make_pair(obsWidth, obsHeight));
m_VideoEncoder->SetFrameRate(std::make_pair(obsFPSnum, obsFPSden));
///- Aspect Ratio

/// Profile & Level
m_VideoEncoder->SetProfile(static_cast<Profile>(obs_data_get_int(data, P_PROFILE)));
m_VideoEncoder->SetProfileLevel(static_cast<ProfileLevel>(obs_data_get_int(data, P_PROFILELEVEL)));
m_VideoEncoder->SetTier(static_cast<H265::Tier>(obs_data_get_int(data, P_TIER)));

/// Frame
m_VideoEncoder->SetResolution(std::make_pair(obsWidth, obsHeight));
m_VideoEncoder->SetFrameRate(std::make_pair(obsFPSnum, obsFPSden));
///- Aspect Ratio

try {
m_VideoEncoder->SetCodingType(static_cast<CodingType>(obs_data_get_int(data, P_CODINGTYPE)));
} catch (...) {
Expand Down

0 comments on commit c292f6d

Please sign in to comment.