[FFmpeg-trac] #9713(avcodec:new): Hardware accelerated decoding fails on M1 macs for certain videos encoded with h264
FFmpeg
trac at avcodec.org
Tue Apr 5 15:15:42 EEST 2022
#9713: Hardware accelerated decoding fails on M1 macs for certain videos encoded
with h264
-----------------------------------+--------------------------------------
Reporter: mikffmpeg | Type: defect
Status: new | Priority: normal
Component: avcodec | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-----------------------------------+--------------------------------------
'''Summary of the bug:'''
Using hardware acceleration (i.e. videotoolbox) to decode the frames of
some video streams encoded with h264 fails on recent M1 mac computers.
'''How to reproduce:'''
Ensure you are using a Mac with an Apple M1 chip.
Download the attached sample file and use ffmpeg to target it with
{{{
% ffmpeg -hwaccel videotoolbox -i m1_not_decodable_with_acceleration.ts
-an output.ts
}}}
The terminal will then repeatedly print
{{{
[h264 @ 0x7f85b5f32ec0] hardware accelerator failed to decode picture
Error while decoding stream #0:0: Unknown error occurred
}}}
'''Other details:'''
This bug does not occur with all videos encoded with h264. Although the
issue can be reproduced with the most recent ffmpeg binary (version
N-106494-g1291568c98-tessus), when looking at the source code FFmpeg 3.3,
it seems that the failure is caused by a call to
[https://developer.apple.com/documentation/videotoolbox/1536071-vtdecompressionsessiondecodefram?language=objc/
VTDecompressionSessionDecodeFrame]. This call does not return an error
code, but it alters the videotoolbox context's state so as not to fail on
a null pointer check.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9713>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list