mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-04 16:02:43 +08:00
22 lines
412 B
Go
22 lines
412 B
Go
package ffmpeg
|
|
|
|
func ProbeHardware(name string) string {
|
|
switch name {
|
|
case "h264":
|
|
if run(
|
|
"-f", "lavfi", "-i", "testsrc2", "-t", "1",
|
|
"-c", "h264_videotoolbox", "-f", "null", "-") {
|
|
return EngineVideoToolbox
|
|
}
|
|
|
|
case "h265":
|
|
if run(
|
|
"-f", "lavfi", "-i", "testsrc2", "-t", "1",
|
|
"-c", "hevc_videotoolbox", "-f", "null", "-") {
|
|
return EngineVideoToolbox
|
|
}
|
|
}
|
|
|
|
return EngineSoftware
|
|
}
|