• Stars
    star
    585
  • Rank 73,801 (Top 2 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created about 9 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A UPnP DLNA Digital Media Server that includes basic video transcoding. Tested on a Panasonic Viera television, several Android UPnP apps, and Chromecast.

dms

dms is a UPnP DLNA Digital Media Server. It runs from the terminal, and serves content directly from the filesystem from the working directory, or the path given. The SSDP component will broadcast and respond to requests on all available network interfaces.

dms advertises and serves the raw files, in addition to alternate transcoded streams when it's able, such as mpeg2 PAL-DVD and WebM for the Chromecast. It will also provide thumbnails where possible.

dms also supports serving dynamic streams (e.g. a live rtsp stream) generated on the fly with the help of an external application (e.g. ffmpeg).

dms uses ffprobe/avprobe to get media data such as bitrate and duration, ffmpeg/avconv for video transoding, and ffmpegthumbnailer for generating thumbnails when browsing. These commands must be in the PATH given to dms or the features requiring them will be disabled.

https://i.imgur.com/qbHilI7.png

Installing

Assuming $GOPATH and Go have been configured already:

$ go get github.com/anacrolix/dms

Ensure ffmpeg/avconv and/or ffmpegthumbnailer are in the PATH if the features depending on them are desired.

To run:

$ "$GOPATH"/bin/dms

Running DMS using Docker

dms is distributed as Docker Image. Serve Media in /mediadirectory using dms:

docker pull ghcr.io/anacrolix/dms:latest
docker run -d --network host -v /mediadirectory:/dmsdir ghcr.io/anacrolix/dms:latest

Running DMS as a systemd service

A sample systemd .service file has been provided to assist in running DMS as a system service.

Running DMS as a FreeBSD service

Install the provided service file to /etc/rc.d or /usr/local/etc/rc.d add dms_enable="YES", and optionally dms_root="/path/to/my/media" and dms_user="myuser" to your /etc/rc.conf

Known Compatible Players and Renderers

  • Probably all Panasonic Viera TVs.
  • Android's BubbleUPnP and AirWire
  • Chromecast
  • VLC
  • LG Smart TVs, with varying success.
  • Roku devices

Usage of dms:

Usage
parameter description
-allowDynamicStreams turns on support for .dms.json files in the path
-allowedIps string allowed ip of clients, separated by comma
-config string json configuration file
-deviceIcon string device icon
-fFprobeCachePath string path to FFprobe cache file (default "/home/efreak/.dms-ffprobe-cache")
-forceTranscodeTo string force transcoding to certain format, supported: 'chromecast', 'vp8'
-friendlyName string server friendly name
-http string http server port (default ":1338")
-ifname string specific SSDP network interface
-ignoreHidden ignore hidden files and directories
-ignoreUnreadable ignore unreadable files and directories
-logHeaders log HTTP headers
-noProbe disable media probing with ffprobe
-noTranscode disable transcoding
-notifyInterval duration interval between SSPD announces (default 30s)
-path string browse root path
-stallEventSubscribe workaround for some bad event subscribers
-transcodeLogPattern pattern where to write transcode logs to. The [tsname] placeholder is replaced with the name of the item currently being played. The default is $HOME/.dms/log/[tsname]. You may turn off transcode logging entirely by setting it to /dev/null. You may log to stderr by setting /dev/stderr.

Dynamic streams

DMS supports "dynamic streams" generated on the fly. This feature can be activated with the -allowDynamicStreams command line flag and can be configured by placing special metadata files in your content directory. The name of these metadata files ends with .dms.json, their structure is documented here.

An example:

{
  "Title": "My awesome webcam",
  "Resources": [
     {
        "MimeType": "video/webm",
        "Command": "ffmpeg -i rtsp://10.6.8.161:554/Streaming/Channels/502/ -c:v copy -c:a copy -movflags +faststart+frag_keyframe+empty_moov -f matroska -"
     }
  ]
}

More Repositories

1

torrent

Full-featured BitTorrent client package and utilities
Go
5,279
star
2

dht

dht is used by anacrolix/torrent, and is intended for use as a library in other projects both torrent related and otherwise
Go
296
star
3

confluence

Torrent client as a HTTP service
Go
224
star
4

utp

Use anacrolix/go-libutp instead
Go
171
star
5

go-libutp

Go wrapper of libutp reference uTP C implementation
C++
87
star
6

missinggo

Stuff that's missing in Go stdlib, or hasn't made it into its own repo.
Go
83
star
7

stm

Software Transactional Memory in Go
Go
69
star
8

possum

concurrent disk-backed cache supporting efficient direct file I/O, transactions, and snapshots using file cloning and sparse files
Rust
56
star
9

godo

godo is an improved `go run`
Go
37
star
10

btlink

a HTTP(s) addressing scheme for BitTorrent
Go
29
star
11

cove

A combined BitTorrent frontend and DHT indexer for personal use
21
star
12

envpprof

Allows run time configuration of Go's pprof features and default HTTP mux using environment variables.
Go
17
star
13

squirrel

Go sqlite3 cache
Go
17
star
14

sqlrpc

SQL over RPC, specifically for SQLite
Go
10
star
15

tagflag

declarative flag parsing for Go using struct tags
Go
10
star
16

gasp

Clojure-inspired LISP implemented in Go
Go
8
star
17

ffprobe

Go ffprobe wrapper
Go
8
star
18

sync

A sync package clone that provides pprof debugging of sync.Mutex to help with diagnosing deadlocks.
Go
8
star
19

transcoder

http transcoder microservice
Haskell
8
star
20

castlink

Elm
8
star
21

mmsg

Exposes batch message receives (recvmmsg)
Go
7
star
22

archive

Dumping ground for code from before I really used VCS, or doesn't go anywhere else
Visual Basic
6
star
23

various

Some code I muck about with.
Erlang
6
star
24

go-libp2p-dht-tool

readline-like CLI utility to operate on stand-alone libp2p DHT node instance
Go
6
star
25

log

context-style logging for Go. similar to zerolog but with lots of allocations
Go
5
star
26

generics

wow
Go
4
star
27

imdbrt

Show RT rating on IMDB pages
JavaScript
4
star
28

lsan

Go leak sanitizer/memory address sanitizer helper
Go
3
star
29

dog

Go
2
star
30

dms-gtk-gui

GTK+ GUI for anacrolix/dms
Go
2
star
31

thinfs

A modern "FAT64" with better performing design.
C
2
star
32

harkon

A whitespace lisp interpretter
C++
2
star
33

http-ping

An actually useful HTTP ping tool
Go
2
star
34

wat

Tests of behaviour in the language and standard library
Go
2
star
35

webtorrent-public

Public parts of anacrolix/webtorrent
Go
2
star
36

ipfslog

A minimal wrapper around IPFS logging
Go
2
star
37

bargle

Aleena beware!
Go
2
star
38

bitmap

1
star
39

gorond

GROND!! GROND!! Code formatter for Go
Go
1
star
40

gostdapp

Go
1
star
41

goanna

Yet another Go dumping ground.
Go
1
star
42

haskell-dht

Mucking around with DHT using Haskell
Haskell
1
star
43

publicip

Go
1
star
44

multiless

Helper for partial ordering in Go
Go
1
star
45

chansync

Go
1
star
46

parser

Go
1
star
47

porssh

i did a haskell
Haskell
1
star
48

sassy

trippa snippa filesystem trimmer
Go
1
star
49

haskell

Haskell
1
star
50

boltextra

Enhancements and utilities for bolt
Go
1
star
51

goproxy

HAProxy but not arcane
Go
1
star
52

tlsterm

TLS termination with just command-line flags
Go
1
star
53

pydlnadms

Automatically exported from code.google.com/p/pydlnadms
Python
1
star
54

aragorn

BitTorrent tracker using Redis and Go
1
star