Skip to content

NVR with realtime local object detection for IP cameras

Adjust audio striping (#24161)

Nicolas Mowen2117b58ababb
diff --git a/docs/docs/configuration/record.md b/docs/docs/configuration/record.md
index 49abd75e06..93d26d8801 100644
--- a/docs/docs/configuration/record.md
+++ b/docs/docs/configuration/record.md
@@ -291,7 +291,7 @@ For advanced use cases, the [custom export HTTP API](../integrations/api/export-
POST /export/custom/{camera_name}/start/{start_time}/end/{end_time}
```
-The request body accepts `ffmpeg_input_args` and `ffmpeg_output_args` to control encoding, frame rate, filters, and other FFmpeg options. If neither is provided, Frigate defaults to time-lapse output settings (25x speed, 30 FPS).
+The request body accepts `ffmpeg_input_args` and `ffmpeg_output_args` to control encoding, frame rate, filters, and other FFmpeg options. If neither is provided, Frigate defaults to time-lapse output settings (25x speed, 30 FPS) with audio removed (`-an`). When providing your own `ffmpeg_input_args`, include `-an` if you want audio stripped from the export.
The following example exports a time-lapse at 60x speed with 25 FPS:
diff --git a/frigate/api/export.py b/frigate/api/export.py
index 6a4a6d5041..817dbe7ba8 100644
--- a/frigate/api/export.py
+++ b/frigate/api/export.py
@@ -69,6 +69,7 @@ from frigate.jobs.export import (
from frigate.models import Export, ExportCase, Previews, Recordings
from frigate.record.export import (
DEFAULT_TIME_LAPSE_FFMPEG_ARGS,
+ DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS,
ChaptersEnum,
PlaybackSourceEnum,
validate_ffmpeg_args,
@@ -1012,7 +1013,7 @@ def export_recording_custom(
# Set default values if not provided (timelapse defaults)
if ffmpeg_input_args is None:
- ffmpeg_input_args = ""
+ ffmpeg_input_args = DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS
if ffmpeg_output_args is None:
ffmpeg_output_args = DEFAULT_TIME_LAPSE_FFMPEG_ARGS
diff --git a/frigate/record/export.py b/frigate/record/export.py
index 5d307077c9..00addda124 100644
--- a/frigate/record/export.py
+++ b/frigate/record/export.py
@@ -36,8 +36,9 @@ from frigate.util.time import is_current_hour
logger = logging.getLogger(__name__)
+DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS = "-an"
DEFAULT_TIME_LAPSE_FFMPEG_ARGS = "-vf setpts=0.04*PTS -r 30"
-TIMELAPSE_DATA_INPUT_ARGS = "-an -skip_frame nokey"
+TIMELAPSE_DATA_INPUT_ARGS = "-skip_frame nokey"
# Matches the setpts factor used in timelapse exports (e.g. setpts=0.04*PTS).
# Captures the floating-point factor so we can scale expected duration.
@@ -737,7 +738,7 @@ class RecordingExporter(threading.Thread):
parse_preset_hardware_acceleration_encode(
self.config.ffmpeg.ffmpeg_path,
hwaccel_args,
- f"{self.ffmpeg_input_args} -an {ffmpeg_input}".strip(),
+ f"{self.ffmpeg_input_args} {ffmpeg_input}".strip(),
f"{self.ffmpeg_output_args} -movflags +faststart".strip(),
EncodeTypeEnum.timelapse,
)