This commit is contained in:
noureddin 2020-09-30 19:10:13 +02:00 committed by GitHub
commit 5c2e6766c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 1 deletions

View File

@ -244,7 +244,24 @@ class FFmpegFD(ExternalFD):
# http://trac.ffmpeg.org/ticket/6125#comment:10
args += ['-seekable', '1' if seekable else '0']
args += self._configuration_args()
# args += self._configuration_args()
# Some ffmpeg options need to come after the input url.
# `-to` and `-fs` must. `-t` should.
# Also, in ffmpeg, options and values must be separated with a space;
# so, we will never see `-t2` but will see `-t 2`.
self._input_args = self._configuration_args()
self._output_args = []
for opt in ['-t', '-to', '-fs']:
try:
idx = self._input_args.index(opt)
self._output_args.append(self._input_args.pop(idx)) # the option
self._output_args.append(self._input_args.pop(idx)) # the value
except ValueError:
pass
args += self._input_args
# start_time = info_dict.get('start_time') or 0
# if start_time:
@ -312,6 +329,7 @@ class FFmpegFD(ExternalFD):
args += ['-rtmp_conn', conn]
args += ['-i', url, '-c', 'copy']
args += self._output_args
if self.params.get('test', False):
args += ['-fs', compat_str(self._TEST_FILE_SIZE)]