Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support passing encode argument for RequestSetLiveStreamMode #604

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ async def set_livestream_mode(
minimum_bitrate: int,
maximum_bitrate: int,
starting_bitrate: int,
encode: bool,
window_size: proto.EnumWindowSize.ValueType | None = None,
lens: proto.EnumLens.ValueType | None = None,
certs: list[Path] | None = None,
Expand All @@ -674,6 +675,7 @@ async def set_livestream_mode(
minimum_bitrate (int): Desired minimum streaming bitrate (>= 800)
maximum_bitrate (int): Desired maximum streaming bitrate (<= 8000)
starting_bitrate (int): Initial streaming bitrate (honored if 800 <= value <= 8000)
encode (bool): Whether to save media to sdcard while streaming.
window_size (proto.EnumWindowSize.ValueType | None): Streaming video resolution. Defaults to None (use camera default).
lens (proto.EnumLens.ValueType | None): Streaming Field of View. Defaults to None (use camera default).
certs (list[Path] | None): list of certificates to use. Defaults to None.
Expand All @@ -683,7 +685,7 @@ async def set_livestream_mode(
"""
d = {
"url": url,
"encode": True,
"encode": encode,
"minimum_bitrate": minimum_bitrate,
"maximum_bitrate": maximum_bitrate,
"starting_bitrate": starting_bitrate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async def wait_for_livestream_start(_: Any, update: proto.NotifyLiveStreamStatus
minimum_bitrate=args.min_bit,
maximum_bitrate=args.max_bit,
starting_bitrate=args.start_bit,
encode=args.encode,
lens=args.fov,
)

Expand Down Expand Up @@ -79,6 +80,8 @@ def parse_arguments() -> argparse.Namespace:
parser.add_argument(
"--fov", help="Field of View.", choices=list(proto.EnumLens.values()), default=None, type=int # type: ignore
)
parser.add_argument("--encode", help="Save video to sdcard.", action=argparse.BooleanOptionalAction)
parser.set_defaults(encode=True)
return add_cli_args_and_parse(parser, wifi=False)


Expand Down