Skip to content

Commit

Permalink
Merge pull request #171 from rboy1/patch-4
Browse files Browse the repository at this point in the history
Added support for AV1 CUVID and DXVA2 decoding
  • Loading branch information
erikkaashoek authored Jan 25, 2025
2 parents 7c7cf48 + c2d1e5f commit f76bde4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mpeg2dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,7 @@ int stream_component_open(VideoState *is, int stream_index)
if (codecPar->codec_id == AV_CODEC_ID_MPEG4) codec_hw = avcodec_find_decoder_by_name("mpeg4_dxva2");
if (codecPar->codec_id == AV_CODEC_ID_VC1) codec_hw = avcodec_find_decoder_by_name("vc1_dxva2");
if (codecPar->codec_id == AV_CODEC_ID_HEVC) codec_hw = avcodec_find_decoder_by_name("hevc_dxva2");
if (codecPar->codec_id == AV_CODEC_ID_AV1) codec_hw = avcodec_find_decoder_by_name("av1_dxva2");
}

if (use_vdpau && !codec_hw) {
Expand All @@ -1731,6 +1732,7 @@ int stream_component_open(VideoState *is, int stream_index)
if (codecPar->codec_id == AV_CODEC_ID_HEVC) codec_hw = avcodec_find_decoder_by_name("hevc_cuvid");
if (codecPar->codec_id == AV_CODEC_ID_MPEG4) codec_hw = avcodec_find_decoder_by_name("mpeg4_cuvid");
if (codecPar->codec_id == AV_CODEC_ID_VC1) codec_hw = avcodec_find_decoder_by_name("vc1_cuvid");
if (codecPar->codec_id == AV_CODEC_ID_AV1) codec_hw = avcodec_find_decoder_by_name("av1_cuvid");
}

// If decoding in hardware try if running on a Raspberry Pi and then use it's decoder instead.
Expand Down

0 comments on commit f76bde4

Please sign in to comment.