You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transcoding is expensive and resource consuming operation on CPU and GPU. For big companies with thousands of customers it is essential, to have a dedicated 24/7 transcoding servers. But we, single sporadic users of transcoding, need to have different approach. Transcoding should be done only when its output is really needed. This tool is trying to solve this problem by offering transcoding on demand.
1
+
# go-transcode HTTP on-demand transcoding API
3
2
4
-
This tool is intended to be used with live streams only. Seeking is not supported, yet.
3
+
## Why
4
+
5
+
Transcoding is expensive and resource consuming operation on CPU and GPU. For big companies with thousands of customers it is essential, to have a dedicated 24/7 transcoding servers which can store all the transcoded versions.
6
+
7
+
For the rest of us who don't have infinite resources and cannot have 3 times bigger media library because of transcoding, we should only transcode when it is needed. This tool is trying to solve this problem by offering transcoding on demand.
8
+
9
+
This feature is common in media centers (plex, jellyfin) but there was no simple transcoding server without all other media center features. Now there is one! go-transcode is simple and extensible, and will probably not add features unrelated to transcoding.
10
+
11
+
## Features
12
+
13
+
Sources:
14
+
-[x] Live streams
15
+
-[ ] Static files (basic support)
16
+
-[x] Any codec/container supported by ffmpeg
17
+
18
+
Outputs:
19
+
-[x] Basic MP4 over HTTP (h264+aac) : `http://go-transcode/[profile]/[stream-id]`
20
+
-[x] Basic HLS over HTTP (h264+aac) : `http://go-transcode/[profile]/[stream-id]/index.m3u8`
21
+
-[x] Demo HTML player (for HLS) : `http://go-transcode/[profile]/[stream-id]/play.html`
22
+
23
+
Features:
24
+
-[ ] Seeking for static files (index)
25
+
-[ ] Audio/Subtitles tracks
26
+
-[ ] Private mode (serve users authenticated by reverse proxy)
5
27
6
28
## Config
7
-
Specify streams as object in yaml file.
8
29
9
-
### Streams
10
-
Create `streams.yaml` file, with your streams:
30
+
Place your config file in `./config.yaml` (or `/etc/transcode/config.yaml`). The streams are defined like this:
11
31
12
32
```yaml
13
33
streams:
14
34
<stream-id>: <stream-url>
15
35
```
16
36
17
-
Example:
37
+
Full configuration example:
38
+
18
39
```yaml
40
+
# allow debug outputs
41
+
debug: true
42
+
43
+
# bind server to IP:PORT (use :8888 for all connections)
44
+
bind: localhost:8888
45
+
46
+
# serve static files from this directory (optional)
Profiles (HTTP and HLS) with CPU transcoding can be found in `profiles`:
58
+
## Transcoding profiles
34
59
35
-
* h264_360p
36
-
* h264_540p
37
-
* h264_720p
38
-
* h264_1080p
60
+
go-transcode supports any formats that ffmpeg likes. We provide profiles out-of-the-box for h264+aac (mp4 container) for 360p, 540p, 720p and 1080p resolutions: `h264_360p`, `h264_540p`, `h264_720p` and `h264_1080p`. Profiles can have any name, but must match regex: `^[0-9A-Za-z_-]+$`
39
61
40
-
Profile names must match flowing regex: `^[0-9A-Za-z_-]+$`
41
-
42
-
## GPU Profiles
43
-
Profiles (HTTP and HLS) with GPU transcoding can be found in `profiles_nvidia`:
44
-
45
-
* h264_360p
46
-
* h264_540p
47
-
* h264_720p
48
-
* h264_1080p
49
-
50
-
Profile names must match flowing regex: `^[0-9A-Za-z_-]+$`
62
+
In these profile directories, actual profiles are located in `hls/` and `http/`, depending on the output format requested. The profiles scripts detect hardware support by running ffmpeg. No special config needed to use hardware acceleration.
@@ -103,3 +115,34 @@ Input codec will be automatically determined from given stream. Please check you
103
115
| vc1 | vc1_cuvid | SMPTE VC-1 |
104
116
| vp8 | vp8_cuvid | On2 VP8 |
105
117
| vp9 | vp9_cuvid | Google VP9 |
118
+
119
+
## Alternatives
120
+
121
+
- [nginx-vod-module](https://github.com/kaltura/nginx-vod-module): Only supports MP4 sources.
122
+
- [tvheadend](https://tvheadend.org/): Intended for various live sources (IPTV or DVB), not media library - although it can record TV. Supports Nvidia acceleration, but it is hard to compile.
123
+
- [jellyfin](https://github.com/jellyfin/jellyfin): Supports live TV sources, although does not work realiably. Cannot run standalone transcoding service (without media library).
124
+
- Any suggestions?
125
+
126
+
## Contribute
127
+
128
+
Join us in the [Matrix space](https://matrix.to/#/#go-transcode:proxychat.net) (or the [#go-transcode-general](https://matrix.to/#/#go-transcode-general:proxychat.net) room directly) or [via XMPP bridge](xmpp:#go-transcode-general#[email protected]).
129
+
130
+
## Architecture
131
+
132
+
The source code is in the following files/folders:
133
+
134
+
- `cmd/` and `main.go`: source for the command-line interface
135
+
- `hls/`: process runner for HLS transcoding
136
+
- `internal/`: actual source code logic
137
+
138
+
*TODO: document different modules/packages and dependencies*
139
+
140
+
Other files/folders in the repositories are:
141
+
142
+
- `data/`: files used/served by go-transcode
143
+
- `dev/`: some docker helper scripts
144
+
- `profiles/`: the ffmpeg profiles for transcoding
145
+
- `tests/`: some tests for the project
146
+
- `Dockerfile`, `Dockerfile.nvidia` and `docker-compose.yaml`: for the docker lovers
147
+
- `god.mod` and `go.sum`: golang dependencies/modules tracking
0 commit comments