mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 09:39:15 +00:00
obs-ffmpeg: Tell FFmpeg that BGRA uses alpha
Prevents alpha from getting dropped with custom encoders.
This commit is contained in:
parent
7d26721be5
commit
3462ea3fda
|
@ -241,8 +241,10 @@ static bool create_video_stream(struct ffmpeg_data *data)
|
|||
|
||||
closest_format = data->config.format;
|
||||
if (data->vcodec->pix_fmts) {
|
||||
const int has_alpha = closest_format == AV_PIX_FMT_BGRA;
|
||||
closest_format = avcodec_find_best_pix_fmt_of_list(
|
||||
data->vcodec->pix_fmts, data->config.format, 0, NULL);
|
||||
data->vcodec->pix_fmts, closest_format, has_alpha,
|
||||
NULL);
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
|
||||
|
|
Loading…
Reference in a new issue