Skip to content
Open
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
11 changes: 7 additions & 4 deletions converter/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ def __repr__(self):
else:
value = 'MediaStreamInfo(%s)' % d

if isinstance(value, unicode):
value = value.encode(console_encoding, 'replace')

return value


Expand Down Expand Up @@ -410,7 +413,7 @@ def probe(self, fname, posters_as_video=True):
p = self._spawn([self.ffprobe_path,
'-show_format', '-show_streams', fname])
stdout_data, _ = p.communicate()
stdout_data = stdout_data.decode(console_encoding, errors='ignore')
stdout_data = stdout_data.decode(console_encoding, 'ignore')
info.parse_ffprobe(stdout_data)

if not info.format.format and len(info.streams) == 0:
Expand Down Expand Up @@ -473,7 +476,7 @@ def on_sigalrm(*_):
if not ret:
break

ret = ret.decode(console_encoding, errors="ignore")
ret = ret.decode(console_encoding, "ignore")
total_output += ret
buf += ret
if '\r' in buf:
Expand Down Expand Up @@ -587,7 +590,7 @@ def thumbnails_by_interval(self, source, output_pattern, interval=1,
_, stderr_data = p.communicate()
if stderr_data == '':
raise FFMpegError('Error while calling ffmpeg binary')
stderr_data.decode(console_encoding, errors="ignore")
stderr_data.decode(console_encoding, "ignore")

def thumbnail(self, fname, time, outfile, size=None, quality=DEFAULT_JPEG_QUALITY):
"""
Expand Down Expand Up @@ -743,6 +746,6 @@ def thumbnails(self, fname, option_list):
_, stderr_data = p.communicate()
if stderr_data == '':
raise FFMpegError('Error while calling ffmpeg binary')
stderr_data.decode(console_encoding, errors="ignore")
stderr_data.decode(console_encoding, "ignore")
if any(not os.path.exists(option[1]) for option in option_list):
raise FFMpegError('Error creating thumbnail: %s' % stderr_data)