mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-06 06:42:51 +03:00
Adjust audio striping (#24161)
This commit is contained in:
@@ -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}
|
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:
|
The following example exports a time-lapse at 60x speed with 25 FPS:
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ from frigate.jobs.export import (
|
|||||||
from frigate.models import Export, ExportCase, Previews, Recordings
|
from frigate.models import Export, ExportCase, Previews, Recordings
|
||||||
from frigate.record.export import (
|
from frigate.record.export import (
|
||||||
DEFAULT_TIME_LAPSE_FFMPEG_ARGS,
|
DEFAULT_TIME_LAPSE_FFMPEG_ARGS,
|
||||||
|
DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS,
|
||||||
ChaptersEnum,
|
ChaptersEnum,
|
||||||
PlaybackSourceEnum,
|
PlaybackSourceEnum,
|
||||||
validate_ffmpeg_args,
|
validate_ffmpeg_args,
|
||||||
@@ -1012,7 +1013,7 @@ def export_recording_custom(
|
|||||||
|
|
||||||
# Set default values if not provided (timelapse defaults)
|
# Set default values if not provided (timelapse defaults)
|
||||||
if ffmpeg_input_args is None:
|
if ffmpeg_input_args is None:
|
||||||
ffmpeg_input_args = ""
|
ffmpeg_input_args = DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS
|
||||||
|
|
||||||
if ffmpeg_output_args is None:
|
if ffmpeg_output_args is None:
|
||||||
ffmpeg_output_args = DEFAULT_TIME_LAPSE_FFMPEG_ARGS
|
ffmpeg_output_args = DEFAULT_TIME_LAPSE_FFMPEG_ARGS
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ from frigate.util.time import is_current_hour
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS = "-an"
|
||||||
DEFAULT_TIME_LAPSE_FFMPEG_ARGS = "-vf setpts=0.04*PTS -r 30"
|
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).
|
# 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.
|
# Captures the floating-point factor so we can scale expected duration.
|
||||||
@@ -737,7 +738,7 @@ class RecordingExporter(threading.Thread):
|
|||||||
parse_preset_hardware_acceleration_encode(
|
parse_preset_hardware_acceleration_encode(
|
||||||
self.config.ffmpeg.ffmpeg_path,
|
self.config.ffmpeg.ffmpeg_path,
|
||||||
hwaccel_args,
|
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(),
|
f"{self.ffmpeg_output_args} -movflags +faststart".strip(),
|
||||||
EncodeTypeEnum.timelapse,
|
EncodeTypeEnum.timelapse,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user