diff --git a/.linux_export.py b/.linux_export.py new file mode 100644 index 0000000..5ac1757 --- /dev/null +++ b/.linux_export.py @@ -0,0 +1,3 @@ +import os + +os.environ["EXPORT"] = "linux" \ No newline at end of file diff --git a/README.md b/README.md index 1d67d3f..7b0c04e 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,24 @@ To cut a single video file with a silence duration of 1 second and a noise level cutter.exe -d 1 -n -30 --keep-cfr path/to/video.mp4 ``` +## Compile + +### Windows + +Copy in the same folder the `ffmpeg.exe` file and: + +```bash +pyinstaller -F --add-data "ffmpeg.exe;." --runtime-hook ".win_export.py" .\cutter.py +``` + +## Linux + +Copy in the same folder the `ffmpeg` file and: + +```bash +python3 -m PyInstaller -F --add-data "ffmpeg:." --runtime-hook ".linux_export.py" ./cutter.py +``` + ## Contributions Contributions are welcome! If you want to contribute to the project, please fork the repository and create a pull request. diff --git a/cutter.py b/cutter.py index 9cc108d..fd7e7c9 100644 --- a/cutter.py +++ b/cutter.py @@ -1,5 +1,3 @@ -# ffmpeg -i input.mp4 -metadata comment="compressed" -c copy output.mp4 - import glob import os import sys @@ -28,6 +26,10 @@ if (os.environ["EXPORT"] == "win"): base_path = sys._MEIPASS FFMPEG_CMD = base_path + "\\ffmpeg.exe" + + elif (os.environ["EXPORT"] == "linux"): + base_path = sys._MEIPASS + FFMPEG_CMD = base_path + "/ffmpeg" except: FFMPEG_CMD = "ffmpeg" diff --git a/requirements.txt b/requirements.txt index ff53214..beff188 100644 Binary files a/requirements.txt and b/requirements.txt differ