Skip to content

Commit 0827aa8

Browse files
committed
video compression
1 parent 2d85f42 commit 0827aa8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/chalicelib/file_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def __get_file_id(file) -> Union[str, None]:
2626

2727
def __get_voice_file(voice) -> Union[str, None]:
2828
import subprocess
29-
import os
3029

3130
file_id = __get_file_id(voice)
3231
if file_id is None:
@@ -48,7 +47,7 @@ def __get_video_file(video) -> Union[str, None]:
4847
__download_file(file_id, MP4_FILE_NAME)
4948

5049
subprocess.Popen(['ffmpeg', '-y', '-i', MP4_FILE_NAME, '-vn', '-acodec', 'copy', AAC_FILE_NAME]).wait()
51-
subprocess.Popen(['ffmpeg', '-y', '-i', AAC_FILE_NAME, MP3_FILE_NAME]).wait()
50+
subprocess.Popen(['ffmpeg', '-y', '-i', AAC_FILE_NAME, '-map', '0:a:0', '-b:a', '41k', MP3_FILE_NAME]).wait()
5251

5352
return MP3_FILE_NAME
5453

0 commit comments

Comments
 (0)