diff --git a/es-core/src/components/VideoFFmpegComponent.cpp b/es-core/src/components/VideoFFmpegComponent.cpp index f52e4d5fb..885b65746 100644 --- a/es-core/src/components/VideoFFmpegComponent.cpp +++ b/es-core/src/components/VideoFFmpegComponent.cpp @@ -1281,8 +1281,13 @@ void VideoFFmpegComponent::startVideoStream() bool hwDecoding = false; #endif +#if LIBAVUTIL_VERSION_MAJOR > 56 + mVideoStreamIndex = av_find_best_stream(mFormatContext, AVMEDIA_TYPE_VIDEO, -1, -1, + const_cast(&mHardwareCodec), 0); +#else mVideoStreamIndex = av_find_best_stream(mFormatContext, AVMEDIA_TYPE_VIDEO, -1, -1, &mHardwareCodec, 0); +#endif if (mVideoStreamIndex < 0) { LOG(LogError) << "VideoFFmpegComponent::startVideoStream(): " diff --git a/es-core/src/components/VideoFFmpegComponent.h b/es-core/src/components/VideoFFmpegComponent.h index f648276bd..eb14f3c63 100644 --- a/es-core/src/components/VideoFFmpegComponent.h +++ b/es-core/src/components/VideoFFmpegComponent.h @@ -20,6 +20,7 @@ extern "C" { #include #include #include +#include #include }