rosyvs commited on
Commit
3aa86fa
·
verified ·
1 Parent(s): 8c26b8e

add logging for filetype and set to lower, rename utlis to utils

Browse files
Files changed (1) hide show
  1. utlis.py → utils.py +6 -4
utlis.py → utils.py RENAMED
@@ -92,8 +92,10 @@ def convert_video_format(media_in, media_out):
92
  if not isinstance(media_out, (str, Path)):
93
  raise TypeError("media_out must be a string or a PathLike object")
94
 
95
- in_ext = Path(media_in).suffix
96
- out_ext = Path(media_out).suffix
 
 
97
 
98
  if in_ext !='.webm':
99
  # input is not in webm format
@@ -164,8 +166,8 @@ def trim_media(media_in, media_out, start, end):
164
  WAV_CHANNELS = 1
165
  WAV_SAMPLE_RATE = 16000
166
 
167
- media_type = Path(media_in).suffix
168
- ext = Path(media_out).suffix
169
  print("EXT", ext)
170
  if isinstance(start, str):
171
  start_sec = HHMMSS_to_sec(start)
 
92
  if not isinstance(media_out, (str, Path)):
93
  raise TypeError("media_out must be a string or a PathLike object")
94
 
95
+ in_ext = Path(media_in).suffix.lower()
96
+ out_ext = Path(media_out).suffix.lower()
97
+ logging.info(f'...detected extensions from filename: input={in_ext} output={out_ext}')
98
+
99
 
100
  if in_ext !='.webm':
101
  # input is not in webm format
 
166
  WAV_CHANNELS = 1
167
  WAV_SAMPLE_RATE = 16000
168
 
169
+ media_type = Path(media_in).suffix.lower()
170
+ ext = Path(media_out).suffix.lower()
171
  print("EXT", ext)
172
  if isinstance(start, str):
173
  start_sec = HHMMSS_to_sec(start)