Skip to content

Commit

Permalink
Python3 fixes for the shot_detect example (AcademySoftwareFoundation#…
Browse files Browse the repository at this point in the history
…1374)

Signed-off-by: ssteinbach <[email protected]>
Signed-off-by: Michele Spina <[email protected]>
  • Loading branch information
ssteinbach authored and MichaelPlug committed Aug 5, 2023
1 parent bd5c2f0 commit eba755e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/shot_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,15 @@ def _ffprobe_fps(name, full_path, dryrun=False):
if dryrun:
return 1.0

for line in err.split('\n'):
try:
# python3
# if its bytes (python3+)
err_str = err.decode("utf-8")
except AttributeError:
# if its a string (python <3)
err_str = err

for line in err_str.split('\n'):
if not ("Stream" in line and "Video" in line):
continue

Expand Down

0 comments on commit eba755e

Please sign in to comment.