Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FFmpeg hardware detection for macOS #413

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

skrashevich
Copy link
Contributor

updates the video toolbox probe commands in hardware_darwin.go to utilize SVGA resolution, because of QVGA isn'r supported by videotoolbox h264 encoder on macOS systems and always fails. The changes affect both the H264 and H265 codec probe commands.

@AlexxIT
Copy link
Owner

AlexxIT commented May 5, 2023

They not fail on mine M1. On what systems they failing?

@skrashevich
Copy link
Contributor Author

MacBook Pro custom config:
2,8 GHz 4‑core Intel Core i7
Radeon Pro 555 2 ГБ
Intel HD Graphics 630 1536 МБ
16 ГБ 2133 MHz LPDDR3
macOS 13.3 (22E252)

svk@MacBook-Pro-Sergei ~ % ffmpeg -hide_banner -f lavfi -i testsrc2 -t 1 -c h264_videotoolbox -f null -
Input #0, lavfi, from 'testsrc2':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_videotoolbox))
Press [q] to stop, [?] for help
[h264_videotoolbox @ 0x7f9572706840] Error: cannot create compression session: -12903
[h264_videotoolbox @ 0x7f9572706840] Try -allow_sw 1. The hardware encoder may be busy, or not supported.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
svk@MacBook-Pro-Sergei ~ % ffmpeg -hide_banner -f lavfi -i testsrc2 -t 1 -c hevc_videotoolbox -f null -
Input #0, lavfi, from 'testsrc2':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (hevc_videotoolbox))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf59.27.100
  Stream #0:0: Video: hevc, yuv420p(progressive), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn
    Metadata:
      encoder         : Lavc59.37.100 hevc_videotoolbox
[hevc_videotoolbox @ 0x7ff526007b00] Color range not set for yuv420p. Using MPEG range.
frame=   25 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.00 bitrate=N/A speed=2.26x    
video:43kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

@AlexxIT AlexxIT merged commit ba68bcb into AlexxIT:master Jun 15, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jun 15, 2023

Thanks!

@AlexxIT AlexxIT changed the title Refactor video toolbox probe commands to use SVGA resolution in hardw… Update FFmpeg hardware detection for macOS Jul 11, 2023
@AlexxIT AlexxIT added this to the v1.6.0 milestone Jul 11, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jul 11, 2023

@skrashevich skrashevich deleted the 230504-patch-hwdetect-darwin branch August 23, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants