izderadicka / audioserve

Simple personal server to serve audiofiles files from folders. Intended primarily for audio books, but anything with decent folder structure will do.
709 stars 35 forks source link

Prebuilt windows release #40

Open MagicfTail opened 3 years ago

MagicfTail commented 3 years ago

I am with my current setup not able to run docker, it would thus be really helpful to have a prebuilt windows release available, especially since the current instructions don't work according to some other issues.

izderadicka commented 3 years ago

I personally do not use windows for audioserve and windows build instruction was provided by kind contributor in #28 - you can try to check with that contributor. As code is now it'll not provide all functionality for sure and basically nothing is guaranteed in windows. Instruction are including just if somebody wants to play with it. I will keep this issue open as an placeholder is somebody will want to commit some effort to windows compatibility.

izderadicka commented 3 years ago

27 even contains some windows build

rudifus commented 2 years ago

I have found that rust lang install path has changed from C:\Program Files/ path to user space path, C:/Users/username/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/lib where ffmpeg audio libs to be copied. as described in docs/windows-build.md

rudifus commented 2 years ago

AudioServe windoes build was OK.

when executed - several things to do yet:

  1. when audioserve.exe is started - it returns error on missing av- DLLs. so I have copied those DLLs from shared build of windows FFMPEG, i.e. ffmpeg https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n4.4-latest-win64-gpl-shared-4.4.zip contained there in bin'subdirectory
avformat-58.dll   avdevice-59.dll   swscale-6.dll
avutil-56.dll     postproc-56.dll
avfilter-8.dll    avcodec-59.dll    swresample-4.dll
  1. renamed those av-* .dll file index as required by the error message

  2. entry point function áv_register_all() not found in .exe file as mentioned in some of ffmpeg projects - it is deprecated Solution: simply I have commented out invocation of it within init()

    pub fn init() {
    unsafe {
        ffi::av_log_set_level(ffi::AV_LOG_QUIET);
        // ffi::av_register_all()
    }
    }

    in crates\media_info\src\lib.rs

audioserve.exe launches without error on Windows 10 64 bit now

izderadicka commented 2 years ago

@rudifus Thanks, looks promising. Still I'd suspect that not everything will be working as expected. Though I've tried not to use *nix only things (maybe with exceptions of signals on few places) , still I've been kind on relying on how linux works. Definitely need to be tested thoroughly. Do at least unit test worked - e.g. cargo test?

rudifus commented 2 years ago

@izderadicka cargo test --no-default-features

     Finished test [unoptimized + debuginfo] target(s) in 6.96s
     Running unittests (target\debug\deps\audioserve-a88fae109fe63c7f.exe)

running 10 tests
test services::auth::tests::test_token ... ok
test services::auth::tests::test_json_login ... [2022-01-27T09:30:53Z ERROR audioserve::services::auth] Invalid base64 in authentication token invalid length at 4 in string aaaaa
ok[2022-01-27T09:30:53Z ERROR audioserve::services::auth] Incorrectly formed login token - 0 parts

[2022-01-27T09:30:53Z ERROR audioserve::services::auth] Invalid authentication: invalid shared secret, client: None
test config::tests::test_transcoding_profile_deserialize ... ok
test config::tests::test_default_serialize ... ok
test config::cli::test::test_from_config ... ok
test config::cli::test::test_basic_args ... ok
test services::transcode::tests::test_transcode_seek ... FAILED
test services::transcode::tests::test_transcode_span ... FAILED
test services::transcode::tests::test_transcode ... FAILED
test services::auth::tests::test_authenticator_login ... ok

failures:

---- services::transcode::tests::test_transcode_seek stdout ----
Command is Command { std: "ffmpeg" "-nostdin" "-v" "error" "-accurate_seek" "-ss" "0.8" "-i" "./test_data/01-file.mp3" "-y" "-map_metadata" "-1" "-map" "a" "-acodec" "libopus" "-vbr" "on" "-ac" "1" "-b:a" "32k" "-compression_level" "5" "-cutoff" "12000" "-f" "opus" "pipe:1", kill_on_drop: false }
thread 'services::transcode::tests::test_transcode_seek' panicked at 'assertion failed: `(left == right)`
  left: `4294967295`,
 right: `1`', src\services\transcode\mod.rs:571:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- services::transcode::tests::test_transcode_span stdout ----
Command is Command { std: "ffmpeg" "-nostdin" "-v" "error" "-accurate_seek" "-ss" "0.2" "-t" "1.6999999" "-i" "./test_data/01-file.mp3" "-y" "-map_metadata" "-1" "-map" "a" "-acodec" "libopus" "-vbr" "on" "-ac" "1" "-b:a" "32k" "-compression_level" "5" "-cutoff" "12000" "-f" "opus" "pipe:1", kill_on_drop: false }
thread 'services::transcode::tests::test_transcode_span' panicked at 'assertion failed: `(left == right)`
  left: `4295`,
 right: `2`', src\services\transcode\mod.rs:571:25

---- services::transcode::tests::test_transcode stdout ----
Command is Command { std: "ffmpeg" "-nostdin" "-v" "error" "-i" "./test_data/01-file.mp3" "-y" "-map_metadata" "-1" "-map" "a" "-acodec" "libopus" "-vbr" "on" "-ac" "1" "-b:a" "32k" "-compression_level" "5" "-cutoff" "12000" "-f" "opus" "pipe:1", kill_on_drop: false }
thread 'services::transcode::tests::test_transcode' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `2`', src\services\transcode\mod.rs:571:25

failures:
    services::transcode::tests::test_transcode
    services::transcode::tests::test_transcode_seek
    services::transcode::tests::test_transcode_span

test result: FAILED. 7 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.51s

error: test failed, to rerun pass '--bin audioserve'