diff --git a/libobs/media-io/media-remux.c b/libobs/media-io/media-remux.c index 6c14648fe..fc19bb5e7 100644 --- a/libobs/media-io/media-remux.c +++ b/libobs/media-io/media-remux.c @@ -92,12 +92,16 @@ static inline bool init_output(media_remux_job_t job, const char *out_filename) return false; } +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) AVCodecParameters *par = avcodec_parameters_alloc(); ret = avcodec_parameters_from_context(par, in_stream->codec); if (ret == 0) ret = avcodec_parameters_to_context(out_stream->codec, par); avcodec_parameters_free(&par); +#else + ret = avcodec_copy_context(out_stream->codec, in_stream->codec); +#endif if (ret < 0) { blog(LOG_ERROR, "media_remux: Failed to copy context");