An mini media server like plex/emby This server is still experimental and only for test purpose
826
An experimental mini media server like plex/emby. It tries to be fast light and easy.
MediaSpeed was inspired by
https://github.com/OwenRay/Remote-MediaServer
https://github.com/jansmolders86/mediacenterjs
https://github.com/MediaBrowser/Emby
Everything is still very experimental
Right now MediaSpeed is only a scraper/indexer with a rest API
To create libraries you need to post them with the API
The scanner does not start automatically, It can only be triggered by API
The scanning is stupid and will overwrite everything
The transcoding is really basic
Node v8.0 and above! is required
Mediaspeed will create a folder in your home ~/.media_speed/ open the config file
~/.media_speed/config.json
And put your tmdb api key in the file https://developers.themoviedb.org/3
Install the dependencies
yarn install
There is a REACT GUI in the frontend/ folder
to start it in dev mode use the following command in the root folder of the project
yarn dev
The gui will be available in the /web url path
yarn build
yarn start
curl -X POST \
http://localhost:500/api/libraries -d '{"path": "/media/Movies", "name":"Movies", "type":"movie"}'
curl -X POST http://localhost:500/api/libraries/scan
MediaSpeed tries to work with any directory structure, but it work best if you follow these simple rules
The movie naming convention should be Movie (year).extension eg: FooBar (2017).mkv
Let's say we have movie a named FooBar, theses 2 structure should work
/my/library/FooBar (2017).mkv
/my/library/FooBar (2017)/FooBar (2017).mkv
The TV Shows Naming convention should be Show Name S01E02 - Episode Title.extension eg: Foo Bar S01E02 - Episode Title.mkv
If you put a tv with the same name show in 2 different folders MediaSpeed will treat them as 2 different by design
The ideal tv show structure would be one or the other
/my/library/FooBar/Foo Bar S01E02 - Episode Title.mkv
/my/library/FooBar/Season 01/Foo Bar S01E02 - Episode Title.mkv
Each GET api uses node-mongo-querystring to filter list of resources
GET /api/libraries node-mongo-querystring supportGET /api/libraries/:uidPOST /api/librariesPUD /api/librariesDELETE /api/librariesPOST /api/libraries:id/scan Start a scan for one specific librariesPOST /api/libraries/scan Start a scan for all librariesGET /api/movies node-mongo-querystring supportGET /api/movies/:uidPOST /api/moviesPUD /api/moviesDELETE /api/moviesGET /api/episodes node-mongo-querystring supportGET /api/episodes/:uidPOST /api/episodesPUD /api/episodesDELETE /api/episodesGET /api/shows node-mongo-querystring supportGET /api/shows/:uidGET /api/shows/:uid/seasons Gets all the seasons of a showGET /api/shows/:uid/seasons/:sid Gets a season for a show the seasons of a show by uid or by numberGET /api/shows/:uid/seasons/:sid/episodes Gets episodes for a season in showGET /api/shows/:uid/episodes Gets all episodes for a showPOST /api/showsPUD /api/showsDELETE /api/showsGET /api/seasons node-mongo-querystring supportGET /api/seasons/:uidPOST /api/seasonsPUD /api/seasonsDELETE /api/seasonsGET /stream/movie/:uid Range seekable raw stream for a movieGET /stream/episode/:uid Range seekable raw stream for an episodeGET /transcode/movie/:uid Experimental live ffmpeg transcodingGET /transcode/episode/:uid Experimental live ffmpeg transcodingRight the transcoding is very basic and is not to clever. you can seek through a video by adding the q parameter like so ?q=2973.84760964912 it will seek the video file to this timestamp
(It will mess up the progress bar in the apps like vlc or kodi).
GET /hls/movie/:uid/index.m3u8?session=SESSION_ID Experimental live ffmpeg hls transcodingPOST /hls/movie/:uid/stop?session=SESSION_ID Stop live ffmpeg hls transcodingGET /hls/episode/:uid/index.m3u8?session=SESSION_ID Experimental live ffmpeg hls transcodingPOST /hls/episode/:uid/stop?session=SESSION_ID Stop live ffmpeg hls transcodingThe hls transcoder is very experimental and seeking sometime cause locking in the web player (hls.js and shaka.js)
It is inspired by how Emby does it. In fact it produce almost the same ffmpeg commands as Emby... They are the only ones working well for me. It creates a fake VOD m3u8 playlist with all the predicted segments and forces key frames with ffmpeg If the codec is not h264 it will transcode video and audio If the codec is h264 it will streamcopy the video but still encode the audio. (This can cause the webplayer to lock if you seek to much, because keyframes are not constant)
The goal of mediaspeed is not transcoding, so for now this method is what I call "Good enough" for streaming with a web player
GET /dash/movie/:uid Experimental live ffmpeg dash transcodingGET /dash/episode/:uid Experimental live ffmpeg dash transcodingThe dash transcoder is very experimental and seeking only works in player like vlc It is inspired by how Plex does it, but due to some missing flags in ffmpeg (starting segment number) (segment time shift) The seek does not work and probably never will... until ffmpeg add theses option (which are in the Plex transcoder) The seek works in VLC but will make MPV crash. So it's not recommended for now
The code is there as a reference, there is no "session handling" so you can't start 2 transcoding process of the same file
There are a few defined run scripts, here's a list of them with a description of what they do. To run them, simply execute npm run <script name> - e.g. npm run dev
start: Used by the production environment to start the app. This will run a compiled version, so you need to execute build first.build: Runs the babel CLI to compile the app. Files are emitted to dist/.dev: Runs the app in development mode - uses babel-node to compile on-the-fly. Also uses nodemon to automatically restart whenMIT.
Content type
Image
Digest
Size
122 MB
Last updated
over 8 years ago
docker pull inkubux/mediaspeed