Coder Social home page Coder Social logo

magnetikonline / docker-acestream-server Goto Github PK

View Code? Open in Web Editor NEW
127.0 5.0 35.0 20 KB

Ace Stream server Docker image and playback CLI for media players.

Home Page: https://hub.docker.com/r/magnetikonline/acestream-server/

License: MIT License

Shell 17.08% Python 72.69% Dockerfile 10.23%
acestream acestream-engine python vlc vlc-media-player docker

docker-acestream-server's Introduction

Docker Ace Stream server

An Ace Stream server Docker image.

Overview

What this provides:

  • Dockerized Ace Stream server (version 3.1.49) running under Debian 8 (Jessie) slim.
  • Bash script to start server and present HTTP API endpoint to host.
  • Python playback script playstream.py instructing server to:
    • Commence streaming of a given program ID.
    • ...and optionally start a compatible media player (such as VLC) to view stream.

Since a single HTTP endpoint exposed from the Docker container controls the server and provides the output stream, this provides one of the easier methods for playback of Ace Streams on traditionally unsupported operating systems such as macOS.

Building

To build Docker image:

$ ./build.sh

Alternatively pull the Docker Hub image:

$ docker pull magnetikonline/acestream-server:3.1.49_debian_8.11

Usage

Start the server via:

$ ./run.sh

For Linux hosts the alternative run-tmpfs.sh is recommended, mounting the cache directory into a temporary based tmpfs file system. This saves thrashing of the file system as stream contents is written to disk - which does not seem possible to disable via server launch arguments.

Server will now be available from http://127.0.0.1:6878:

$ curl http://127.0.0.1:6878/webui/api/service?method=get_version
# {"result": {"code": 3014900, "platform": "linux", "version": "3.1.49"}, "error": null}

A program ID can be started with playstream.py:

$ ./playstream.py --help
usage: playstream.py [-h] --ace-stream-pid HASH [--player PLAYER] [--progress]
                     [--server HOSTNAME] [--port PORT]

Instructs server to commence a given program ID. Will optionally execute a
local media player once playback has started.

optional arguments:
  -h, --help            show this help message and exit
  --ace-stream-pid HASH
                        program ID to stream
  --player PLAYER       media player to execute once stream active
  --progress            continue to output stream statistics (connected
                        peers/transfer rates) every 2 seconds
  --server HOSTNAME     server hostname, defaults to 127.0.0.1
  --port PORT           server HTTP API port, defaults to 6878

For example, to stream PROGRAM_ID and send playback to vlc when ready:

$ ./playstream.py \
	--ace-stream-pid PROGRAM_ID \
	--player /usr/bin/vlc \
	--progress

Awaiting successful connection to stream
Waiting... [Peers: 5 // Down: 80KB // Up: 0KB]
Waiting... [Peers: 40 // Down: 343KB // Up: 4KB]
Ready!

Playback available at [http://127.0.0.1/XXXX]
Starting media player...

Streaming... [Peers: 18 // Down: 467KB // Up: 16KB]

Send Ctrl + C to exit.

Reference

docker-acestream-server's People

Contributors

magnetikonline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-acestream-server's Issues

WebUI

Hey!

Is the web user interface (WebUI) available in this assembly?
For example as in this repo: acestream-armv7:
http://<IP>:6878/webui/app/ReplaceMe/server#proxy-server-settings

Missing .so non-fatal errors when acestreamengine starts

Hi, me again :)

Maybe you noticed the missing .so non-fatal errors when acestreamengine starts. I don't know if these errors matter, I think they only matter when you re-encode streams, which shouldn't be necessary with most players because they play anything and don't require re-encoding.

Anyway, this fixes it: echo '/opt/acestream/lib' >> /etc/ld.so.conf && /sbin/ldconfig

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Do you know what this error means?

$ python3 ~/bin/playstream.py --player vlc --ace-stream-pid 925393f1fbb771d74e358d0a8c4adcca35addce4

Connecting to program ID [925393f1fbb771d74e358d0a8c4adcca35addce4]
Traceback (most recent call last):
  File "/home/user/bin/playstream.py", line 188, in <module>
    main()
  File "/home/user/bin/playstream.py", line 169, in main
    statistics_url, playback_url = start_stream(
  File "/home/user/bin/playstream.py", line 99, in start_stream
    response = api_request(
  File "/home/user/bin/playstream.py", line 91, in api_request
    return json.load(response).get("response", {})
  File "/usr/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.8/json/__init__.py", line 343, in loads
    s = s.decode(detect_encoding(s), 'surrogatepass')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

buffer directory location...

hi,
i hope this question is not too silly... where is acestream buffer saved?
i mean, if i leave vlc player paused for a couple of hours and then i start to play it back where does it read from?
thanks!

Redirect to http://cdnmg.secure.live.rtr-vesti.ru/live/smil:r1.smil/chunklist_b1600000.m3u8

Something weird is going on with the latest server docker image

When requesting a json from the server - it redirects to some external url:

http://cdnmg.secure.live.rtr-vesti.ru/live/smil:r1.smil/chunklist_b1600000.m3u8

Which seems to be a real unicast from the broadcaster, and not the p2p stream

$ curl -v "http://127.0.0.1:6878/ace/getstream?format=json&sid=c8af0ae75297f0159c18d88e299556015c19d064&id=925393f1fbb771d74e358d0a8c4adcca35addce4"
*   Trying 127.0.0.1:6878...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 6878 (#0)
> GET /ace/getstream?format=json&sid=c8af0ae75297f0159c18d88e299556015c19d064&id=925393f1fbb771d74e358d0a8c4adcca35addce4 HTTP/1.1
> Host: 127.0.0.1:6878
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Server: BaseHTTP/0.3 Python/2.7.9
< Date: Fri, 18 Feb 2022 15:57:47 GMT
< Location: http://cdnmg.secure.live.rtr-vesti.ru/live/smil:r1.smil/chunklist_b1600000.m3u8
< Access-Control-Allow-Origin: *
* no chunk, no close, no size. Assume close to signal end
< 
* Closing connection 0
Redirect to http://cdnmg.secure.live.rtr-vesti.ru/live/smil:r1.smil/chunklist_b1600000.m3u8

ImportError: cannot import name pysegmenter

Hello,

I am trying to install this Ace Stream server by Docker.
But i am getting pysegmenter error when i run ./run.sh
This is the full log.

2020-05-02 15:30:27,172|MainThread|acestream|init segmenter failed
Traceback (most recent call last):
  File "core.c", line 333, in 
ImportError: cannot import name pysegmenter
2020-05-02 15:30:27,193|MainThread|acestream|platform=linux
2020-05-02 15:30:27,194|MainThread|acestream|app=acestream
2020-05-02 15:30:27,194|MainThread|acestream|version=3.1.49 code=3014900 revision=365f84f date=2019-07-11
2020-05-02 15:30:27,194|MainThread|acestream|use_local_db=True
2020-05-02 15:30:27,194|MainThread|acestream|use_m2crypto=True
2020-05-02 15:30:27,195|MainThread|acestream|is_gui_mode=0
2020-05-02 15:30:27,201|MainThread|acestream|enable debug: 0
2020-05-02 15:30:27,222|MainThread|acestream|get_default_api_version: 2
2020-05-02 15:30:27,233|MainThread|acestream.coreapp|use fixed i2i_port: 62062
2020-05-02 15:30:27,233|MainThread|acestream.coreapp|state_dir=u'/root/.ACEStream'
2020-05-02 15:30:27,596|MainThread|acestream.coreapp|set_debug_from_ui: level=0
2020-05-02 15:30:27,616|MainThread|acestream|enable debug: 0
2020-05-02 15:30:27,626|MainThread|acestream.coreapp|cannot load session config, use default
2020-05-02 15:30:27,682|MainThread|acestream.SocketHandler.InterruptSocket|bound on 127.0.0.1:37620
2020-05-02 15:30:27,683|MainThread|acestream.SocketHandler.SocketHandler|bind: socket bound: host=0.0.0.0 port=8621
2020-05-02 15:30:27,683|MainThread|acestream.LM|listen on 8621
2020-05-02 15:30:27,683|MainThread|acestream.localdb|No existing database found. Attempting to creating a new database u'/root/.ACEStream/sqlite/torrentstream.sdb'
2020-05-02 15:30:28,025|MainThread|acestream.VideoServer|start: addr= port=6878 allow_remote=0 allow_intranet=1
2020-05-02 15:30:29,245|ServiceTaskQueueThread-2|acestream.Session|sync_time: no response
2020-05-02 15:30:29,268|MainThread|acestream.SocketHandler.InterruptSocket|bound on 127.0.0.1:55499
2020-05-02 15:30:29,268|MainThread|acestream.SocketHandler.SocketHandler|bind: socket bound: host=0.0.0.0 port=62062
2020-05-02 15:30:29,268|Instance2InstanceThread-30|acestream.APIServer|run: ready to receive remote commands on 62062
2020-05-02 15:53:34,489|Thread-41|acestream.RequestBroker|process_dash_request:manifest: error
Traceback (most recent call last):
  File "core.c", line 940, in 
  File "ACEStream/Core/Session.py", line 485, in start_live_download
  File "ACEStream/Core/APIImplementation/LaunchManyCore.py", line 421, in add_live_download
DuplicateDownloadException: <class 'ACEStream.Core.exceptions.DuplicateDownloadException'>: None
2020-05-02 15:53:38,631|Thread-43|acestream.RequestBroker|process_dash_request:manifest: error
Traceback (most recent call last):
  File "core.c", line 940, in 
  File "ACEStream/Core/Session.py", line 485, in start_live_download
  File "ACEStream/Core/APIImplementation/LaunchManyCore.py", line 421, in add_live_download
DuplicateDownloadException: <class 'ACEStream.Core.exceptions.DuplicateDownloadException'>: None
2020-05-02 15:53:40,593|Thread-44|acestream.RequestBroker|process_dash_request:manifest: error

Please help me.

Thank you!

Multiple connection to stream

Setup is working perfectly if only one VLC instance connects to the stream, however any additional connection get's thrown an error upon trying to open the network stream.

Is there any solution for this?

The image could be trimmed

Hi! I was using your image for a while but I thought it could be trimmed. I created my own image based on yours to test this and I was able to reduce the size by ~ 100 MB. In case you're interested:

  • Use debian-slim instead of debian and manually install required packages (net-tools)
  • Don't automatically install recommended packages using --no-install-recommends
  • Use python-lxml instead of libxslt1.1 (huge package)
  • Clean up apt-get update using rm -rf /var/lib/apt/lists/*

Stop streaming

Is there any way to stop streaming a content id, without stopping the entire container?

Additional question, if I use the playstream.py twice, with a different content id, will it stream both, or just play the last one?

Possible to use on headless server

Hi - getting some good results so far, but is it possible to launch playstream.py without launching a local media player? I'd like to have the docker image and playstream.py on a remote headless server, then use vlc on another computer to play the stream.

I get this error when running build.sh

=> ERROR [2/2] RUN DEBIAN_FRONTEND="noninteractive" apt-get update && apt-get --yes upgrade && apt-get --no-install-recommends --yes install curl libpython2.7 net-tools python-apsw python-lxml pyt 5.5s

[2/2] RUN DEBIAN_FRONTEND="noninteractive" apt-get update && apt-get --yes upgrade && apt-get --no-install-recommends --yes install curl libpython2.7 net-tools python-apsw python-lxml python-m2crypto python-pkg-resources && apt-get clean && rm --force --recursive /var/lib/apt/lists && curl --silent "http://acestream.org/downloads/linux/acestream_3.1.49_debian_8.11_x86_64.tar.gz" | tar --extract --gzip:
5.033 Ign http://security.debian.org jessie/updates InRelease

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.