-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for specifying output file format and audio sync option #2774
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
Conversation
|
Thanks for the contribution @lcapriotti, this looks like a good idea. I recommend changing the option to |
Co-Authored-By: beardypig <beardypig@protonmail.com>
Co-Authored-By: beardypig <beardypig@protonmail.com>
Co-Authored-By: beardypig <beardypig@protonmail.com>
Co-Authored-By: beardypig <beardypig@protonmail.com>
Co-Authored-By: beardypig <beardypig@protonmail.com>
|
Co-Authored-By: beardypig <beardypig@protonmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2774 +/- ##
==========================================
- Coverage 52.87% 52.69% -0.18%
==========================================
Files 246 251 +5
Lines 15428 15748 +320
==========================================
+ Hits 8157 8298 +141
- Misses 7271 7450 +179 |
Co-Authored-By: beardypig <beardypig@protonmail.com>
| metadata = options.pop("metadata", {}) | ||
| maps = options.pop("maps", []) | ||
| copyts = options.pop("copyts", False) | ||
| start_at_zero = session.options.get("ffmpeg-start-at-zero", True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeError: get() takes 2 positional arguments but 3 were given
there is no default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should extend Options to support a default, easy to do without making any breaking changes.
diff --git a/src/streamlink/options.py b/src/streamlink/options.py
index 5a208c16..0f442d48 100644
--- a/src/streamlink/options.py
+++ b/src/streamlink/options.py
@@ -33,10 +33,11 @@ class Options(object):
def set(self, key, value):
self.options[_normalise_option_name(key)] = value
- def get(self, key):
+ def get(self, key, default=None):
key = _normalise_option_name(key)
if key in self.options:
return self.options[key]
+ return default
def update(self, options):
for key, value in options.items():
The change is introducing two new optional cmdline options:
--ffmpeg-fout: The output file format when muxing with ffmpeg
--ffmpeg-start-at-zero: When used with ffmpeg and copyts, shift input timestamps so they start at zero
Both options defaults are keeping the predefined values, hence backwards compatibility is enforced.