diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-output.c b/plugins/obs-ffmpeg/obs-ffmpeg-output.c index 19cedea48..8d625ebea 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-output.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-output.c @@ -704,8 +704,8 @@ static void receive_video(void *param, struct video_data *frame) data->vframe->linesize); else copy_data(data->vframe, frame, context->height, context->pix_fmt); - - if (data->output->flags) { +#if LIBAVFORMAT_VERSION_MAJOR < 58 + if (data->output->flags & AVFMT_RAWPICTURE) { packet.flags |= AV_PKT_FLAG_KEY; packet.stream_index = data->video->index; packet.data = data->vframe->data[0]; @@ -717,6 +717,7 @@ static void receive_video(void *param, struct video_data *frame) os_sem_post(output->write_sem); } else { +#endif data->vframe->pts = data->total_frames; #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 40, 101) ret = avcodec_send_frame(context, data->vframe); @@ -753,8 +754,9 @@ static void receive_video(void *param, struct video_data *frame) } else { ret = 0; } +#if LIBAVFORMAT_VERSION_MAJOR < 58 } - +#endif if (ret != 0) { blog(LOG_WARNING, "receive_video: Error writing video: %s", av_err2str(ret));