mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 15:15:22 +03:00
Update docs
This commit is contained in:
parent
95800ad1e3
commit
2f5b8aaa37
@ -162,15 +162,15 @@ listen [::]:5000 ipv6only=off;
|
||||
|
||||
### Custom ffmpeg build
|
||||
|
||||
Included with Frigate is a build of ffmpeg that works for the vast majority of users. However, there exists some hardware setups which have incompatibilities with the included build. In this case, a docker volume mapping can be used to overwrite the included ffmpeg build with an ffmpeg build that works for your specific hardware setup.
|
||||
Included with Frigate is a build of ffmpeg that works for the vast majority of users. However, there exists some hardware setups which have incompatibilities with the included build. In this case, statically built ffmpeg binary can be downloaded to /config and used.
|
||||
|
||||
To do this:
|
||||
|
||||
1. Download your ffmpeg build and uncompress to a folder on the host (let's use `/home/appdata/frigate/custom-ffmpeg` for this example).
|
||||
1. Download your ffmpeg build and uncompress to the Frigate config folder.
|
||||
2. Update your docker-compose or docker CLI to include `'/home/appdata/frigate/custom-ffmpeg':'/usr/lib/btbn-ffmpeg':'ro'` in the volume mappings.
|
||||
3. Restart Frigate and the custom version will be used if the mapping was done correctly.
|
||||
|
||||
NOTE: The folder that is mapped from the host needs to be the folder that contains `/bin`. So if the full structure is `/home/appdata/frigate/custom-ffmpeg/bin/ffmpeg` then `/home/appdata/frigate/custom-ffmpeg` needs to be mapped to `/usr/lib/btbn-ffmpeg`.
|
||||
NOTE: The folder that is set for the config needs to be the folder that contains `/bin`. So if the full structure is `/home/appdata/frigate/custom-ffmpeg/bin/ffmpeg` then the `ffmpeg -> path` field should be `/config/custom-ffmpeg/bin`.
|
||||
|
||||
### Custom go2rtc version
|
||||
|
||||
|
||||
@ -278,7 +278,9 @@ def submit_recording_snapshot_to_plus(camera_name: str, frame_time: str):
|
||||
config: FrigateConfig = current_app.frigate_config
|
||||
recording: Recordings = recording_query.get()
|
||||
time_in_segment = frame_time - recording.start_time
|
||||
image_data = get_image_from_recording(config.ffmpeg, recording.path, time_in_segment, "png")
|
||||
image_data = get_image_from_recording(
|
||||
config.ffmpeg, recording.path, time_in_segment, "png"
|
||||
)
|
||||
|
||||
if not image_data:
|
||||
return make_response(
|
||||
@ -481,7 +483,7 @@ def recording_clip(camera_name, start_ts, end_ts):
|
||||
|
||||
if not os.path.exists(path):
|
||||
ffmpeg_cmd = [
|
||||
config.ffmpeg.executable_path,
|
||||
config.ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-y",
|
||||
"-protocol_whitelist",
|
||||
@ -1148,7 +1150,7 @@ def preview_gif(camera_name: str, start_ts, end_ts, max_cache_age=2592000):
|
||||
seconds = int(diff % 60)
|
||||
config: FrigateConfig = current_app.frigate_config
|
||||
ffmpeg_cmd = [
|
||||
config.ffmpeg.executable_path,
|
||||
config.ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-loglevel",
|
||||
"warning",
|
||||
@ -1215,7 +1217,7 @@ def preview_gif(camera_name: str, start_ts, end_ts, max_cache_age=2592000):
|
||||
config: FrigateConfig = current_app.frigate_config
|
||||
|
||||
ffmpeg_cmd = [
|
||||
config.ffmpeg.executable_path,
|
||||
config.ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-loglevel",
|
||||
"warning",
|
||||
@ -1310,7 +1312,7 @@ def preview_mp4(camera_name: str, start_ts, end_ts, max_cache_age=604800):
|
||||
seconds = int(diff % 60)
|
||||
config: FrigateConfig = current_app.frigate_config
|
||||
ffmpeg_cmd = [
|
||||
config.ffmpeg.executable_path,
|
||||
config.ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-loglevel",
|
||||
"warning",
|
||||
@ -1375,7 +1377,7 @@ def preview_mp4(camera_name: str, start_ts, end_ts, max_cache_age=604800):
|
||||
config: FrigateConfig = current_app.frigate_config
|
||||
|
||||
ffmpeg_cmd = [
|
||||
config.ffmpeg.executable_path,
|
||||
config.ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-loglevel",
|
||||
"warning",
|
||||
|
||||
@ -886,7 +886,7 @@ class FfmpegConfig(FrigateBaseModel):
|
||||
)
|
||||
|
||||
@property
|
||||
def executable_path(self) -> str:
|
||||
def ffmpeg_path(self) -> str:
|
||||
if self.path == "default":
|
||||
if int(os.getenv("LIBAVFORMAT_VERSION_MAJOR", "59")) >= 59:
|
||||
return "/usr/lib/ffmpeg/7.0/bin/ffmpeg"
|
||||
@ -897,8 +897,7 @@ class FfmpegConfig(FrigateBaseModel):
|
||||
elif self.path == "5.0":
|
||||
return "/usr/lib/ffmpeg/5.0/bin/ffmpeg"
|
||||
else:
|
||||
return self.path
|
||||
|
||||
return f"{self.path}/bin/ffmpeg"
|
||||
|
||||
|
||||
class CameraRoleEnum(str, Enum):
|
||||
|
||||
@ -50,7 +50,7 @@ def get_ffmpeg_command(ffmpeg: FfmpegConfig) -> list[str]:
|
||||
or get_ffmpeg_arg_list(ffmpeg.input_args)
|
||||
)
|
||||
return (
|
||||
[ffmpeg.executable_path, "-vn", "-threads", "1"]
|
||||
[ffmpeg.ffmpeg_path, "-vn", "-threads", "1"]
|
||||
+ input_args
|
||||
+ ["-i"]
|
||||
+ [ffmpeg_input.path]
|
||||
|
||||
@ -133,7 +133,7 @@ class FFMpegConverter(threading.Thread):
|
||||
self.recreate_birdseye_pipe()
|
||||
|
||||
ffmpeg_cmd = [
|
||||
ffmpeg.executable_path,
|
||||
ffmpeg.ffmpeg_path,
|
||||
"-threads",
|
||||
"1",
|
||||
"-f",
|
||||
|
||||
@ -31,7 +31,7 @@ class FFMpegConverter(threading.Thread):
|
||||
self.stop_event = stop_event
|
||||
|
||||
ffmpeg_cmd = [
|
||||
ffmpeg.executable_path,
|
||||
ffmpeg.ffmpeg_path,
|
||||
"-threads",
|
||||
"1",
|
||||
"-f",
|
||||
|
||||
@ -116,7 +116,7 @@ class RecordingExporter(threading.Thread):
|
||||
minutes = int(diff / 60)
|
||||
seconds = int(diff % 60)
|
||||
ffmpeg_cmd = [
|
||||
self.config.ffmpeg.executable_path,
|
||||
self.config.ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-loglevel",
|
||||
"warning",
|
||||
@ -286,7 +286,7 @@ def migrate_exports(ffmpeg: FfmpegConfig, camera_names: list[str]):
|
||||
) # use jpg because webp encoder can't get quality low enough
|
||||
|
||||
ffmpeg_cmd = [
|
||||
ffmpeg.executable_path,
|
||||
ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-loglevel",
|
||||
"warning",
|
||||
|
||||
@ -387,7 +387,7 @@ class RecordingMaintainer(threading.Thread):
|
||||
|
||||
# add faststart to kept segments to improve metadata reading
|
||||
p = await asyncio.create_subprocess_exec(
|
||||
self.config.ffmpeg.executable_path,
|
||||
self.config.ffmpeg.ffmpeg_path,
|
||||
"-hide_banner",
|
||||
"-y",
|
||||
"-i",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user