static inline struct video_scale_info *get_video_conversion( struct obs_output *output) { if (output->video_conversion_set) { if (!output->video_conversion.width) output->video_conversion.width = obs_output_get_width(output); if (!output->video_conversion.height) output->video_conversion.height = obs_output_get_height(output); return &output->video_conversion; } else if (has_scaling(output)) { const struct video_output_info *info = video_output_get_info(output->video); output->video_conversion.format = info->format; output->video_conversion.colorspace = VIDEO_CS_DEFAULT; output->video_conversion.range = VIDEO_RANGE_DEFAULT; output->video_conversion.width = output->scaled_width; output->video_conversion.height = output->scaled_height; return &output->video_conversion; } return NULL; }
static void add_video_encoder_params(struct ffmpeg_muxer *stream, struct dstr *cmd, obs_encoder_t *vencoder) { obs_data_t *settings = obs_encoder_get_settings(vencoder); int bitrate = (int)obs_data_get_int(settings, "bitrate"); video_t *video = obs_get_video(); const struct video_output_info *info = video_output_get_info(video); obs_data_release(settings); dstr_catf(cmd, "%s %d %d %d %d %d ", "h264", bitrate, obs_output_get_width(stream->output), obs_output_get_height(stream->output), (int)info->fps_num, (int)info->fps_den); }