GithubHelp home page GithubHelp logo

rustymedia's Introduction

Rustymedia

Rustymedia is a media server. It mimics the DLNA protocol and should work with most DLNA clients.

Usage

# Serve two directories.
cargo run -- --local 'My Videos'=~/Videos --local 'Other Stuff'=/mnt/usb/vids

# See all options.
cargo run -- --help

Transcoding

The server automatically transcodes to formats that the client supports (if required). Right now only a couple of clients are recognized. Other clients get a "safe" profile which is likely to work.

Recent transcodes are cached as anonymous files in /tmp, kill the server to clear the cache.

rustymedia's People

Contributors

dependabot-preview[bot] avatar gdamjan avatar kevincox avatar misuzu 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rustymedia's Issues

Panic on socket connect on MacOS Mojave

MacOS 10.14.2
rustc 1.31.1 (b6c32da9b 2018-12-18)

Panics at socket.connect("239.255.255.250:1900").unwrap(); in src/dlna/discovery.rs.

$ RUST_BACKTRACE=1 target/debug/rustymedia -l stuff=~/Movies | pbcopy
Listening on http://[fe80::c2c:d1e:7cd:7918]:4950/
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }', libcore/result.rs:1009:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: <std::panicking::begin_panic::PanicPayload<A> as core::panic::BoxMeUp>::get
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: std::panicking::try::do_call
             at libstd/panicking.rs:325
   7: core::ptr::drop_in_place
             at libcore/panicking.rs:77
   8: core::alloc::Layout::repeat
             at libcore/macros.rs:26
   9: futures::task_impl::NotifyHandle::new
             at libcore/result.rs:808
  10: <hyper::proto::request::Request>::body
             at src/dlna/discovery.rs:13
  11: rustymedia::result_main
             at src/bin/rustymedia.rs:94
  12: rustymedia::main
             at src/bin/rustymedia.rs:103
  13: std::rt::lang_start::{{closure}}
             at libstd/rt.rs:74
  14: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  15: panic_unwind::imp::find_eh_action::{{closure}}
             at libpanic_unwind/lib.rs:102
  16: std::alloc::default_alloc_error_hook
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  17: std::rt::lang_start
             at libstd/rt.rs:74
  18: rustymedia::main

Cannot build on MacOS

MacOS 10.14.1

I suspect may be an issue I need to raise at https://github.com/meh/rust-ffmpeg instead, but just putting it out there.

I was hoping to work on #4 as my first Rust contribution (thanks for the label), but obviously won't get far if I can't build as is!

$ cargo version
cargo 1.30.0 (a1a4ad372 2018-11-02)
$ rustc --version
rustc 1.30.1 (1433507eb 2018-11-07)
$ cargo build
   Compiling cfg-if v0.1.4
   Compiling rustc-serialize v0.3.24
   Compiling term v0.4.6
   Compiling unicode-xid v0.0.3
   Compiling void v1.0.2
   Compiling nodrop v0.1.12
   Compiling libc v0.2.42
   Compiling memoffset v0.2.1
   Compiling bitflags v0.5.0
   Compiling ucd-util v0.1.1
   Compiling regex v0.2.11
   Compiling byteorder v1.2.3
   Compiling scopeguard v0.3.3
   Compiling lazy_static v1.0.2
   Compiling lazycell v0.6.0
   Compiling slab v0.4.0
   Compiling utf8-ranges v1.0.0
   Compiling futures v0.1.23
   Compiling version_check v0.1.4
   Compiling unicode-xid v0.1.0
   Compiling glob v0.2.11
   Compiling pnet_base v0.21.0
   Compiling httparse v1.3.2
   Compiling serde v1.0.70
   Compiling scoped-tls v0.1.2
   Compiling nix v0.10.0
   Compiling take v0.1.0
   Compiling slab v0.3.0
   Compiling pnet v0.21.0
   Compiling try-lock v0.1.0
   Compiling smallvec v0.2.1
   Compiling bitflags v1.0.3
   Compiling safemem v0.2.0
   Compiling bitflags v0.7.0
   Compiling rustc-demangle v0.1.9
   Compiling ipnetwork v0.12.8
   Compiling percent-encoding v1.0.1
   Compiling dtoa v0.4.3
   Compiling linked-hash-map v0.4.2
   Compiling strsim v0.6.0
   Compiling bitflags v0.9.1
   Compiling itoa v0.4.2
   Compiling language-tags v0.2.2
   Compiling smallvec v0.6.2
   Compiling log v0.4.3
   Compiling crossbeam-utils v0.3.2
   Compiling unreachable v1.0.0
   Compiling arrayvec v0.4.7
   Compiling regex-syntax v0.5.6
   Compiling iovec v0.1.2
   Compiling memchr v2.0.1
   Compiling net2 v0.2.33
   Compiling num_cpus v1.8.0
   Compiling rand v0.4.2
   Compiling pnet_sys v0.21.0
   Compiling time v0.1.40
   Compiling unicase v2.1.0
   Compiling proc-macro2 v0.4.8
   Compiling pnet_macros_support v0.21.0
   Compiling base64 v0.9.2
   Compiling xml-rs v0.3.6
   Compiling syntex_pos v0.42.0
   Compiling backtrace v0.3.9
   Compiling lru-cache v0.1.1 (https://github.com/kevincox/lru-cache.git?branch=entry-api#f4aa4662)
   Compiling tokio-executor v0.1.2
   Compiling tokio-service v0.1.0
   Compiling relay v0.1.1
   Compiling nix v0.9.0
   Compiling thread_local v0.3.5
   Compiling log v0.3.9
   Compiling want v0.0.4
   Compiling bytes v0.4.8
   Compiling aho-corasick v0.6.6
   Compiling futures-cpupool v0.1.8
   Compiling crossbeam-epoch v0.4.3
   Compiling pnet_datalink v0.21.0
   Compiling mio v0.6.15
   Compiling rand v0.3.22
   Compiling quote v0.6.3
   Compiling error-chain v0.11.0
   Compiling tokio-timer v0.2.4
   Compiling syntex_errors v0.42.0
   Compiling tokio-io v0.1.7
   Compiling crossbeam-deque v0.3.1
   Compiling syn v0.14.4
   Compiling tokio-reactor v0.1.2
   Compiling tokio-codec v0.1.0
   Compiling syntex_syntax v0.42.0
   Compiling tokio-threadpool v0.1.5
   Compiling mime v0.3.8
   Compiling env_logger v0.4.3
   Compiling tokio-tcp v0.1.0
   Compiling os_pipe v0.6.1
   Compiling tokio-udp v0.1.1
   Compiling serde-xml-rs v0.2.1
   Compiling serde_json v1.0.24
   Compiling tokio-fs v0.1.2
   Compiling serde_derive v1.0.70
   Compiling tokio v0.1.7
   Compiling tokio-core v0.1.17
   Compiling tokio-proto v0.1.1
   Compiling tokio-file-unix v0.4.2
   Compiling hyper v0.11.27
   Compiling docopt v0.8.3
   Compiling syntex v0.42.2
   Compiling pnet_macros v0.21.0
   Compiling pnet_packet v0.21.0
   Compiling pnet_transport v0.21.0
   Compiling rustymedia v0.1.0 (/Users/me/git/rustymedia)
error[E0425]: cannot find value `O_TMPFILE` in this scope
   --> src/ffmpeg.rs:350:47
    |
350 |         { use nix::fcntl::*; O_APPEND | O_CLOEXEC | O_TMPFILE | O_RDWR },
    |                                                     ^^^^^^^^^ not found in this scope

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
error: Could not compile `rustymedia`.

To learn more, run the command again with --verbose.

Detect Device Type

It would be good to detect the device type and transcode appropriately. It would also be nice to default to no transcoding if we don't know about the device, or maybe try to pick a "safe" or "common" set but that will probably never work.

Path is not expanded

When using ~ as in the example --local 'My Videos'=~/Videos no content is listed.
Absolute path works.

Limit Cache Size

Right now it is unlimited (until the server restarts). It would be good to have a cap.

Ideas:

  • Limit by disk space.
  • Limit by disk space available.
  • Limit by number of entries.
  • Purge cheaper transcodes first (audio/container only).

Just making an N file cache is probably good enough for a long time, the other features can be added later.

Persistent Cache

It would be nice to have the cache survive across server restarts. Although it is also kinda nice to have a clean state on restart, so we would probably have to at least add a cache purge option.

Does this compile on FreeBSD

Hi,
Can you provide compile details ? Can the server compile and run on FreeBSD ?
Does it support subtitles when transcoding ? What formats are supported ?

Best regards

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.