Opened 7 months ago

Last modified 5 months ago

#10963 new defect

VP9 hardware decoding very slow on Apple Silicon

Reported by: low-batt Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: low-batt, ePirat Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

What you were trying to accomplish:
Play a VP9 encoded video with hardware decoding using IINA and mpv on a MacBook
Pro with an Apple Silicon processor.

The problem you encountered:
Playback stutters because decoding speed drops from 3.28x with software decoding to 0.428x when hardware decoding is enabled.

This was reported to IINA in issue #4554 and issue #3917. Reproduced with mpv and reported in issue #10587. Those problems were traced to slow decoding when hardware decoding is enabled. See this comment.

The VP9 encoded file "Peru 8K HDR 60FPS (FUHD)._original.webm" in the google drive folder 8k reproduces the slow decoding and playback stuttering when hardware decoding is used. With software decoding playback is fine.

For comparision with the HEVC encoded file "new zealand 8k hevc.mkv" in that same directory decoding speed improves from 2.01x with software decoding to 3.56x when hardware decoding is enabled.

These times are from a MacBookPro18,2 with the M1 Max chip. Tests run on MacBook Pros with M2 Pro and M3 Pro chips that have an improved Media Engine still exhibited slow decoding and playback stuttering.

low-batt@gag ffmpeg (master $%=)$ time ./ffmpeg -v 9 -loglevel 99 -report -hwaccel videotoolbox -i Peru\ 8K\ HDR\ 60FPS\ \(FUHD\)._original.webm -benchmark -f null -
ffmpeg started on 2024-04-12 at 15:38:17
Report written to "ffmpeg-20240412-153817.log"
Log level: 99
ffmpeg version N-114826-g65c1c83ca4 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
  configuration: --enable-debug --disable-stripping --enable-pthreads --enable-version3 --enable-ffplay --enable-gnutls --enable-gpl --enable-libbluray --enable-libdav1d --enable-librubberband --enable-libtesseract --enable-libvidstab --enable-libxml2 --enable-libfontconfig --enable-libfreetype --enable-libass --enable-libspeex --enable-videotoolbox --enable-libzmq --enable-libzimg --enable-libjxl --enable-libwebp --disable-libjack --disable-indev=jack --enable-neon
  libavutil      59. 15.100 / 59. 15.100
  libavcodec     61.  5.102 / 61.  5.102
  libavformat    61.  3.100 / 61.  3.100
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.101 / 10.  2.101
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'videotoolbox'.
Reading option '-i' ... matched as input url with argument 'Peru 8K HDR 60FPS (FUHD)._original.webm'.
Reading option '-benchmark' ... matched as option 'benchmark' (add timings for benchmarking) with argument '1'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'null'.
Reading option '-' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option report (generate a report) with argument 1.
Applying option benchmark (add timings for benchmarking) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url Peru 8K HDR 60FPS (FUHD)._original.webm.
Applying option hwaccel (use HW accelerated decoding) with argument videotoolbox.
Successfully parsed a group of options.
Opening an input file: Peru 8K HDR 60FPS (FUHD)._original.webm.
[AVFormatContext @ 0x1427049c0] Opening 'Peru 8K HDR 60FPS (FUHD)._original.webm' for reading
[file @ 0x600003f20090] Setting default whitelist 'file,crypto,data'
Probing h263 score:25 size:2048
Probing matroska,webm score:100 size:2048
[matroska,webm @ 0x1427049c0] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
st:1 removing common factor 1000000 from timebase
[matroska,webm @ 0x1427049c0] Before avformat_find_stream_info() pos: 749 bytes read:32768 seeks:0 nb_streams:2
For transform of length 120, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 4, inverse, fft_float, flags: [aligned, inplace, preshuf], found 2 matches:
    1: fft4_fwd_float_neon - type: fft_float, len: 4, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft4_ns_float_c - type: fft_float, len: 4, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 120, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft4_fwd_float_neon - type: fft_float, len: 4, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
For transform of length 240, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 8, inverse, fft_float, flags: [aligned, inplace, preshuf], found 3 matches:
    1: fft8_ns_float_neon - type: fft_float, len: 8, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft_pfa_ns_float_c - type: fft_float, len: [6, ∞], factors[2]: [7, 5, 3, 2, any], flags: [unaligned, inplace, out_of_place, preshuf], prio: 112
    3: fft8_ns_float_c - type: fft_float, len: 8, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 240, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft8_ns_float_neon - type: fft_float, len: 8, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
For transform of length 480, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 16, inverse, fft_float, flags: [aligned, inplace, preshuf], found 3 matches:
    1: fft16_ns_float_neon - type: fft_float, len: 16, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft_pfa_ns_float_c - type: fft_float, len: [6, ∞], factors[2]: [7, 5, 3, 2, any], flags: [unaligned, inplace, out_of_place, preshuf], prio: 112
    3: fft16_ns_float_c - type: fft_float, len: 16, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 480, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft16_ns_float_neon - type: fft_float, len: 16, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
For transform of length 960, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 32, inverse, fft_float, flags: [aligned, inplace, preshuf], found 3 matches:
    1: fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft_pfa_ns_float_c - type: fft_float, len: [6, ∞], factors[2]: [7, 5, 3, 2, any], flags: [unaligned, inplace, out_of_place, preshuf], prio: 112
    3: fft32_ns_float_c - type: fft_float, len: 32, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 960, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
[vp9 @ 0x142704fa0] Format yuv420p chosen by get_format().
[opus @ 0x142705670] skip 312/960 samples
[matroska,webm @ 0x1427049c0] All info found
[matroska,webm @ 0x1427049c0] stream 0: start_time: 0 duration: NOPTS
[matroska,webm @ 0x1427049c0] stream 1: start_time: -0.007 duration: NOPTS
[matroska,webm @ 0x1427049c0] format: start_time: -0.007 duration: 337.721 (estimate from stream) bitrate=21256 kb/s
[matroska,webm @ 0x1427049c0] After avformat_find_stream_info() pos: 1007718 bytes read:1040319 seeks:0 frames:2
Selecting decoder 'vp9' because of requested hwaccel method videotoolbox
Input #0, matroska,webm, from 'Peru 8K HDR 60FPS (FUHD)._original.webm':
  Metadata:
    ENCODER         : Lavf58.0.100
  Duration: 00:05:37.72, start: -0.007000, bitrate: 21256 kb/s
  Stream #0:0(eng), 1, 1/1000: Video: vp9 (Profile 0), 1 reference frame, yuv420p(tv, bt709), 7680x4320, 0/1, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 1k tbn (default)
      Metadata:
        DURATION        : 00:05:37.703000000
      Side data:
        Content Light Level Metadata, MaxCLL=1100, MaxFALL=180
  Stream #0:1(eng), 1, 1/1000: Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
      Metadata:
        DURATION        : 00:05:37.721000000
Successfully opened the file.
Parsing a group of options: output url -.
Applying option f (force container format (auto-detected otherwise)) with argument null.
Successfully parsed a group of options.
Opening an output file: -.
[out#0/null @ 0x6000038200c0] No explicit maps, mapping streams automatically...
[vost#0:0/wrapped_avframe @ 0x1427086f0] Created video stream from input stream 0:0
detected 10 logical cores
[aost#0:1/pcm_s16le @ 0x142723030] Created audio stream from input stream 0:1
For transform of length 120, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 4, inverse, fft_float, flags: [aligned, inplace, preshuf], found 2 matches:
    1: fft4_fwd_float_neon - type: fft_float, len: 4, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft4_ns_float_c - type: fft_float, len: 4, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 120, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft4_fwd_float_neon - type: fft_float, len: 4, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
For transform of length 240, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 8, inverse, fft_float, flags: [aligned, inplace, preshuf], found 3 matches:
    1: fft8_ns_float_neon - type: fft_float, len: 8, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft_pfa_ns_float_c - type: fft_float, len: [6, ∞], factors[2]: [7, 5, 3, 2, any], flags: [unaligned, inplace, out_of_place, preshuf], prio: 112
    3: fft8_ns_float_c - type: fft_float, len: 8, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 240, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft8_ns_float_neon - type: fft_float, len: 8, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
For transform of length 480, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 16, inverse, fft_float, flags: [aligned, inplace, preshuf], found 3 matches:
    1: fft16_ns_float_neon - type: fft_float, len: 16, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft_pfa_ns_float_c - type: fft_float, len: [6, ∞], factors[2]: [7, 5, 3, 2, any], flags: [unaligned, inplace, out_of_place, preshuf], prio: 112
    3: fft16_ns_float_c - type: fft_float, len: 16, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 480, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft16_ns_float_neon - type: fft_float, len: 16, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
For transform of length 960, inverse, mdct_float, flags: [aligned, out_of_place], found 5 matches:
    1: mdct_pfa_15xM_inv_float_c - type: mdct_float, len: [30, ∞], factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only], prio: 304
    2: mdct_pfa_5xM_inv_float_c - type: mdct_float, len: [10, ∞], factors[2]: [5, any], flags: [unaligned, out_of_place, inv_only], prio: 144
    3: mdct_pfa_3xM_inv_float_c - type: mdct_float, len: [6, ∞], factors[2]: [3, any], flags: [unaligned, out_of_place, inv_only], prio: 112
    4: mdct_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: 96
    5: mdct_naive_inv_float_c - type: mdct_float, len: [2, ∞], factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only], prio: -130976
For transform of length 32, inverse, fft_float, flags: [aligned, inplace, preshuf], found 3 matches:
    1: fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf], prio: 352
    2: fft_pfa_ns_float_c - type: fft_float, len: [6, ∞], factors[2]: [7, 5, 3, 2, any], flags: [unaligned, inplace, out_of_place, preshuf], prio: 112
    3: fft32_ns_float_c - type: fft_float, len: 32, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf], prio: 96
Transform tree:
    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 960, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
        fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (opus (native) -> pcm_s16le (native))
[vost#0:0/wrapped_avframe @ 0x1427086f0] Starting thread...
[aost#0:1/pcm_s16le @ 0x142723030] Starting thread...
[vf#0:0 @ 0x600003c3fc00] Starting thread...
[af#0:1 @ 0x600003c3fde0] Starting thread...
[vist#0:0/vp9 @ 0x1427043c0] [dec:vp9 @ 0x142709ad0] Starting thread...
[aist#0:1/opus @ 0x142707fa0] [dec:opus @ 0x142724730] Starting thread...
[in#0/matroska,webm @ 0x600003120000] Starting thread...
Press [q] to stop, [?] for help
[vp9 @ 0x1427057a0] Format videotoolbox_vld chosen by get_format().
[vp9 @ 0x1427057a0] Format videotoolbox_vld requires hwaccel vp9_videotoolbox initialisation.
[opus @ 0x142724df0] skip 312/960 samples
[graph_-1_in_0:1 @ 0x600003a24b00] Setting 'time_base' to value '1/48000'
[graph_-1_in_0:1 @ 0x600003a24b00] Setting 'sample_rate' to value '48000'
[graph_-1_in_0:1 @ 0x600003a24b00] Setting 'sample_fmt' to value 'fltp'
[graph_-1_in_0:1 @ 0x600003a24b00] Setting 'channel_layout' to value 'stereo'
[graph_-1_in_0:1 @ 0x600003a24b00] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:stereo
[format_out_#0:1 @ 0x600003a24c60] Setting 'sample_fmts' to value 's16'
[format_out_#0:1 @ 0x600003a24c60] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_#0:1'
[AVFilterGraph @ 0x6000026257a0] query_formats: 4 queried, 4 merged, 6 already done, 0 delayed
[auto_aresample_0 @ 0x600003a24d10] [SWR @ 0x128008000] Using fltp internally between filters
[auto_aresample_0 @ 0x600003a24d10] ch:2 chl:stereo fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[graph -1 input from stream 0:0 @ 0x600003a28160] Setting 'video_size' to value '7680x4320'
[graph -1 input from stream 0:0 @ 0x600003a28160] Setting 'pix_fmt' to value '23'
[graph -1 input from stream 0:0 @ 0x600003a28160] Setting 'time_base' to value '1/1000'
[graph -1 input from stream 0:0 @ 0x600003a28160] Setting 'pixel_aspect' to value '1/1'
[graph -1 input from stream 0:0 @ 0x600003a28160] Setting 'colorspace' to value '1'
[graph -1 input from stream 0:0 @ 0x600003a28160] Setting 'range' to value '1'
[graph -1 input from stream 0:0 @ 0x600003a28160] Setting 'frame_rate' to value '19001/317'
[graph -1 input from stream 0:0 @ 0x600003a28160] w:7680 h:4320 pixfmt:nv12 tb:1/1000 fr:19001/317 sar:1/1 csp:bt709 range:tv
[AVFilterGraph @ 0x6000026348c0] query_formats: 3 queried, 6 merged, 0 already done, 0 delayed
[graph -1 input from stream 0:0 @ 0x600003a28160] video frame properties congruent with link at pts_time: 0.007
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf61.3.100
  Stream #0:0(eng), 0, 317/19001: Video: wrapped_avframe, 1 reference frame, nv12(tv, bt709, progressive), 7680x4320 [SAR 1:1 DAR 16:9], 0/1, q=2-31, 200 kb/s, 59.94 fps, 59.94 tbn (default)
      Metadata:
        DURATION        : 00:05:37.703000000
        encoder         : Lavc61.5.102 wrapped_avframe
      Side data:
        Content Light Level Metadata, MaxCLL=1100, MaxFALL=180
  Stream #0:1(eng), 0, 1/48000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
      Metadata:
        DURATION        : 00:05:37.721000000
        encoder         : Lavc61.5.102 pcm_s16le
[out#0/null @ 0x6000038200c0] Starting thread...
[in#0/matroska,webm @ 0x600003120000] EOF while reading inputN/A speed=0.427x    
[opus @ 0x142724df0] skip 0 / discard 119 samples due to side data
[in#0/matroska,webm @ 0x600003120000] Terminating thread with return code 0 (success)
[opus @ 0x142724df0] discard 119/960 samples
[aist#0:1/opus @ 0x142707fa0] [dec:opus @ 0x142724730] Decoder thread received EOF packet
[aist#0:1/opus @ 0x142707fa0] [dec:opus @ 0x142724730] Decoder returned EOF, finishing
[aist#0:1/opus @ 0x142707fa0] [dec:opus @ 0x142724730] Terminating thread with return code 0 (success)
[out_#0:1 @ 0x600003a24bb0] EOF on sink link out_#0:1:default.
[af#0:1 @ 0x600003c3fde0] Filtergraph returned EOF, finishing
[af#0:1 @ 0x600003c3fde0] All consumers returned EOF
[aost#0:1/pcm_s16le @ 0x142723030] Encoder thread received EOF
[aost#0:1/pcm_s16le @ 0x142723030] Terminating thread with return code 0 (success)
[af#0:1 @ 0x600003c3fde0] Terminating thread with return code 0 (success)
[vist#0:0/vp9 @ 0x1427043c0] [dec:vp9 @ 0x142709ad0] Decoder thread received EOF packet
[vist#0:0/vp9 @ 0x1427043c0] [dec:vp9 @ 0x142709ad0] Decoder returned EOF, finishing
[vist#0:0/vp9 @ 0x1427043c0] [dec:vp9 @ 0x142709ad0] Terminating thread with return code 0 (success)
[out_#0:0 @ 0x600003a28210] EOF on sink link out_#0:0:default.
[vf#0:0 @ 0x600003c3fc00] Filtergraph returned EOF, finishing
[vf#0:0 @ 0x600003c3fc00] All consumers returned EOF
[vost#0:0/wrapped_avframe @ 0x1427086f0] Encoder thread received EOF
[vost#0:0/wrapped_avframe @ 0x1427086f0] Terminating thread with return code 0 (success)
[out#0/null @ 0x6000038200c0] All streams finished
[out#0/null @ 0x6000038200c0] Terminating thread with return code 0 (success)
[vf#0:0 @ 0x600003c3fc00] Terminating thread with return code 0 (success)
[out#0/null @ 0x6000038200c0] Output file #0 (pipe:):
[out#0/null @ 0x6000038200c0]   Output stream #0:0 (video): 20242 frames encoded; 20242 packets muxed (8906480 bytes); 
[out#0/null @ 0x6000038200c0]   Output stream #0:1 (audio): 16886 frames encoded (16210129 samples); 16886 packets muxed (64840516 bytes); 
[out#0/null @ 0x6000038200c0]   Total: 37128 packets (73746996 bytes) muxed
[out#0/null @ 0x6000038200c0] video:8698KiB audio:63321KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
frame=20242 fps= 26 q=-0.0 Lsize=N/A time=00:05:37.70 bitrate=N/A speed=0.428x    
bench: utime=128.096s stime=168.822s rtime=789.776s
bench: maxrss=1023180800KiB
[in#0/matroska,webm @ 0x600003120000] Input file #0 (Peru 8K HDR 60FPS (FUHD)._original.webm):
[in#0/matroska,webm @ 0x600003120000]   Input stream #0:0 (video): 20242 packets read (891630451 bytes); 20242 frames decoded; 0 decode errors; 
[in#0/matroska,webm @ 0x600003120000]   Input stream #0:1 (audio): 16886 packets read (5429762 bytes); 16886 frames decoded; 0 decode errors (16210129 samples); 
[in#0/matroska,webm @ 0x600003120000]   Total: 37128 packets (897060213 bytes) demuxed
[AVIOContext @ 0x142704080] Statistics: 897342641 bytes read, 0 seeks

real	13m9.962s
user	2m8.230s
sys	2m48.858s
low-batt@gag ffmpeg (master $%=)$ 

Attachments (1)

ffmpeg-20240412-153817.log (147.5 KB ) - added by low-batt 7 months ago.
FFmpeg report from test run

Download all attachments as: .zip

Change History (5)

by low-batt, 7 months ago

Attachment: ffmpeg-20240412-153817.log added

FFmpeg report from test run

comment:1 by ePirat, 6 months ago

This is a VT bug not an FFmpeg bug though? Should probably be reported to Apple.

comment:2 by ePirat, 6 months ago

Cc: ePirat added
Reproduced by developer: set

comment:3 by low-batt, 5 months ago

I just don't know the FFmpeg and Video Toolbox code well enough to say where the problem is. It would be good to prove that FFmpeg is properly using the Video Toolbox APIs in this case. It seems to be related to the 8K resolution. Do we know FFmpeg is properly handling buffers and not having Video Toolbox decode the same bytes multiple times? That kind of thing.

comment:4 by Tschuuuls, 5 months ago

This is also broken on M1 Pro, playing at 0.566x.
Safari doesn't have problems playing the same file at 2x speed without dropping frames. I think it uses Core Media (AVDFrameReceiver and com.apple.coremedia.videomediaconverter) instead of Video Toolbox to HW Decode the video.

Safari also plays the "Peru 8K HDR 60FPS (FUHD)._original.webm" file at <30% CPU load as reported by Activity Monitor while ffmpeg uses >40% in the benchmark while only managing 0.566x speed.

Maybe someone from the ffmpeg team should look into this and report it to Apple?

Note: See TracTickets for help on using tickets.