跳到主要内容

FFmpeg 预设

默认情况下,FFmpeg 会提供一些参数预设,以方便配置。所有预置可在 ffmpeg_presets.py 中查看。

Hwaccel 预设

强烈建议在配置中使用 hwaccel 预设值。这些预设不仅能取代较长的参数,还能为 Frigate 提供可用硬件的提示,并允许 Frigate 使用 GPU 进行其他优化,例如在编码鸟瞰 restream 或缩放大小不同于原始流大小的流时。

hwaccel 文档以获取更多有关如何为 GPU / iGPU 设置 hwaccel 的信息。

PresetUsageOther Notes
preset-rpi-64-h26464 bit Rpi with h264 stream
preset-rpi-64-h26564 bit Rpi with h265 stream
preset-vaapiIntel & AMD VAAPICheck hwaccel docs to ensure correct driver is chosen
preset-intel-qsv-h264Intel QSV with h264 streamIf issues occur recommend using vaapi preset instead
preset-intel-qsv-h265Intel QSV with h265 streamIf issues occur recommend using vaapi preset instead
preset-nvidia-h264Nvidia GPU with h264 stream
preset-nvidia-h265Nvidia GPU with h265 stream
preset-nvidia-mjpegNvidia GPU with mjpeg streamRecommend restreaming mjpeg and using nvidia-h264
preset-jetson-h264Nvidia Jetson with h264 stream
preset-jetson-h265Nvidia Jetson with h265 stream
preset-rk-h264Rockchip MPP with h264 streamUse image with *-rk suffix and privileged mode
preset-rk-h265Rockchip MPP with h265 streamUse image with *-rk suffix and privileged mode

输入参数预设

输入参数预设有助于提高配置的可读性,并处理不同类型数据流的用例,以确保最大的兼容性。

有关非标准摄像机的更多信息以及在 Frigate 中使用它们的建议,请参阅摄像机专用配置

PresetUsageOther Notes
preset-http-jpeg-genericHTTP Live JpegRecommend restreaming live jpeg instead
preset-http-mjpeg-genericHTTP Mjpeg StreamRecommend restreaming mjpeg stream instead
preset-http-reolinkReolink HTTP-FLV StreamOnly for reolink http, not when restreaming as rtsp
preset-rtmp-genericRTMP Stream
preset-rtsp-genericRTSP StreamThis is the default when nothing is specified
preset-rtsp-restreamRTSP Stream from restreamUse for rtsp restream as source for Frigate
preset-rtsp-restream-low-latencyRTSP Stream from restreamUse for rtsp restream as source for Frigate to lower latency, may cause issues with some cameras
preset-rtsp-udpRTSP Stream via UDPUse when camera is UDP only
preset-rtsp-blue-irisBlue Iris RTSP StreamUse when consuming a stream from Blue Iris
警告

使用 restream 时必须注意输入参数,因为可以混合使用多种协议。httprtmp 预置不能与 rtsp 流一起使用。例如,当使用 rtsp restream 作为录像源的 reolink cam 时,preset-http-reolink 会导致崩溃。在这种情况下,需要在流级别设置预置。请参阅下面的示例。

go2rtc:
streams:
reolink_cam: http://192.168.0.139/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=password

cameras:
reolink_cam:
ffmpeg:
inputs:
- path: http://192.168.0.139/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=password
input_args: preset-http-reolink
roles:
- detect
- path: rtsp://127.0.0.1:8554/reolink_cam
input_args: preset-rtsp-generic
roles:
- record

输出参数预设

输出参数预设有助于提高配置的可读性,并处理不同类型流的用例,以确保录像的一致性。

PresetUsageOther Notes
preset-record-genericRecord WITHOUT audioThis is the default when nothing is specified
preset-record-generic-audio-copyRecord WITH original audioUse this to enable audio in recordings
preset-record-generic-audio-aacRecord WITH transcoded aac audioUse this to transcode to aac audio. If your source is already aac, use preset-record-generic-audio-copy instead to avoid re-encoding
preset-record-mjpegRecord an mjpeg streamRecommend restreaming mjpeg stream instead
preset-record-jpegRecord live jpegRecommend restreaming live jpeg instead
preset-record-ubiquitiRecord ubiquiti stream with audioRecordings with ubiquiti non-standard audio