File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,17 @@ def __init__(self, video_file):
4949 self .audio = []
5050 datalines = []
5151
52- for a in iter (p .stdout .readline , b"" ):
52+ for b in iter (p .stdout .readline , b"" ):
53+ a = b .decode ("utf-8" )
5354 if re .match ("\[STREAM\]" , a ):
5455 datalines = []
5556 elif re .match ("\[\/STREAM\]" , a ):
5657 self .streams .append (FFStream (datalines ))
5758 datalines = []
5859 else :
5960 datalines .append (a )
60- for a in iter (p .stderr .readline , b"" ):
61+ for b in iter (p .stderr .readline , b"" ):
62+ a = b .decode ("utf-8" )
6163 if re .match ("\[STREAM\]" , a ):
6264 datalines = []
6365 elif re .match ("\[\/STREAM\]" , a ):
Original file line number Diff line number Diff line change @@ -170,13 +170,15 @@ def get_video_duration(video_file):
170170 """Get video duration in seconds"""
171171 probe = FFProbe (video_file )
172172 if not probe .video :
173- print (f' No video found in { video_file } ' )
173+ print (f" No video found in { video_file } " )
174174 return None
175175 duration = probe .video [0 ].duration
176176 try :
177177 return float (duration )
178178 except (TypeError , ValueError ) as e :
179- print (f"could not parse { duration } as duration from video { video_file } due to { e } " )
179+ print (
180+ f"could not parse { duration } as duration from video { video_file } due to { e } "
181+ )
180182 return None
181183
182184
You can’t perform that action at this time.
0 commit comments