Skip to content

Commit

Permalink
video compression
Browse files Browse the repository at this point in the history
  • Loading branch information
Logerfo committed Dec 6, 2022
1 parent 2d85f42 commit 0827aa8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/chalicelib/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def __get_file_id(file) -> Union[str, None]:

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

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

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

return MP3_FILE_NAME

Expand Down

0 comments on commit 0827aa8

Please sign in to comment.