obs-ffmpeg: Improve color space handling
Add support for VIDEO_CS_SRGB. Use SMPTE 170M for 601 instead of undef/BT470BG. This is the American/Chromium way of handling 601. Add color metadata to the container file as well via ffmpeg-mux.
This commit is contained in:
@@ -79,6 +79,10 @@ struct main_params {
|
||||
int height;
|
||||
int fps_num;
|
||||
int fps_den;
|
||||
int color_primaries;
|
||||
int color_trc;
|
||||
int colorspace;
|
||||
int color_range;
|
||||
char *acodec;
|
||||
char *muxer_settings;
|
||||
};
|
||||
@@ -249,6 +253,18 @@ static bool init_params(int *argc, char ***argv, struct main_params *params,
|
||||
return false;
|
||||
if (!get_opt_int(argc, argv, ¶ms->height, "video height"))
|
||||
return false;
|
||||
if (!get_opt_int(argc, argv, ¶ms->color_primaries,
|
||||
"video color primaries"))
|
||||
return false;
|
||||
if (!get_opt_int(argc, argv, ¶ms->color_trc,
|
||||
"video color trc"))
|
||||
return false;
|
||||
if (!get_opt_int(argc, argv, ¶ms->colorspace,
|
||||
"video colorspace"))
|
||||
return false;
|
||||
if (!get_opt_int(argc, argv, ¶ms->color_range,
|
||||
"video color range"))
|
||||
return false;
|
||||
if (!get_opt_int(argc, argv, ¶ms->fps_num, "video fps num"))
|
||||
return false;
|
||||
if (!get_opt_int(argc, argv, ¶ms->fps_den, "video fps den"))
|
||||
@@ -327,6 +343,10 @@ static void create_video_stream(struct ffmpeg_mux *ffm)
|
||||
context->height = ffm->params.height;
|
||||
context->coded_width = ffm->params.width;
|
||||
context->coded_height = ffm->params.height;
|
||||
context->color_primaries = ffm->params.color_primaries;
|
||||
context->color_trc = ffm->params.color_trc;
|
||||
context->colorspace = ffm->params.colorspace;
|
||||
context->color_range = ffm->params.color_range;
|
||||
context->extradata = extradata;
|
||||
context->extradata_size = ffm->video_header.size;
|
||||
context->time_base =
|
||||
|
Reference in New Issue
Block a user