Skip to content

Commit

Permalink
fix: fixed the audio file escape name issue (#75)
Browse files Browse the repository at this point in the history
* fix: fixed the audio file escape name issue

* fix: fixed file name escape issue

* feat: generated v1.5.1 executable for win32

---------

Co-authored-by: Hanxiong Shi <[email protected]>
  • Loading branch information
shihanxiong and Hanxiong Shi authored Apr 17, 2023
1 parent 1bcdb16 commit bfe874c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- application now disables play / pause buttons to dis-allow double clicking
- fixed the issue where removing audio preview is not allowed once audio mixer is loaded
- fixed the issue when filenames are not escaped while generating audios

### v1.5.0

Expand Down
5 changes: 3 additions & 2 deletions src/audio_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
import logging
from file_utils import FileUtils


class AudioUtils():
Expand All @@ -9,7 +10,7 @@ def __init__(self):
@staticmethod
def generate_mp3_from_mp4(mp4_input_filename, mp3_output_filename, ffmpeg_preset_arg="-preset ultrafast"):
# using preset = ultrafast as the audio is for preview only
cmd = f"ffmpeg -i {mp4_input_filename} -vn -preset ultrafast -acodec mp3 {ffmpeg_preset_arg} {mp3_output_filename}"
cmd = f"ffmpeg -i {mp4_input_filename} -vn -preset ultrafast -acodec mp3 {ffmpeg_preset_arg} {FileUtils.escape_file_name(mp3_output_filename)}"
subprocess.check_output(cmd, shell=True)
# TODO: do logging via status_component instead
logging.debug(
Expand All @@ -19,7 +20,7 @@ def generate_mp3_from_mp4(mp4_input_filename, mp3_output_filename, ffmpeg_preset

@staticmethod
def generate_aac_from_mp4(mp4_input_filename, aac_output_filename, ffmpeg_preset_arg):
cmd = f"ffmpeg -i {mp4_input_filename} -vn -acodec copy {ffmpeg_preset_arg} {aac_output_filename}"
cmd = f"ffmpeg -i {mp4_input_filename} -vn -acodec copy {ffmpeg_preset_arg} {FileUtils.escape_file_name(aac_output_filename)}"
subprocess.check_output(cmd, shell=True)

return aac_output_filename
Binary file modified src/dist/win32_video_loom_1_5_1.exe
Binary file not shown.

0 comments on commit bfe874c

Please sign in to comment.