|
| 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 ;) |
0 commit comments