Optional parameter to check if the encoder exists

If `must_exists` is `False` when intializing `EncoderFFmpeg()`, skip
skip checking whether the FFmpeg binary exists.

Fixes #722.
This commit is contained in:
Ritiek Malhotra
2020-05-19 12:49:00 +05:30
parent 9c97f33aa2
commit debe7ee902
3 changed files with 8 additions and 8 deletions

View File

@@ -44,9 +44,9 @@ class Track:
return progress_bar
def download_while_re_encoding(self, stream, target_path, target_encoding=None,
encoder=EncoderFFmpeg, show_progress=True):
encoder=EncoderFFmpeg(must_exist=False), show_progress=True):
total_chunks = self.calculate_total_chunks(stream["filesize"])
process = encoder().re_encode_from_stdin(
process = encoder.re_encode_from_stdin(
stream["encoding"],
target_path,
target_encoding=target_encoding
@@ -80,10 +80,10 @@ class Track:
writer(response, progress_bar, file_io)
def re_encode(self, input_path, target_path, target_encoding=None,
encoder=EncoderFFmpeg, show_progress=True):
encoder=EncoderFFmpeg(must_exist=False), show_progress=True):
stream = self.metadata["streams"].getbest()
total_chunks = self.calculate_total_chunks(stream["filesize"])
process = encoder().re_encode_from_stdin(
process = encoder.re_encode_from_stdin(
stream["encoding"],
target_path,
target_encoding=target_encoding