Coder Social home page Coder Social logo

dusk-labs / dim Goto Github PK

View Code? Open in Web Editor NEW
3.7K 45.0 150.0 80.22 MB

Dim, a media manager fueled by dark forces.

License: GNU Affero General Public License v3.0

Shell 0.10% Dockerfile 0.25% Rust 53.21% JavaScript 20.58% HTML 0.18% SCSS 11.17% TypeScript 14.51%
mediamanager rust rust-lang reactjs

dim's Introduction

Dim

Dashboard Discord

Dim is a self-hosted media manager. With minimal setup, Dim will organize and beautify your media collections, letting you access and play them anytime from anywhere.

Running from binaries

Dependencies

  • libva2
  • libva-drm2
  • libharfbuzz
  • libfontconfig
  • libfribidi
  • libtheora
  • libvorbis
  • libvorbisenc
  • libtheora0

You can then obtain binaries from the release tab in github:

  1. Unpack with unzip ./release-linux.zip && tar -xvzf ./release.tar.gz
  2. Run cd release && ./dim
  3. Then you can access the Dim web UI through your browser with http://0.0.0.0:8000 (assuming it's running locally.)

Running with docker

The following command runs dim on port 8000, storing configuration in $HOME/.config/dim. You may change that path if you'd like to store configuration somewhere else. You can mount as many directories containing media as you like by repeating the -v HOST_PATH:CONTAINER_PATH option. In this example, the path /media on the host is made available at the same path inside the Docker container. This name "media" is arbitrary and you can choose whatever you like.

docker run -d -p 8000:8000/tcp -v $HOME/.config/dim:/opt/dim/config -v /media:/media:ro ghcr.io/dusk-labs/dim:dev

Mutiarch image resides at ghcr.io/dusk-labs/dim:master

To use hardware acceleration, mount the relevant device:

docker run -d -p 8000:8000/tcp -v $HOME/.config/dim:/opt/dim/config -v /media:/media:ro --device=/dev/dri/renderD128 ghcr.io/dusk-labs/dim:dev

Refer to docker-compose-template.yaml to run dim using Docker Compose.

Running from source

Dependencies

To run from source, you'll first need to install the following dependencies on your system:

  • sqlite
  • cargo
  • rustc (nightly)
  • yarn, npm
  • libssl-dev
  • libva2 (only if you're using Linux)
  • libva-dev (only if you're using Linux)
  • libva-drm2 (only if you're using Linux)
  • ffmpeg

Once the dependencies are installed, clone the repository and build the project:

git clone https://github.com/Dusk-Labs/dim
yarn --cwd ui/ && yarn --cwd ui/ build
mkdir utils && ln -nfs $(which ffmpeg) utils/ffmpeg && ln -nfs $(which ffprobe) utils/ffprobe

If you're on Linux, run dim with:

cargo run --features vaapi --release

On other platforms where libva isn't available, run dim with:

cargo run --release

License

Dim is licensed under the AGPLv3 license (see LICENSE.md or https://opensource.org/licenses/AGPL-3.0)

Screenshots

Login_Page Add_Library Modal Media_Page

dim's People

Contributors

beardednerd92 avatar brandonros avatar cadesalaberry avatar cobyge avatar d-volution avatar dependabot[bot] avatar dessalines avatar florimondmanca avatar gandous avatar heyhippari avatar igi-111 avatar intrepidpig avatar jeanzless avatar jimmycuadra avatar ldobbelsteen avatar liamdebellada avatar martadinata666 avatar mental32 avatar n-give avatar niamu avatar nicolascrop avatar nooobcoder avatar rich-murphey avatar rodrimarchese avatar sadstan avatar soupglasses avatar thaunknown avatar themooer1 avatar tobiasdebruijn avatar vgarleanu 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  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

dim's Issues

Add activity tab

The activity page is a page meant for administrators to see information about their server, what users are doing in Dim, if there are any transcoding sessions, the admin can see info about the stream, progress, performance and other information.

Improving the streaming routes

  • Add ability to specify an arbitrary timeout when fetching chunks at manifest creation. This could be useful for players that do not retry fetching a chunk if the chunk route returns 102 (such as mpv).

Fix video streaming

Currently video.js is very picky about streams. Streaming with nightfall works fine in MPV and Vlc, however its partially broken in browsers and more specifically video.js.

This is because video.js is very strict about segment continuity. Because of this seeking doesnt work, and hard timeouts (ffmpeg getting killed after a timeout instead of being issues a SIGSTP) have to be disabled. On further inspection video.js crashes because when ffmpeg is restarted with a new timestamp offset, the fragments it outputs also have a timestamp offset that is reset to 0, and because init.mp4 is never reloaded by videojs automatically video.js thinks that the segment requested is actually older than it is, thus it tries to fetch the next segment infinitely until it gets a valid segment timestamp offset.

We can fix this two ways, either we patch video.js to be more lenient, or when we seek in a non-transcoded region we restart video.js and reload the dash manifest (this needs to be paired with soft-timeouts for transcoding sessions).

nightfall: panics during streaming.

on the experimental branch fix-video-streaming I get playback halting it looks like its just buffering on the UI side but if you check out the server stderr I see panics in nightfall

Mar 24 21:35:10.404 INFO request, uri: "/api/v1/stream/9c374e3a-4d2e-4388-9dbd-38185ee28c60/data/5.m4s", method: Get
try wait, ffmpeg died, killing
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/mental/.cargo/git/checkouts/nightfall-b84a4513de79ba91/9ade607/src/lib.rs:177:53
Mar 24 21:35:38.464 INFO response, status: 500 Internal Server Error, route: GET /api/v1/stream/<id>/data/<chunk..> [2] (get_chunk)
try wait, ffmpeg died, killing
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/mental/.cargo/git/checkouts/nightfall-b84a4513de79ba91/9ade607/src/lib.rs:177:53
Mar 24 21:35:38.473 INFO response, status: 500 Internal Server Error, route: GET /api/v1/stream/<id>/data/<chunk..> [2] (get_chunk)

Handle cases where files dont have a title and we have to parse the root dir

Feb 21 09:04:34.064 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E08 Leap To Faith.mkv for lib=1
Feb 21 09:04:34.064 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.064 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E04 Existential Crisis.mkv for lib=1
Feb 21 09:04:34.065 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.065 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E03 Team Cockroach.mkv for lib=1
Feb 21 09:04:34.065 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.065 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E12 Somewhere Else.mkv for lib=1
Feb 21 09:04:34.066 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.066 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E11 The Burrito.mkv for lib=1
Feb 21 09:04:34.066 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.066 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E01 Everything Is Great!.mkv for lib=1
Feb 21 09:04:34.066 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.067 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E06 Janet And Michael.mkv for lib=1
Feb 21 09:04:34.067 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.067 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E09 Best Self.mkv for lib=1
Feb 21 09:04:34.067 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.067 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E10 Rhonda, Diana, Jake And Trent.mkv for lib=1
Feb 21 09:04:34.068 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.068 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E05 The Trolley Problem.mkv for lib=1
Feb 21 09:04:34.068 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.068 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E07 Derek.mkv for lib=1
Feb 21 09:04:34.069 ERRO Failed to mount file into the database: FilenameParserError
Feb 21 09:04:34.069 INFO Scanning file: /media/media3/debugging/Shows/The Good Place Season 2 1080p x264/S02E02 Dance Dance Resolution.mkv for lib=1
Feb 21 09:04:34.069 ERRO Failed to mount file into the database: FilenameParserError```

Libraries with duplicate paths don't get indexed

  • Create one library with a file path and set its media type to movies (name this "xxx")
  • Wait for indexing to complete
  • Create a second lib with the same file path as "xxx" but the media type is set to "Tv Shows"

Expected behavior: Instantly indexed due to already being indexed before so the results should be cached.

Actual behavior: Indexing never starts.

Streaming crashes in docker/latest ffmpeg

When streaming from docker the stream crashes because the init fragments for sessions is placed in the dim root and not the streaming cache directory.
I think this can be fixed by including a full path when passing the segment name to -hls_fmp4_init_filename

Streams crash after around chunk 380

Investigate why audio streams crash around this mark. Its something to do with processes being paused but mark as not paused.
This most likely has something to do with how we calculate the current chunk being transcoded.

As a temporary solution disabling timeouts for audio streams seems to fix the issue.

Add ability to pin metadata to files.

We should add a feature which either pins metadata to media automatically or manually, this can make scanning a library more efficient in the future because we can essentially cache all the correct metadata onto the file itself.

It will also make manual rematches effectively persistent unless overwritten, for large libraries this could be a life saver.

streaming: clean tmp streaming cache after ffmpeg dies.

Some people mount their tmpfs to 10TB drives, others (like me) have it at a few gigabytes. when the cache fills up playback perpetually fails until the cache is empty.

We should clean the streaming cache on a playback exit.

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.