With Streamproxy you can watch livestreams from YouTube, Twitch (and any other source supported by Streamlink) in IPTV apps like:
- SSIPTV
- tvheadend
- ProgTV
- and others
Current release: 2.0.3
To start the server, run from command prompt:
streamproxyThis repository includes a Chrome extension in chrome-extension-streamproxy that helps you add the current tab URL as a StreamServer in StreamProxy.
- Open
chrome://extensions. - Enable Developer mode (top right).
- Click Load unpacked.
- Select the
chrome-extension-streamproxyfolder from this repository. - Pin the extension and open its options page.
- Configure StreamProxy URL (example:
http://127.0.0.1:4211) and, if needed, Basic Auth credentials.
- A packaged file may be available as
chrome-extension-streamproxy.crx. - Depending on your Chrome policy/version, direct CRX install can be blocked.
- If blocked, use the Load unpacked method above.
- Open a stream page in Chrome.
- Click the extension icon.
- Review the fields and click Add streamserver.
If StreamProxy Basic Auth is enabled, use an account with permission for
POST /api/streamserver.
In your favorite IPTV app, use one of the following URL patterns.
http://<serverip>:<port>/videostream/streamlink?url=<livestreamurl>
- Livestream will be routed from a live stream URL to any URL compatible with Streamlink.
- Video and audio codecs are passthroughed.
Query parameters:
url=> the URL of livestreamstreamserver=> create a streamserver (&streamserver=<name>)- You can use
http://<serverip>:<port>/streamserver/createto create using wizard
- You can use
Example:
http://localhost:3000//videostream/streamlink?url=https://www.youtube.com/c/SkyNews/live
To display the Sky News live stream on your IPTV app.
http://<serverip>:<port>/videostream/ffmpeg?url=<livestreamurl>
- The livestream will be routed and transcoded to MPEG-2 TS format from a live stream URL supported by ffmpeg.
Query parameters:
url=> the URL of livestreamstreamserver(optional) => create a streamserver (&streamserver=<name>)- You can use
http://<serverip>:<port>/streamserver/createto create using wizard
- You can use
videoformat(optional) => output livestream format- if omitted: use config
- if not in config: default
mpegts
videocodec(optional) => output video codec- if omitted: use config
- if not in config: default
mpeg2
framesize(optional) => output frame size- if omitted: use input stream frame size
framerate(optional) => output frame rate- if omitted: use input stream frame rate
serviceprovider(optional) => output service provider- if omitted: use config
- if not in config: default
streamproxy
streamdescription(optional) => stream description (service name)- if omitted: default
streamproxyservice
- if omitted: default
Example:
http://localhost:3000/videostream/ffmpeg?url=https://rbmn-live.akamaized.net/hls/live/590964/BoRB-AT/master.m3u8
To display Red Bull TV in MPEG2 TS format on your IPTV app.
http://<serverip>:<port>/audiostream/play?url=<livestreamurl>
- Convert video livestream to audio livestream (
mp3format). - You can listen to YouTube channels as radio-like streams.
Query parameters:
url=> the URL of livestreamstreamserver(optional) => create a streamserver (&streamserver=<name>)- You can use
http://<serverip>:<port>/streamserver/createto create using wizard
- You can use
runner(optional) => what runner will be used:streamlinkorffmpeg- if omitted, streamproxy chooses the best runner
title(optional) => title of audio livestream- if omitted, default is
streamproxy audio
- if omitted, default is
Example:
http://localhost:3000/videostream/info?url=https://rbmn-live.akamaized.net/hls/live/590964/BoRB-AT/master.m3u8
Converts Red Bull TV to a streaming radio station.
NOTE: On Windows, converting videostream to audiostream is only possible using ffmpeg (not streamlink).
http://<serverip>:<port>/youtubetopodcast/<channelid>?apikey=<youtubeapikey>
- Convert a YouTube channel into a podcast.
Parameters:
<channelid>=> YouTube channel id to convert to podcast<youtubeapikey>=> you need a YouTube API key- In addition to query string, key can be set with:
- Environment variable
YOUTUBE_API_KEY(useful in Docker) streamproxy.config.jsontagyoutubeapikey
- Environment variable
- In addition to query string, key can be set with:
Notes:
- OBS1: This endpoint is alpha and has known issues:
- episode total length may not be shown
- server can crash if fast-forward/rewind is used
- OBS2: This endpoint is only available when streamproxy is installed on Linux.
http://<serverip>:<port>/videostream/play?url=<livestreamurl>
- Convert a streamlink stream to MPEG-2 TS.
Query parameters:
url=> the URL of livestreamstreamserver(optional) => create a streamserver (&streamserver=<name>)- You can use
http://<serverip>:<port>/streamserver/createto create using wizard
- You can use
videoformat(optional) => output livestream format- if omitted: use config
- if not in config: default
mpegts
videocodec(optional) => output video codec- if omitted: use config
- if not in config: default
mpeg2
framesize(optional) => output frame size- if omitted: input stream frame size
framerate(optional) => output frame rate- if omitted: input stream frame rate
serviceprovider(optional) => output service provider- if omitted: use config
- if not in config: default
streamproxy
streamdescription(optional) => stream description (service name)- if omitted: default
streamproxyservice
- if omitted: default
Example:
http://localhost:3000//videostream/streamlink?url=https://www.youtube.com/c/SkyNews/live
To display Sky News stream in MPEG-2 TS format.
Note: due to compatibility issues, this endpoint cannot run if server is installed on Windows.
http://<serverip>:<port>/snapshot.jpg?url=<livestreamurl>
- Capture a snapshot of stream to jpeg image.
Query parameters:
url=> livestream URLresolution=> image resolution- if omitted: original stream resolution
Example:
http://localhost:3000/snapshot.jpg?url=?url=https://www.youtube.com/c/SkyNews/live
Returns a jpeg snapshot of Sky News stream.
http://<serverip>:<port>/streamserver/create
- A streamserver allows one thread/process to feed several clients using same streamproxy port.
- Access playback URL as:
http://<serverip>:<port>/play/<servername> - To close a streamserver session, kill corresponding process in
/status. - Compatible with streamlink, ffmpeg and videostream-to-audiostream conversion.
Important: prefer http://<serverip>:<port>/streamserver/list because it already includes create option.
- Direct access to
/streamserver/createand/streamserver/editwill be removed in a future release.
http://<serverip>:<port>/streamserver/list
- Manage created streamservers.
- You can list, stop, start, edit, delete and create new streamservers.
http://<serverip>:<port>/streamserver/playlist.m3u
- Download all mounted streamservers in M3U playlist format.
http://<serverip>:<port>/videostream/restream?url=<livestream>&output=<outputaddress>&format=<format>&vcode=<videocoded>&acodec=<audiocodec>
- Restream a livestream to another address (for example RTMP).
URL parameters:
<livestream>: source livestream URL- on Linux can be streamlink or ffmpeg-compatible
- on Windows only ffmpeg-compatible streams are accepted
<outputaddress>: destination livestream address- example: YouTube RTMP, nginx RTMP, HTTP livestream server, etc.
<format>: livestream format (mpeg2-ts,hls,mp3, etc.)<videocodec>: video codec (mp4,mpeg2,h264, etc.)- optional, if omitted it is copied from source
<audiocodec>: audio codec (mp3,aac, etc.)- optional, if omitted it is copied from source
Notes:
- This endpoint is in beta and may be removed in future versions
- Example:
http://localhost:3000/videostream/restream?url=https://www.youtube.com/c/SkyNews/live&output=rtmp://localhost:4113/live&format=mpeg2ts&vcode=mpeg2&acodec=mp3- Restreams Sky News YouTube channel to
rtmp://localhost:4113/live
- This endpoint must be called from browser
- To kill session, kill corresponding process in
/status
http://<serverip>:<port>/user/list- user list and management (create, edit, delete)
http://<serverip>:<port>/user/create- create a new user
http://<serverip>:<port>/changepassword- change your own password
- OBS: currently you can only change your own password.
- If you forgot password, go to users file, remove your user, assign administrator role to
anonymous, access/user/list, recreate your user.
- If you forgot password, go to users file, remove your user, assign administrator role to
http://<serverip>:<port>/status- see status of opened process
http://<serverip>:<port>/login- login (if
basicAuthenticationis present in config)
- login (if
http://<serverip>:<port>/logout- logout (if
basicAuthenticationis present in config)
- logout (if
http://<serverip>:<port>/log- display log (see parameter
logWebin config)
- display log (see parameter
http://<serverip>:<port>/stopserver- shutdown streamproxy server
To see list of available APIs:
http://<serverip>:<port>/docs/api- https://asabino.stoplight.io/docs/streamproxy/34dd32710e316-streamproxy
You can modify program parameters in streamproxy.config.json (same folder as executable).
{
"port": "3000",
"logconsole": true,
"logWeb": false,
"streamlinkpath": "",
"ffmpegpath": "",
"youtubeapikey": "",
"ffmpeg": {
"codec": "mpeg2video",
"format": "mpegts",
"serviceprovider": "streamproxy"
},
"streamserver": {
"startOnInvoke": false,
"hideStoppedStreamServerInPlaylist": true,
"stopOnNoConnection": true
},
"basicAuthentication": {
"active": true,
"users": [
{
"username": "teste",
"password": "teste2"
}
]
}
}Obsolete example from old versions:
"token": "yourtoken"(optional)
Parameter notes:
port: listening port of serverlogConsole(true|false): output log to consolelogWeb(true|false): output log tohttp://<serverip>:<port>/logstreamlinkpath: streamlink app pathffmpegpath: ffmpeg app pathyoutubeapikey: your YouTube API key- used if not set in environment variable
- currently used by YouTube-to-podcast feature
codec: video codec for ffmpeg transcoded streamformat: video container for ffmpeg transcoded streamserviceprovider: service provider metadata for transcoded streamstartOnInvoke: iftrue, stopped streamserver will start when called; iffalse, returns HTTP 500hideStoppedStreamServerInPlaylist: iftrue, hide stopped streamservers in/streamserver/playlist.m3u; iffalse, show allstopOnNoConnection: stop streamserver if no clients are connected- In addition to token (obsolete), you can create logins for endpoint access.
- Uses Basic Authentication.
- IPTV URL format with auth:
http://<username>:<password>@<IP>:<port>/videostream/streamlink?url=<url address from the live stream>
- Token is now obsolete and may be removed in future versions.
OBS: You can set directory of streamproxy.config.json, streamproxy.authroles.json, streamproxy.users.json, streamproxy.streamservers.json using environment variable STREAMPROXY_DATA_DIR.
Authorization roles file. You can modify existing roles or create new ones.
[
{
"name": "basic",
"description": "Basic Authorization",
"authorizations": [
{
"endpoint": "/",
"methods": ["GET"]
},
{
"endpoint": "/about",
"methods": ["GET"]
}
]
},
{
"name": "basicWatchers",
"description": "Basic Watches",
"authorizations": [
{
"endpoint": "/videostream/*",
"methods": ["GET"]
},
{
"endpoint": "/audiostream/play",
"methods": ["GET"]
}
]
},
{
"name": "streamserverWatchersbasic",
"description": "Stream Server Watchers Basic (without playlist Download)",
"authorizations": [
{
"endpoint": "/play/*",
"methods": ["GET"]
}
]
},
{
"name": "playlistdownloader",
"description": "Playlist Downloader",
"authorizations": [
{
"endpoint": "/streamserver/playlist.m3u",
"methods": ["GET"]
}
]
},
{
"name": "streamserverWatchersfull",
"description": "Stream Server Watchers Full (with playlist Download)",
"authorizations": [
{
"endpoint": "/play/*",
"methods": ["GET"]
},
{
"endpoint": "/streamserver/playlist.m3u",
"methods": ["GET"]
}
]
},
{
"name": "administrator",
"description": "Administrator",
"authorizations": [
{
"endpoint": "*",
"methods": ["GET", "POST", "PUT", "DELETE", "PATCH"]
}
]
}
]Fields:
name: role namedescription: role descriptionauthorizations: endpoints and methods authorized for this role (wildcard allowed)
OBS: You can also set this file directory using STREAMPROXY_DATA_DIR.
Stores all users created in streamproxy.
When file does not exist, it is created with:
anonymous(basic role, no password)admin(passwordadmin, administrator role)
[
{
"username": "anonymous",
"password": "",
"fullname": "Anonymous",
"authorizations": {
"basic": true,
"basicWatchers": true,
"streamserverWatchersbasic": false,
"playlistdownloader": false,
"streamserverWatchersfull": false,
"administrator": false
}
},
{
"username": "admin",
"password": "*********",
"fullname": "Administrator",
"authorizations": {
"administrator": true
}
}
]Recommendations:
- Prefer using user manager (
/user/list) instead of editing file directly. - If
basicAuthenticationis enabled in config file, users there are automatically migrated tostreamproxy.users.json.
OBS: You can also set this file directory using STREAMPROXY_DATA_DIR.
Via CLI
docker run -d --name streamproxy \
-p 4211:4211 \
-v ./data:/data \
-v ./config.txt:/config.txt \
-e YOUTUBE_API_KEY={YOUTUBE_API} \
asabino2/streamproxyDocker Compose
version: '3'
services:
streamproxy:
image: asabino2/streamproxy
container_name: streamproxy
ports:
- "4211:4211"
volumes:
- ./data:/data
- ./config.txt:/config.txt:rw
environment:
- YOUTUBE_API_KEY=${YOUTUBE_API}
restart: unless-stopped
config.txtis the config file of streamlink β see streamlink documentation for more details.
Use
YOUTUBE_API_KEYto set the YouTube key for the "convert YouTube channel to podcast" feature.
If you find this app useful, please consider donating to support development.
PayPal
Bitcoin
1ABDdCp7rrkDa2tAtLwW6diNU2XqAxw7fB
- Streamproxy supports dynamic streamserver sessions and multi-client streaming over one source.
- Some endpoints are Linux-only due to streamlink/transcoding compatibility.
- Use
/statusto monitor and terminate background processes.