Skip to content

Commit 5710642

Browse files
author
RayVentura
committed
Merge branch 'new-forked-stable' into stable
2 parents 62a4f8f + 22ae6e4 commit 5710642

File tree

5 files changed

+184
-10
lines changed

5 files changed

+184
-10
lines changed

README-Docker.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ PEXELS_API_KEY=put_your_pexels_api_key_here
1313
To run Dockerfile do this:
1414
```bash
1515
docker build -t short_gpt_docker .
16-
docker run -p 31415:31415 short_gpt_docker --env-file .env
17-
```
16+
docker run -p 31415:31415 --env-file .env short_gpt_docker:latest
17+
```
18+
Export Docker image:
19+
```bash
20+
docker save short_gpt_docker > short_gpt_docker.tar
21+
```

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# 🚀🎬 ShortGPT
2+
Son Tran (me) forked this repo to fix annoying bugs. The original program won't work on Python <3.11, but works with old ffmpeg :)
3+
4+
Please read "installation-notes.md" for more details.
5+
26
<p align="center">
37
<a href="https://discord.gg/uERx39ru3R">
48
<img src="https://dcbadge.vercel.app/api/server/uERx39ru3R?compact=true&style=flat">
@@ -62,11 +66,11 @@ ShortGPT is a powerful framework for automating content creation. It simplifies
6266

6367
- 🧠 **Memory and persistency**: Ensures long-term persistency of automated editing variables with TinyDB.
6468

65-
## 🚀 Quick Start: Run ShortGPT on Google Colab (https://colab.research.google.com/drive/1_2UKdpF6lqxCqWaAcZb3rwMVQqtbisdE?usp=sharing)
69+
## 🚀 Quick Start: Run ShortGPT on Google Colab (https://colab.research.google.com/drive/18WtSAnU5QwQXswKymOpNi2n331rQ2zzp?usp=sharing)
6670

6771
If you prefer not to install the prerequisites on your local system, you can use the Google Colab notebook. This option is free and requires no installation setup.
6872

69-
1. Click on the link to the Google Colab notebook: [https://colab.research.google.com/drive/1_2UKdpF6lqxCqWaAcZb3rwMVQqtbisdE?usp=sharing](https://colab.research.google.com/drive/1_2UKdpF6lqxCqWaAcZb3rwMVQqtbisdE?usp=sharing)
73+
1. Click on the link to the Google Colab notebook: [https://colab.research.google.com/drive/18WtSAnU5QwQXswKymOpNi2n331rQ2zzp?usp=sharing](https://colab.research.google.com/drive/18WtSAnU5QwQXswKymOpNi2n331rQ2zzp?usp=sharing)
7074

7175
2. Once you're in the notebook, simply run the cells in order from top to bottom. You can do this by clicking on each cell and pressing the 'Play' button, or by using the keyboard . Enjoy using ShortGPT!
7276

@@ -85,7 +89,7 @@ For the updated installation steps, please follow Step 1 and 2 in our official d
8589
1. Open a terminal or command prompt.
8690
2. Execute the following command to clone the shortGPT repository:
8791
```
88-
git clone https://github.com/rayventura/shortgpt.git
92+
git clone https://github.com/transonit/shortgpt.git
8993
```
9094

9195
### Step 4: Install Python Dependencies

installation-notes.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
Son Tran (me) forked this repo to fix annoying bugs. The original program won't work on Python <3.11, but works with old ffmpeg :)
2+
3+
In short, you need to use:
4+
- Python 3.11.3
5+
- openai package 0.28.0, then upgrade openai-whisper
6+
- ffmpeg 4.2.3
7+
- ImageMagick 7.1.1
8+
9+
Please keep in mind, that I WON'T update Dockerfile, please do it yourself if you need to build a Docker image.
10+
11+
So, this is an important note, please read it before installing or using ShortGPT:
12+
13+
### 1. OS: Debian 11 x64
14+
```bash
15+
sudo apt update && sudo apt upgrade
16+
sudo apt install wget git libltdl-dev libjpeg-dev libpng-dev libtiff-dev libgif-dev libfreetype6-dev liblcms2-dev libxml2-dev wget build-essential libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
17+
```
18+
19+
### 2. Install Python version: 3.11.3
20+
```bash
21+
wget https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tgz
22+
tar xzf Python-3.11.3.tgz
23+
cd Python-3.11.3
24+
./configure --enable-optimizations
25+
make install
26+
```
27+
28+
To check the Python version, use this command:
29+
```bash
30+
python3.11 -V
31+
```
32+
To use pip, use this command:
33+
```bash
34+
pip3.11 install <package-name>
35+
```
36+
37+
### 3. Install ffmpeg version: 4.2.3
38+
ShortGPT will accept this version of FFmpeg:
39+
40+
3.1. Install Build Dependencies:
41+
42+
```bash
43+
sudo apt update
44+
sudo apt build-dep ffmpeg
45+
```
46+
47+
3.2. Clone FFmpeg Source Code:
48+
49+
```bash
50+
git clone https://git.ffmpeg.org/ffmpeg.git
51+
cd ffmpeg
52+
git checkout n4.2.3
53+
```
54+
55+
3.3. Configure FFmpeg Build:
56+
57+
```bash
58+
./configure --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-avisynth --enable-libopenmpt --enable-shared --disable-static
59+
```
60+
61+
This step checks for the necessary dependencies and configures the build based on your system.
62+
63+
3.4. Build FFmpeg:
64+
65+
```bash
66+
make -j$(nproc)
67+
```
68+
69+
This step may take some time as it compiles the FFmpeg source code.
70+
71+
3.5. Install FFmpeg:
72+
73+
```bash
74+
sudo make install
75+
```
76+
77+
3.6. Verify Installation:
78+
79+
```bash
80+
ffmpeg -version
81+
```
82+
83+
This should display the version information, and you should see version 4.2.3.
84+
85+
Optional: Update Library Cache:
86+
87+
```bash
88+
sudo ldconfig
89+
```
90+
91+
This updates the dynamic linker run-time bindings.
92+
93+
That's it! You should now have FFmpeg version 4.2.3 installed on your Debian 11 system.
94+
95+
If you are still facing with "libavdevice.so.58" error when running ffmpeg, run this command to fix it, remember to change the path:
96+
```bash
97+
echo 'export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64/:/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH' >> ~/.bashrc
98+
source ~/.bashrc
99+
```
100+
101+
### 4. Install ImageMagick 7.1.1:
102+
4.1. Clone ImageMagick:
103+
```bash
104+
sudo git clone https://github.com/ImageMagick/ImageMagick.git
105+
```
106+
4.2. Go to the ImageMagick folder and run configuration:
107+
```bash
108+
cd ImageMagick
109+
./configure
110+
```
111+
4.3. Make:
112+
```bash
113+
sudo make
114+
```
115+
4.4. Install complied code:
116+
```bash
117+
sudo make install
118+
```
119+
4.5. Update path:
120+
```bash
121+
sudo ldconfig /usr/local/lib
122+
```
123+
4.6. (Optional) Check version
124+
```bash
125+
$ magick -version
126+
```
127+
4.7. Fix Imagemagick policy.xml bug on Linux using MoviePy
128+
```bash
129+
!sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
130+
```
131+
132+
### 5. Upgrade openai-whisper:
133+
```bash
134+
pip3.11 install -U openai-whisper
135+
```
136+
137+
### 6. (Optional) Install torch 2.1.0:
138+
```bash
139+
pip3.11 install torch==2.1.0
140+
```
141+
142+
### 7. This is a list of Python lib and their versions, I'm using them without errors:
143+
```bash
144+
edge-tts==6.1.9
145+
ffmpeg==1.4
146+
ffmpeg-python==0.2.0
147+
gradio==3.38.0==3.38.0
148+
moviepy==1.0.3==1.0.3
149+
openai==0.28.1==0.28.1
150+
pillow==9.0.0==9.0.0
151+
proglog==0.1.10
152+
progress==1.6
153+
protobuf==3.20.3==3.20.3
154+
python-dotenv==1.0.0
155+
questionary==2.0.1
156+
tiktoken==0.5.1
157+
tinydb==4.8.0
158+
tinymongo==0.2.0
159+
torch==2.1.0
160+
torchaudio==2.1.0
161+
whisper-timestamped==1.12.20
162+
yt-dlp==2023.10.13
163+
```
164+
165+
Now you're ready to clone my forked repo and run ShortGPT without errors ;)

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
ffmpeg
2+
ffmpeg-python
23
python-dotenv
34
gradio==3.38.0
4-
openai
5+
openai==0.28.1
56
tiktoken
67
tinydb
78
tinymongo
@@ -11,9 +12,9 @@ torch
1112
torchaudio
1213
### whisper timestamped
1314
whisper-timestamped
14-
protobuf==3.20.0
15+
protobuf==3.20.3
1516
pillow==9.0.0
1617
moviepy==1.0.3
1718
progress
1819
questionary
19-
edge-tts
20+
edge-tts

shortGPT/editing_framework/core_editing_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ def generate_video(self, schema:Dict[str, Any], output_file, logger=None) -> Non
8181
video.audio = audio
8282
if logger:
8383
my_logger = MoviepyProgressLogger(callBackFunction=logger)
84-
video.write_videofile(output_file, codec='libx264', audio_codec='aac', logger=my_logger)
84+
video.write_videofile(output_file, codec='libx264', audio_codec='aac', fps=25, preset='veryfast', logger=my_logger)
8585
else:
86-
video.write_videofile(output_file, codec='libx264', audio_codec='aac')
86+
video.write_videofile(output_file, codec='libx264', audio_codec='aac', fps=25, preset='veryfast')
8787
return output_file
8888

8989
def generate_audio(self, schema:Dict[str, Any], output_file, logger=None) -> None:

0 commit comments

Comments
 (0)