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

feat: Log configs #225

Merged
merged 1 commit into from
Jan 15, 2025
Merged
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
15 changes: 15 additions & 0 deletions shaka-streamer
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ https://shaka-project.github.io/shaka-streamer/
"""

import argparse
import json
import sys
import time
import yaml
Expand Down Expand Up @@ -84,6 +85,12 @@ See docs: https://shaka-project.github.io/shaka-streamer/cloud_storage.html
help='Use FFmpeg, FFprobe and Shaka Packager binaries ' +
'found in PATH instead of the ones offered by ' +
'Shaka Streamer.')
parser.add_argument('--log-configs',
action='store_true',
help='Log simplified versions of the config files to ' +
'stderr. May be useful in services, to look at ' +
'logs later to understand when configs changed, ' +
'and how they may have impacted performance.')

args = parser.parse_args()

Expand All @@ -100,6 +107,14 @@ See docs: https://shaka-project.github.io/shaka-streamer/cloud_storage.html
with open(args.bitrate_config) as f:
bitrate_config_dict = yaml.safe_load(f)

if args.log_configs:
configs = {
'input': input_config_dict,
'pipeline': pipeline_config_dict,
'bitrate': bitrate_config_dict,
}
print('Configs: {}'.format(json.dumps(configs)), file=sys.stderr)

try:
if args.cloud_url:
print('Warning: -c/--cloud-url is deprecated; use -o/--output instead',
Expand Down
Loading