FFmpeg 预设
FFmpeg 是视频管线的执行层:负责从 RTSP/restream 读取音视频、解码、缩放并输出检测帧和录像段。预设(presets)用于把经过验证的一组参数封装成短名称,应优先使用预设而不是复制很长的自定义参数。
常见预设类型
- input preset:针对 RTSP/restream 等输入方式。
- hwaccel preset:Intel/AMD/NVIDIA 等硬件解码。
- record output preset:录像封装、音频转码或复制策略。
为什么优先用预设
预设除了简化配置,还能让 Securex 知道正在使用什么硬件能力,从而在缩放、Birdseye 编码等其他环节正确做优化。手写参数只有在明确知道摄像头/平台限制时才建议使用。
排错日志关键词
- 401/403:摄像头账号或 URL 编码。
- Connection refused / timeout:地址、端口、VLAN、防火墙。
- Invalid data / decode error:编码格式、码流损坏或硬件解码不匹配。
- Non-monotonous DTS / timestamp:摄像头时间戳异常,可能影响录像连续性。
建议
先用 go2rtc/ffprobe 证明源流稳定,再修改 Securex FFmpeg 参数。不要通过不断增加 reconnect 参数来掩盖根本的网络或摄像头固件问题。
Ffmpeg
FFmpeg is the execution layer of the video pipeline: it reads RTSP/restream media, decodes/scales it, and produces analysis frames and recording segments. Presets package tested argument sets and should be preferred over long copied argument strings.
Preset families
- Input presets for RTSP/restream behavior.
- Hardware-acceleration presets for Intel/AMD/NVIDIA.
- Recording-output presets for container/audio behavior.
Why presets
Presets simplify configuration and also tell Securex what hardware path is in use so other operations can be optimized correctly.
Useful log clues
- 401/403: credentials or URL encoding.
- Connection refused/timeout: address, port, VLAN, firewall.
- Invalid data/decode error: codec, damaged stream, or mismatched hwaccel.
- Timestamp/DTS warnings: camera timestamp quality and recording continuity.
Recommendation
Prove source stability in go2rtc/ffprobe before changing FFmpeg arguments. Do not hide camera/network problems behind endless reconnect options.
Guía: Ffmpeg
FFmpeg ejecuta el pipeline de vídeo: lee RTSP/restream, decodifica, escala y genera frames/segmentos. Los presets agrupan parámetros probados y son preferibles a largas cadenas copiadas.
Tipos de preset
- Entrada RTSP/restream.
- Aceleración Intel/AMD/NVIDIA.
- Salida de grabación/audio.
Por qué presets
Simplifican y permiten que Securex conozca la ruta de hardware para otras optimizaciones.
Pistas en logs
- 401/403: credenciales/URL.
- Timeout: red/puerto/firewall.
- Decode error: códec/stream/hwaccel.
- DTS/timestamps: reloj del stream y continuidad.
Consejo
Demuestre primero la estabilidad del origen con go2rtc/ffprobe.
