|
29 | 29 | <summary>Table of Contents</summary>
|
30 | 30 | <ol>
|
31 | 31 | <li><a href="#getting-started">Getting Started</a></li>
|
| 32 | + <li> |
| 33 | + <a href="#easy-audio-to-video-conversion">Easy Audio to Video Conversion</a> |
| 34 | + <ul> |
| 35 | + <li><a href="#docker-container">Using Docker Container</a></li> |
| 36 | + <li><a href="#conversion-examples">Conversion Examples</a></li> |
| 37 | + <li><a href="#customizing-visualizations">Customizing Visualizations</a></li> |
| 38 | + </ul> |
| 39 | + </li> |
| 40 | + <li><a href="#manual-usage">Manual Usage</a></li> |
32 | 41 | <li><a href="#contributing">Contributing</a></li>
|
33 | 42 | <li><a href="#license">License</a></li>
|
34 | 43 | <li><a href="#support">Support</a></li>
|
@@ -75,6 +84,142 @@ gst-inspect projectm
|
75 | 84 |
|
76 | 85 | <p align="right">(<a href="#readme-top">back to top</a>)</p>
|
77 | 86 |
|
| 87 | +## [Demo Videos (4K)](https://www.youtube.com/watch?v=fI3BMiVDQgU&list=PLFLkbObX4o6TK1jGL6pm1wMwvq2FXnpYJ&index=7) |
| 88 | + |
| 89 | +https://www.youtube.com/watch?v=fI3BMiVDQgU&list=PLFLkbObX4o6TK1jGL6pm1wMwvq2FXnpYJ&index=7 |
| 90 | + |
| 91 | +<!-- EASY AUDIO TO VIDEO CONVERSION --> |
| 92 | + |
| 93 | +## Easy Audio to Video Conversion |
| 94 | + |
| 95 | +We provide a simple way to convert audio files to video with ProjectM visualizations using Docker. This method requires no manual installation of dependencies, as everything is packaged in a Docker container. |
| 96 | + |
| 97 | +### Docker Container |
| 98 | + |
| 99 | +The included Docker container has: |
| 100 | + |
| 101 | +- ProjectM library and presets |
| 102 | +- GStreamer with all necessary plugins |
| 103 | +- The gst-projectm plugin compiled and ready to use |
| 104 | +- GPU acceleration support (NVIDIA, AMD, or Intel) |
| 105 | + |
| 106 | +#### Prerequisites |
| 107 | + |
| 108 | +- [Docker](https://docs.docker.com/get-docker/) installed on your system |
| 109 | +- For GPU acceleration: |
| 110 | + - NVIDIA GPUs: [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) |
| 111 | + - AMD/Intel GPUs: No additional installation required |
| 112 | + |
| 113 | +#### Quick Start |
| 114 | + |
| 115 | +1. Clone this repository: |
| 116 | + |
| 117 | + ```bash |
| 118 | + git clone https://github.com/projectM-visualizer/gst-projectm.git |
| 119 | + cd gst-projectm |
| 120 | + ``` |
| 121 | + |
| 122 | +2. Convert an audio file to video: |
| 123 | + ```bash |
| 124 | + ./projectm-convert -i your-audio-file.mp3 -o output-video.mp4 |
| 125 | + ``` |
| 126 | + |
| 127 | +The first run will build the Docker container automatically. It will take a good while, so be patient. Once built, it will be cached for future runs. |
| 128 | + |
| 129 | +Note that running the conversion can take hours depending on the length of the audio file and the selected settings. |
| 130 | + |
| 131 | +### Conversion Examples |
| 132 | + |
| 133 | +#### Basic Conversion |
| 134 | + |
| 135 | +Convert an MP3 to a 1080p MP4 with default settings: |
| 136 | + |
| 137 | +```bash |
| 138 | +./projectm-convert -i my-song.mp3 -o my-visualization.mp4 |
| 139 | +``` |
| 140 | + |
| 141 | +#### 4K Resolution |
| 142 | + |
| 143 | +Create a 4K video with higher bitrate: |
| 144 | + |
| 145 | +```bash |
| 146 | +./projectm-convert -i my-song.mp3 -o my-visualization-4k.mp4 --video-size 3840x2160 -b 16000 |
| 147 | +``` |
| 148 | + |
| 149 | +#### High Quality Render |
| 150 | + |
| 151 | +For creating high quality videos (slower encoding): |
| 152 | + |
| 153 | +```bash |
| 154 | +./projectm-convert -i my-song.mp3 -o my-visualization-hq.mp4 --speed veryslow --mesh 2048x1152 |
| 155 | +``` |
| 156 | + |
| 157 | +#### Quick Test Run |
| 158 | + |
| 159 | +For quick testing (lower quality but faster encoding): |
| 160 | + |
| 161 | +```bash |
| 162 | +./projectm-convert -i my-song.mp3 -o my-visualization-test.mp4 --speed ultrafast --video-size 1280x720 |
| 163 | +``` |
| 164 | + |
| 165 | +### Customizing Visualizations |
| 166 | + |
| 167 | +The conversion script supports customizing various aspects of the visualization: |
| 168 | + |
| 169 | +| Option | Description | Default | |
| 170 | +| --------------------- | -------------------------------------------------- | --------------- | |
| 171 | +| `-d, --duration SEC` | Time in seconds between preset transitions | 6 | |
| 172 | +| `--mesh WxH` | Mesh size for visualization calculations | 1024x576 | |
| 173 | +| `--video-size WxH` | Output video resolution | 1920x1080 | |
| 174 | +| `-r, --framerate FPS` | Output video frame rate | 60 | |
| 175 | +| `-b, --bitrate KBPS` | Output video bitrate in kbps | 8000 | |
| 176 | +| `--speed PRESET` | x264 encoding speed preset (ultrafast to veryslow) | medium | |
| 177 | +| `-p, --preset DIR` | Path to custom presets directory | Default presets | |
| 178 | + |
| 179 | +#### Using Custom Presets |
| 180 | + |
| 181 | +If you have your own ProjectM preset files: |
| 182 | + |
| 183 | +```bash |
| 184 | +./projectm-convert -i my-song.mp3 -o my-visualization.mp4 -p /path/to/your/presets |
| 185 | +``` |
| 186 | + |
| 187 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 188 | + |
| 189 | +<!-- MANUAL USAGE --> |
| 190 | + |
| 191 | +## Manual Usage |
| 192 | + |
| 193 | +Once the plugin has been installed, you can use it something like this: |
| 194 | + |
| 195 | +```shell |
| 196 | +gst-launch pipewiresrc ! queue ! audioconvert ! projectm preset=/usr/local/share/projectM/presets preset-duration=5 ! video/x-raw,width=2048,height=1440,framerate=60/1 ! videoconvert ! xvimagesink sync=false |
| 197 | +``` |
| 198 | + |
| 199 | +Or to convert an audio file to video: |
| 200 | + |
| 201 | +```shell |
| 202 | +gst-launch-1.0 -e \ |
| 203 | + filesrc location=input.mp3 ! \ |
| 204 | + decodebin ! tee name=t \ |
| 205 | + t. ! queue ! audioconvert ! audioresample ! \ |
| 206 | + capsfilter caps="audio/x-raw, format=F32LE, channels=2, rate=44100" ! avenc_aac bitrate=320000 ! queue ! mux. \ |
| 207 | + t. ! queue ! audioconvert ! projectm preset=/usr/local/share/projectM/presets texture-dir=/usr/local/share/projectM/textures preset-duration=6 mesh-size=1024,576 ! \ |
| 208 | + identity sync=false ! videoconvert ! videorate ! video/x-raw,framerate=60/1,width=3840,height=2160 ! \ |
| 209 | + x264enc bitrate=50000 key-int-max=200 speed-preset=veryslow ! video/x-h264,stream-format=avc,alignment=au ! queue ! mux. \ |
| 210 | + mp4mux name=mux ! filesink location=output.mp4 |
| 211 | +``` |
| 212 | + |
| 213 | +You may need to adjust some elements which may or may not be present in your GStreamer installation, such as x264enc, avenc_aac, etc. |
| 214 | + |
| 215 | +Available options: |
| 216 | + |
| 217 | +```shell |
| 218 | +gst-inspect projectm |
| 219 | +``` |
| 220 | + |
| 221 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 222 | + |
78 | 223 | <!-- CONTRIBUTING -->
|
79 | 224 |
|
80 | 225 | ## Contributing
|
@@ -114,6 +259,8 @@ Distributed under the LGPL-2.1 license. See `LICENSE` for more information.
|
114 | 259 |
|
115 | 260 | Blaquewithaq (Discord: SoFloppy#1289) - [@anomievision](https://twitter.com/anomievision) - [email protected]
|
116 | 261 |
|
| 262 | +Mischa (Discord: mish) - [@revmischa](https://github.com/revmischa) |
| 263 | + |
117 | 264 | <p align="right">(<a href="#readme-top">back to top</a>)</p>
|
118 | 265 |
|
119 | 266 | <!----------------------------------------------------------------------->
|
|
0 commit comments