UI: Ensure NV12/I420 format for streaming encoder

Due to the fact that flash cannot decode formats such as YUV 4:4:4, do
not allow the streaming encoders to use formats other than NV12/I420.
master
jp9000 2015-04-17 02:48:06 -07:00
parent c33384fe7a
commit 94a1dbfc5f
1 changed files with 13 additions and 0 deletions

View File

@ -135,6 +135,12 @@ void SimpleOutput::Update()
obs_service_apply_encoder_settings(main->GetService(), obs_service_apply_encoder_settings(main->GetService(),
h264Settings, aacSettings); h264Settings, aacSettings);
video_t *video = obs_get_video();
enum video_format format = video_output_get_format(video);
if (format != VIDEO_FORMAT_NV12 && format != VIDEO_FORMAT_I420)
obs_encoder_set_preferred_video_format(h264, VIDEO_FORMAT_NV12);
obs_encoder_update(h264, h264Settings); obs_encoder_update(h264, h264Settings);
obs_encoder_update(aac, aacSettings); obs_encoder_update(aac, aacSettings);
@ -381,6 +387,13 @@ void AdvancedOutput::UpdateStreamSettings()
obs_service_apply_encoder_settings(main->GetService(), obs_service_apply_encoder_settings(main->GetService(),
settings, nullptr); settings, nullptr);
video_t *video = obs_get_video();
enum video_format format = video_output_get_format(video);
if (format != VIDEO_FORMAT_NV12 && format != VIDEO_FORMAT_I420)
obs_encoder_set_preferred_video_format(h264Streaming,
VIDEO_FORMAT_NV12);
obs_encoder_update(h264Streaming, settings); obs_encoder_update(h264Streaming, settings);
} }