-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for specifying output file format and audio sync option #2892
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
Co-Authored-By: beardypig <beardypig@protonmail.com>
I added some extensive changes that couldn't be done with suggestions. I added some tests and fixed some bugs that were exposed by the tests... |
87adc6c
to
4258da9
Compare
Replaces #2774 |
Codecov Report
@@ Coverage Diff @@
## master #2892 +/- ##
===========================================
- Coverage 63.91% 53.01% -10.90%
===========================================
Files 444 252 -192
Lines 20292 15783 -4509
Branches 2774 0 -2774
===========================================
- Hits 12969 8367 -4602
- Misses 6993 7416 +423
+ Partials 330 0 -330 |
src/streamlink/stream/ffmpegmux.py
Outdated
@@ -91,13 +91,14 @@ def __init__(self, session, *streams, **options): | |||
for stream, np in | |||
zip(self.streams, self.pipes)] | |||
|
|||
ofmt = options.pop("format", "matroska") | |||
ofmt = options.pop("format", session.options.get("ffmpeg-fout")) |
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.
the user command can't work because format
is not None
$ streamlink https://www.zdf.de/live-tv --ffmpeg-fout "matroska"
[stream.ffmpegmux][debug]
ffmpeg command: /usr/bin/ffmpeg -nostats -y
-i /tmp/ffmpeg-8930-729 -i /tmp/ffmpeg-8930-644
-c:v copy -c:a copy -map 0:v? -map 0:a?
-map 1:a -f mpegts pipe:1
same for vcodec acodec start_at_zero
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.
Yep, you're right. I have it backwards :/
It should go ffmpeg-fout
-> options.format
-> 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.
I added some more tests, and defaults in the class - it should behave as expected now.
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.
sorry but I see you are using "matroska" for mpegts
what would be the value to fill in for "flv" ?
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.
This issues is ancient, why are you bumping it? It is now locked.
4258da9
to
c61ed5b
Compare
c61ed5b
to
3fce0f4
Compare
setting the value might work, but is there an actual working use case not sure which formats are valid https://ffmpeg.org/ffmpeg-formats.html @lcapriotti what was your intention with this feature?
|
|
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.
@back-to It needs a rebase. I closed the other PR for the time being. |
…at and audio sync option (streamlink#2892) The change is introducing two new optional command line options: `--ffmpeg-fout`: The output file format when muxing with ffmpeg '--ffmpeg-no-start-at-zero': When used with ffmpeg and copyts, disables automatically shifting input timestamps so they start at zero Both options defaults are keeping the predefined values, hence backwards compatibility is enforced. Co-Authored-By: beardypig <beardypig@protonmail.com> Co-authored-by: Luigi Capriotti <l.capriotti@tiscali.it>
…at and audio sync option (streamlink#2892) The change is introducing two new optional command line options: `--ffmpeg-fout`: The output file format when muxing with ffmpeg '--ffmpeg-no-start-at-zero': When used with ffmpeg and copyts, disables automatically shifting input timestamps so they start at zero Both options defaults are keeping the predefined values, hence backwards compatibility is enforced. Co-Authored-By: beardypig <beardypig@protonmail.com> Co-authored-by: Luigi Capriotti <l.capriotti@tiscali.it>
The change is introducing two new optional command line options:
--ffmpeg-fout
: The output file format when muxing with ffmpeg--ffmpeg-no-start-at-zero
: When used with ffmpeg and copyts, disables automatically shifting input timestamps so they start at zeroBoth options defaults are keeping the predefined values, hence backwards compatibility is enforced.