Skip to content

Commit

Permalink
linux export
Browse files Browse the repository at this point in the history
added linux export
  • Loading branch information
Guray00 committed Dec 25, 2022
1 parent 8edd105 commit 1b48ed3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .linux_export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import os

os.environ["EXPORT"] = "linux"
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions cutter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# ffmpeg -i input.mp4 -metadata comment="compressed" -c copy output.mp4

import glob
import os
import sys
Expand Down Expand Up @@ -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"
Expand Down
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 1b48ed3

Please sign in to comment.