Skip to content

Commit

Permalink
fix error during encoding hiancdtrsnm#36
Browse files Browse the repository at this point in the history
  • Loading branch information
fsadannn committed Nov 20, 2020
1 parent 016de58 commit 4a7bc7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions video_diet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
from .utils import get_bitdepth
if sys.platform == 'win32':
import wexpect as expect
# patch to avoid crash inside conemu
if os.environ.get('ConEmuHooks' ,'OFF') == 'OFF':
# patch windows consloe for scale correctly characters
import ansicon
ansicon.load()
# patch windows consloe for scale correctly characters
import ansicon
ansicon.load()
else:
import pexpect as expect

Expand Down
4 changes: 2 additions & 2 deletions video_diet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def get_codec(path: str):
def get_bitdepth(path: str):
try:
metadata = FFProbe(path)
except:
return None
except Exception as e:
return PixelFormat('yuv420p')

if len(metadata.video) != 0:
pixel_format = metadata.video[0].pixel_format()
Expand Down

0 comments on commit 4a7bc7c

Please sign in to comment.