Closed xswqaz closed 4 years ago
works as intended here with git master. make sure your file can actually be decoded by videotoolbox. other than this try with master and provide an example file.
How can I get binary for Mac OSX?
Your file is playing with hwaccel certainly videotoolbox seems only activated on specific format Could you check this file?
your file works for me too with videotoolbox. though i have older hardware, macbook pro mid 2010 with an nvidia gt330m. same macOS version.
Here is mac mini 2014 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz HD 5000 and No additional gpu
Even though, No problem with QuickTime X ( Low cpu usage) ffmpeg problem?
i don't know. maybe try with mpv --no-config --hwdec=auto
. maybe a log with --log-file=PATH
might help.
It was success to decode hwaccel with 720p, But failed with 1080p
720p (High@L3.2)
[ 0.650][v][vd] Pixel formats supported by decoder: videotoolbox_vld yuv420p
[ 0.650][v][vd] Codec profile: High (0x64)
[ 0.650][v][vd] Requesting pixfmt 'videotoolbox_vld' from decoder.
[ 0.921][d][ffmpeg/video] h264: Reinit context to 1280x720, pix_fmt: videotoolbox_vld
[ 0.945][i][vd] Using hardware decoding (videotoolbox).
[ 0.945][v][vd] Decoder format: 1280x720 videotoolbox[nv12] auto/auto/auto/auto CL=mpeg2/4/h264 (auto 0.000000/0.000000/0.000000)
[ 0.946][v][vf] Video filter chain:
[ 0.946][v][vf] [in] 1280x720 videotoolbox[nv12] bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264
[ 0.946][v][vf] [out] 1280x720 videotoolbox[nv12] bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264
[ 0.946][i][cplayer] VO: [gpu] 1280x720 videotoolbox[nv12]
[ 0.946][v][cplayer] VO: Description: Shader-based GPU Renderer
1080p(High@L4)
[ 0.708][v][vd] Pixel formats supported by decoder: videotoolbox_vld yuv420p
[ 0.708][v][vd] Codec profile: High (0x64)
[ 0.708][v][vd] Requesting pixfmt 'videotoolbox_vld' from decoder.
[ 0.790][d][ffmpeg/video] h264: VideoToolbox session not available.
[ 0.790][e][ffmpeg/video] h264: Failed setup for format videotoolbox_vld: hwaccel initialisation returned er
ror.
[ 0.790][v][vd] Pixel formats supported by decoder: yuv420p yuv420p
[ 0.790][v][vd] Codec profile: High (0x64)
[ 0.790][v][vd] Requesting pixfmt 'yuv420p' from decoder.
[ 0.790][d][ffmpeg/video] h264: Reinit context to 1920x1088, pix_fmt: yuv420p
[ 0.828][v][vd] Falling back to software decoding.
[ 0.828][v][vd] Detected 4 logical cores.
[ 0.828][v][vd] Requesting 5 threads for decoding.
[ 0.833][d][ffmpeg/video] h264: Reinit context to 1920x1088, pix_fmt: yuv420p
[ 0.877][v][vd] Using software decoding.
[ 0.878][v][vd] Decoder format: 1920x1080 yuv420p auto/auto/auto/auto CL=mpeg2/4/h264 (auto 0.000000/0.000000/0.000000)
[ 0.878][v][vf] Video filter chain:
[ 0.878][v][vf] [in] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264
[ 0.878][v][vf] [out] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264
[ 0.879][i][cplayer] VO: [gpu] 1920x1080 yuv420p
[ 0.879][v][cplayer] VO: Description: Shader-based GPU Renderer
What means "h264: VideoToolbox session not available."? I don't know why 1080p file detected as 1920x1088
i believe that means that videotoolbox was used by another process at the time you tried it. no your file is not detected to be 1920x1088, just the context is that size. also no idea what you are trying to prove with the 720p sample, since you tried my 1080p file and it worked.
There is no process use videotoolbox except mpv. (No execution difference between 720 and 1080)
that's what the error says though and that one is returned by the Framework via kVTVideoDecoderNotAvailableNowErr (Apple Doc).
videotoolbox can be a bit picky. try it several times and see if it always fails at [ffmpeg/video] h264: VideoToolbox session not available
. for testing try to close every other App, especially browsers, since they could use it in the background. try VLC for testing, they use their own videotoolbox implementation and not the ffmpeg one i believe(?). if theirs work something isn't working correctly and i would say it's probably a problem with ffmpeg then.
Does VLC have a log? When you try to assess whether hwdec is running, please don't use CPU usage. This is not reliable as swdec for h264 is so good these days that it doesn't create noticeable load for most videos.
I tried VLC 3.0.1. and decoded with hwaccel no problem CPU usage is very stable (less than 5%) When I played same file with mpv, CPU usage over 10%
main debug: looking for video decoder module matching "any": 14 candidates
videotoolbox debug: new SPS parsed: 0
videotoolbox debug: new PPS parsed: 0
videotoolbox info: Using Video Toolbox to decode 'h264'
main debug: using video decoder module "videotoolbox"
main debug: looking for audio decoder module matching "any": 21 candidates
main debug: using audio decoder module "faad"
main debug: looking for meta reader module matching "any": 2 candidates
main debug: using meta reader module "taglib"
main debug: removing module "taglib"
main debug: `file:///Volumes/hdd/sample.mp4' successfully opened
mp4 debug: elst (0) gives 0ms (movie)-> 33ms (track)
mp4 debug: track[Id 0x1] using Sync Sample Box (stss)
mp4 debug: stss gives 1 --> 0 (sample number)
mp4 debug: elst (0) gives 0ms (movie)-> 0ms (track)
main debug: Buffering 0%
faad warning: Channel coupling not yet implemented
main debug: Buffering 25%
main debug: Buffering 50%
faad warning: decoded zero sample
main debug: reusing audio output
main debug: VLC is looking for: 'f32l' 48000 Hz Stereo frame=1 samples/8 bytes
auhal debug: attempting to use device 0
auhal debug: using default audio device 39
main debug: Buffering 75%
main debug: Buffering 100%
auhal debug: output layout of AUHAL is Stereo
auhal debug: selected 2 physical channels for device output
auhal debug: VLC will output: Stereo
auhal debug: Current AU format: [48000.000000][mcpl][9][8][1][8][2][32]
auhal debug: Current device has a latency of 0 us
auhal debug: analog output successfully opened
main debug: output 'f32l' 48000 Hz Stereo frame=1 samples/8 bytes
main debug: looking for audio volume module matching "any": 2 candidates
main debug: using audio volume module "float_mixer"
main debug: input 'f32l' 48000 Hz Stereo frame=1 samples/8 bytes
main debug: looking for audio filter module matching "scaletempo": 16 candidates
scaletempo debug: format: 48000 rate, 2 nch, 4 bps, fl32
scaletempo debug: params: 30 stride, 0.200 overlap, 14 search
scaletempo debug: 1.000 scale, 1440.000 stride_in, 1440 stride_out, 1152 standing, 288 overlap, 672 search, 2400 queue, fl32 mode
main debug: using audio filter module "scaletempo"
main debug: conversion: 'f32l'->'f32l' 48000 Hz->48000 Hz Stereo->Stereo
main debug: conversion pipeline complete
main debug: conversion: 'f32l'->'f32l' 48000 Hz->48000 Hz Stereo->Stereo
main debug: conversion pipeline complete
main debug: looking for audio resampler module matching "any": 3 candidates
main debug: using audio resampler module "samplerate"
main debug: Stream buffering done (1250 ms in 13 ms)
videotoolbox info: vt cvpx chroma: BGRA
main debug: looking for text renderer module matching "any": 3 candidates
main debug: using text renderer module "freetype"
main debug: looking for video converter module matching "any": 22 candidates
swscale debug: 32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bicubic (good quality)
main debug: using video converter module "swscale"
main debug: looking for video converter module matching "any": 22 candidates
yuvp debug: YUVP to YUVA converter
main debug: using video converter module "yuvp"
main debug: Deinterlacing available
main debug: deinterlace -1, mode auto, is_needed 0
main debug: looking for vout window module matching "any": 1 candidates
macosx debug: Opening video window
macosx debug: Activated assertion NoIdleSleepAssertion through IOKit (38114)
macosx debug: Releasing old IOKit other assertion (38114)
macosx debug: Activated assertion NoDisplaySleepAssertion through IOKit (38115)
macosx debug: toggle playlist from state: removed splitview 0, minimized view 0. Event 2
macosx debug: toggle playlist to state: removed splitview 0, minimized view 0
macosx debug: returning videoview with proposed position x=0, y=0, width=1920, height=1080
main debug: using vout window module "macosx"
main debug: Opening vout display wrapper
main debug: looking for vout display module matching "any": 7 candidates
main debug: VoutDisplayEvent 'resize' 1920x1080
main debug: looking for glconv module matching "any": 1 candidates
main debug: using glconv module "glconv_cvpx"
main debug: VoutDisplayEvent 'resize' 1920x1080
main debug: using vout display module "macosx"
main debug: VoutDisplayEvent 'resize' 716x529
main debug: original format sz 1920x1088, of (0,0), vsz 1920x1080, 4cc CVPB, sar 1:1, msk r0x0 g0x0 b0x0
main debug: removing module "freetype"
main debug: looking for text renderer module matching "any": 3 candidates
main debug: using text renderer module "freetype"
main debug: Received first picture
videotoolbox info: Raising max DPB to 2
main debug: Decoder wait done in 96 ms
main debug: inserting 1414 zeroes
then you should try again with mpv master and ffmpeg master. if the problem still persists it's most likely an ffmpeg problem.
i reported this issue to ffmpeg https://trac.ffmpeg.org/ticket/7545.
I've similar issue (not able to use HW acceleration) in Mojave Mac Pro 5,1 with GTX 680. Below are the error: [vd] Pixel formats supported by decoder: videotoolbox_vld yuv420p [vd] Codec profile: Main (0x4d) [vd] Requesting pixfmt 'videotoolbox_vld' from decoder. [ffmpeg/video] h264: Failed setup for format videotoolbox_vld: hwaccel initialisation returned error.
However, I didn't have the following error [ffmpeg/video] h264: VideoToolbox session not available.
Let me know if I should report it as different bug.
if you can reproduce it with ffmpeg then reporting it to ffmpeg would be a good idea.
reported to ffmpeg.
mpv version and platform
Reproduction steps
mpv sample.mp4
mpv.conf
Expected behavior
hwaccel decode
Actual behavior
Failed to hwaccel decode
Log file
Sample files