Skip to content

Commit

Permalink
remove deprecated recording commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jul 5, 2024
1 parent 8f72056 commit e7c002b
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions app/wyzebridge/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,41 +154,6 @@ def re_encode_video(uri: str, is_vertical: bool) -> list[str]:
)


def get_record_cmd(uri: str, audio_codec: str, record: bool = False) -> str:
"""
Check if recording is enabled and return an ffmpeg tee cmd.
Parameters:
- uri (str): uri of the stream used to lookup ENV parameters.
- audio_codec (str): used to determine the output container.
Returns:
- str: ffmpeg compatible str to be used for the tee command.
"""
if not record:
return ""
seg_time = env_bool("RECORD_LENGTH", "60")
file_name = "{CAM_NAME}_%Y-%m-%d_%H-%M-%S_%Z"
file_name = env_bool("RECORD_FILE_NAME", file_name, style="original").rstrip(".mp4")
format = "mp4" if audio_codec.lower() in {"aac", "libopus"} else "mov"
path = "/%s/" % env_bool(
f"RECORD_PATH_{uri}", env_bool("RECORD_PATH", "record/{CAM_NAME}")
).format(cam_name=uri.lower(), CAM_NAME=uri).strip("/")
os.makedirs(path, exist_ok=True)
logger.info(f"📹 Will record {seg_time}s clips to {path}")
return (
f"|[onfail=ignore:f=segment"
":bsfs/v=dump_extra=freq=keyframe"
f":segment_time={seg_time}"
":segment_atclocktime=1"
f":segment_format={format}"
":reset_timestamps=1"
":strftime=1"
":use_fifo=1]"
f"{path}{file_name.format(cam_name=uri.lower(),CAM_NAME=uri)}.mp4"
)


def get_livestream_cmd(uri: str) -> str:
"""
Check if livestream is enabled and return ffmpeg tee cmd.
Expand Down

0 comments on commit e7c002b

Please sign in to comment.