Opened 4 years ago

Last modified 4 years ago

#8789 new defect

ffmpeg cannot properly decode some videos using the hardware acceleration framework VideoToolbox on macOS

Reported by: dddong Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
I tried to use ffmpeg to decode the video in h264 encoding format. On the macOS platform, videotoolbox can be used to perform hardware acceleration on video decoding. I turned on this option, but the output of ffmpeg shows that there is a problem with creating Videotoolbox decoder. When hardware acceleration is not used, ffmpeg can correctly decode the video. Quicktime Player can also play the video normally.

How to reproduce:

% ffmpeg  -hwaccel videotoolbox -i 0a4f103fc689528483c66c7535760591.mov       -f rawvideo  -vframes 1 /dev/null
ffmpeg version N-98432-gf1feb3b Copyright (c) 2000-2020 the FFmpeg developers
built on built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-fno-stack-check --enable-ffplay --enable-gnutls --enable-videotoolbox --disable-libjack --disable-indev=jack --disable-x86asm
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 94.100 / 58. 94.100
  libavformat    58. 48.100 / 58. 48.100
  libavdevice    58. 11.101 / 58. 11.101
  libavfilter     7. 86.100 /  7. 86.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
Hyper fast Audio and Video encoder

The full output is in the attachment ffmpeg-20200714-171859.log.

Attachments (2)

0a4f103fc689528483c66c7535760591.mov (61.3 KB ) - added by dddong 4 years ago.
ffmpeg-20200714-171859.log (299.3 KB ) - added by dddong 4 years ago.

Download all attachments as: .zip

Change History (3)

by dddong, 4 years ago

Attachment: ffmpeg-20200714-171859.log added

comment:1 by yao.xiao, 4 years ago

It is not the problem of ffmpeg, but the support of some resolutions of VideoToolboox. VideoToolboox does not support some resolutions.
When calling VTDecompressionSessionCreate, the session cannot be obtained and an error occurs.
VideoToolbox session not available

If you convert your video to a 1080 resolution video, you can't go wrong.

So this is actually a problem with VideoToolboox.

Note: See TracTickets for help on using tickets.