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/scanStart a scan for one specific libraries
POST
/api/libraries/scanStart a scan for all libraries
GET
/api/movies node-mongo-querystring supportGET
/api/movies/:uidPOST
/api/moviesPUD
/api/moviesDELETE
/api/movies
GET
/api/episodes node-mongo-querystring supportGET
/api/episodes/:uidPOST
/api/episodesPUD
/api/episodesDELETE
/api/episodes
GET
/api/shows node-mongo-querystring supportGET
/api/shows/:uidGET
/api/shows/:uid/seasonsGets all the seasons of a show
GET
/api/shows/:uid/seasons/:sidGets a season for a show the seasons of a show by uid or by number
GET
/api/shows/:uid/seasons/:sid/episodesGets episodes for a season in show
GET
/api/shows/:uid/episodesGets all episodes for a show
POST
/api/showsPUD
/api/showsDELETE
/api/shows
GET
/api/seasons node-mongo-querystring supportGET
/api/seasons/:uidPOST
/api/seasonsPUD
/api/seasonsDELETE
/api/seasons
GET
/stream/movie/:uidRange seekable raw stream for a movie
GET
/stream/episode/:uidRange seekable raw stream for an episode
GET
/transcode/movie/:uidExperimental live ffmpeg transcoding
GET
/transcode/episode/:uidExperimental live ffmpeg transcoding
Right 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_IDExperimental live ffmpeg hls transcoding
POST
/hls/movie/:uid/stop?session=SESSION_IDStop live ffmpeg hls transcoding
GET
/hls/episode/:uid/index.m3u8?session=SESSION_IDExperimental live ffmpeg hls transcoding
POST
/hls/episode/:uid/stop?session=SESSION_IDStop live ffmpeg hls transcoding
The 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/:uidExperimental live ffmpeg dash transcoding
GET
/dash/episode/:uidExperimental live ffmpeg dash transcoding
The 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 is no client detection right now so pick the right url to stream your video
- The codec detection only works in hls right now the other methods are there as a reference for later
- The codec detection is really bad and basic a simple if h264 ... I will add them later if needed
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 executebuild
first.build
: Runs thebabel
CLI to compile the app. Files are emitted todist/
.dev
: Runs the app in development mode - usesbabel-node
to compile on-the-fly. Also usesnodemon
to automatically restart when
- Francis Bélanger - inkubux
MIT.