40 Commits
Author SHA1 Message Date
CDrummond 703e39508c Update lofty to 0.9.0 2022-12-20 09:25:45 +00:00
CDrummond eb16d8379d Update bliss-rs 2022-10-22 11:49:39 +01:00
CDrummond a220b4d0c5 Update bliss-rs and lofty-rs 2022-10-04 17:06:52 +01:00
CDrummond 6d61616dda Update lofty version 2022-08-21 08:55:23 +01:00
CDrummond d85424d27c Update lofty to 0.7.3 2022-08-04 22:26:32 +01:00
CDrummond 144c8a7ffe Update version of tag reader library. 2022-07-03 20:17:36 +01:00
CDrummond ab0adc96ca Show analysis results on a new line after progress. Just show
"Finished!" as last progress message.
Issue #5
2022-06-19 17:53:24 +01:00
CDrummond 7cf62c3ad0 Fix chmod call 2022-06-18 10:18:46 +01:00
CDrummond d9841b3527 Copy files within docker 2022-06-18 10:00:10 +01:00
CDrummond 3b6872b2a0 Place ARM binaries in bin sub-folder 2022-06-18 09:05:00 +01:00
CDrummond 45b20902d6 Merge branch 'master' into linux-arm 2022-06-18 08:44:47 +01:00
CDrummond 9feb80bbd1 Download arm builds 2022-06-18 08:44:17 +01:00
CDrummond b9b8fdabfc Add script to launch arm for correct arch 2022-06-18 08:40:17 +01:00
CDrummond a818628706 Add other deps 2022-06-18 08:05:44 +01:00
CDrummond 370c533a49 Revery to using docker, and add changes from chincheta0815 - #3 2022-06-18 07:55:54 +01:00
CDrummond 9aae7825d0 No sudo on bullseye either... 2022-06-16 20:18:25 +01:00
CDrummond ebddf8febe Use sudo for mount 2022-06-16 19:35:43 +01:00
CDrummond 143fb2bf62 bullseye? 2022-06-16 19:34:42 +01:00
CDrummond 323978cbeb tmpfs? 2022-06-16 19:26:22 +01:00
CDrummond a749c03195 source $HOME/.cargo/env 2022-06-16 19:16:42 +01:00
CDrummond bfd2a44e2e Download rust? #3 2022-06-16 19:05:46 +01:00
CDrummond 943227c16b Update run-on-arch-action version. #3 2022-06-16 18:32:39 +01:00
CDrummond b7259cd0ae Install cargo? #3 2022-06-16 18:01:19 +01:00
CDrummond f023faa336 Alternate method 2022-06-13 13:21:25 +01:00
CDrummond 074be07d18 Rust 2021? 2022-06-13 13:08:18 +01:00
CDrummond a12971df17 Split docker runs? 2022-06-13 12:53:32 +01:00
CDrummond 8ba10a0f8e nightly? 2022-06-13 12:51:09 +01:00
CDrummond cf0e6cf5fb edition2021 requires nightly 2022-06-13 12:47:57 +01:00
CDrummond de2c2dfaa3 Add "cargo-features = ["edition2021"]" at top 2022-06-13 12:39:44 +01:00
CDrummond 1a45791e58 cargo-features = ["edition2021"] ???? 2022-06-13 12:24:23 +01:00
CDrummond b5f35dcf36 Build for Linux ARM 2022-06-13 12:02:25 +01:00
CDrummond cd12e805c3 More compact 2022-05-28 17:50:19 +01:00
CDrummond fa87a7e135 Fix checking if CUE already analysed.
Issue #2
2022-05-28 17:24:09 +01:00
CDrummond df17032377 Fix Job names 2022-05-26 12:08:52 +01:00
CDrummond e47c2b477e Single run command 2022-05-26 12:07:18 +01:00
CDrummond 133e3e2204 Produce ffmpeg 4 and 5 builds for Linux 2022-05-26 12:04:15 +01:00
CraigD 3dec74d328 Mention password protected LMS access 2022-05-21 10:11:17 +01:00
CDrummond cb323f3efe Increment version 2022-05-21 10:04:10 +01:00
CDrummond 69303d62c6 Update lofty 2022-05-21 09:30:09 +01:00
CDrummond f05e11da2e Add Fedora deps instructions 2022-05-21 09:24:00 +01:00
12 changed files with 208 additions and 59 deletions

No files matched your search

+48 -4
View File
@@ -7,7 +7,7 @@ env:
CARGO_TERM_COLOR: always
jobs:
Linux:
Linux_ffmpeg4:
runs-on: ubuntu-20.04
steps:
@@ -15,8 +15,8 @@ jobs:
uses: actions/checkout@v1
- name: Packages
run: sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg
run: sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y
- name: Build
run: |
cargo build --release
@@ -30,9 +30,53 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bliss-analyser-linux
name: bliss-analyser-linux-x86-ffmpeg4
path: releases/
Linux_ffmpeg5:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Packages
run: sudo add-apt-repository ppa:savoury1/ffmpeg4 -y && sudo add-apt-repository ppa:savoury1/ffmpeg5 -y && sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y
- name: Build
run: |
cargo build --release
strip target/release/bliss-analyser
mkdir releases
cp target/release/bliss-analyser releases/bliss-analyser
cp UserGuide.md releases/README.md
cp LICENSE releases/
cp configs/linux.ini releases/config.ini
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bliss-analyser-linux-x86-ffmpeg5
path: releases/
Linux_ARM:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build ARM
run: |
docker build -t bliss-analyser-cross - < docker/Dockerfile
docker run --rm -v $PWD/target:/build -v $PWD:/src bliss-analyser-cross
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: bliss-analyser-linux-arm
path: releases/
macOS:
runs-on: macos-11.0
Generated
+45 -35
View File
@@ -113,7 +113,7 @@ dependencies = [
[[package]]
name = "bliss-analyser"
version = "0.2.0"
version = "0.2.2"
dependencies = [
"anyhow",
"argparse",
@@ -134,9 +134,9 @@ dependencies = [
[[package]]
name = "bliss-audio"
version = "0.5.0"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "947fa29cb8c27448497bdbcbab05a9eb3c1f046a5efd7b684060a6dc587bb761"
checksum = "613c60447405cd2639c1525fddcdf259b99dfa2e083178b4594ad15db78b50cf"
dependencies = [
"bliss-audio-aubio-rs",
"crossbeam",
@@ -454,9 +454,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
[[package]]
name = "ffmpeg-next"
version = "5.0.2"
version = "5.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70a1fc87054b079ade0b081b023c5fef309cd4bbcb569c09eed2aa39b25a0a11"
checksum = "a80971eee67be0079a1c8890bde68226fe9bd0441740fd6ddd0cee131486b321"
dependencies = [
"bitflags",
"ffmpeg-sys-next",
@@ -465,9 +465,9 @@ dependencies = [
[[package]]
name = "ffmpeg-sys-next"
version = "5.0.1"
version = "5.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ba12dea33516e30c160ce557c7e43dd857276368eb1cd0eef4fce6529f2dee5"
checksum = "d780b36e092254367e2f1f21191992735c8e23f31a5a5a8678db3a79f775021f"
dependencies = [
"bindgen",
"cc",
@@ -479,13 +479,11 @@ dependencies = [
[[package]]
name = "flate2"
version = "1.0.22"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
dependencies = [
"cfg-if",
"crc32fast",
"libc",
"miniz_oxide",
]
@@ -695,24 +693,37 @@ dependencies = [
[[package]]
name = "lofty"
version = "0.6.1"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45967792fc531850b544d0e50065ffda8ce814a0d2142a6cbe7009961964e17c"
checksum = "8242df2d720c7f2e23bb7829da4447e5a762ccf0a361a01efe1433f554a48400"
dependencies = [
"base64",
"byteorder",
"cfg-if",
"flate2",
"lofty_attr",
"log",
"ogg_pager",
"once_cell",
"paste",
]
[[package]]
name = "log"
version = "0.4.14"
name = "lofty_attr"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
checksum = "3d0d19de3efdb768ecdccb6e904eb4c089ee9c1b59684d09218802e16cae8cc7"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if",
]
@@ -761,12 +772,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.4.4"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
dependencies = [
"adler",
"autocfg",
]
[[package]]
@@ -907,9 +917,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.10.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "opaque-debug"
@@ -1007,11 +1017,11 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.36"
version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
dependencies = [
"unicode-xid",
"unicode-ident",
]
[[package]]
@@ -1029,9 +1039,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.15"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [
"proc-macro2",
]
@@ -1303,13 +1313,13 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.86"
version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b"
checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
"unicode-ident",
]
[[package]]
@@ -1405,6 +1415,12 @@ version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f"
[[package]]
name = "unicode-ident"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf"
[[package]]
name = "unicode-normalization"
version = "0.1.19"
@@ -1420,12 +1436,6 @@ version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99"
[[package]]
name = "unicode-xid"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "untrusted"
version = "0.7.1"
+4 -4
View File
@@ -1,8 +1,8 @@
[package]
name = "bliss-analyser"
version = "0.2.0"
version = "0.2.2"
authors = ["Craig Drummond <craig.p.drummond@gmail.com>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0-only"
description = "Analyse audio files with bliss-rs"
repository = "https://github.com/CDrummond/bliss-analyser"
@@ -10,14 +10,14 @@ keywords = ["audio", "song", "similarity"]
readme = "README.md"
[dependencies]
bliss-audio = "0.5.0"
bliss-audio = { version = "0.6.5", features = [] }
argparse = "0.2.2"
anyhow = "1.0.40"
rusqlite = { version = "0.25.0", features = ["bundled"] }
log = "0.4.14"
env_logger = "0.8.4"
indicatif = "0.16.2"
lofty = "0.6.1"
lofty = "0.9.0"
dirs = "1"
chrono = "0.4.19"
regex = "1"
+10
View File
@@ -1,3 +1,13 @@
0.2.2
-----
1. Update version of tag reader library.
2. Update version of bliss library.
0.2.1
-----
1. Update version of tag reader library.
2. Fix checking if CUE already analysed.
0.2.0
-----
1. Tidy up code, thanks to Serial-ATA
+5
View File
@@ -16,6 +16,11 @@ To install dependencies on a Debian system:
apt install -y clang libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev libavdevice-dev pkg-config
```
To install dependencies on a Fedora system:
```
dnf install ffmpeg-devel clang pkg-config
```
Build with `cargo build --release`
+2 -1
View File
@@ -109,7 +109,8 @@ music folders may be specified via `music_1`, `music_2`, `music_3`, and `music_4
* `db` specifies the name and location of the database file used to store the
analysis results. This will default to `bliss.db` in the current folder.
* `lms` specifies the hostname, or IP address, of your LMS server. This is used
when uploading the database file to LMS. This defaults to `127.0.0.1`
when uploading the database file to LMS. This defaults to `127.0.0.1` If your LMS is
password protected then use `user:pass@server` - e.g. `lms=pi:abc123@127.0.0.1`
* `ignore` specifies the name and location of a file containing items to ignore
in mixes. See the `Ignore` section later on for more details.
+36
View File
@@ -0,0 +1,36 @@
# Cross compilation environment for bliss-mixer
FROM debian:bullseye
RUN dpkg --add-architecture arm64 && \
dpkg --add-architecture armhf
RUN apt-get update
RUN apt-get install -y curl git pkg-config yasm
RUN apt-get install -y build-essential clang
RUN apt-get install -y crossbuild-essential-armhf crossbuild-essential-arm64
RUN apt-get install -y libavutil-dev:arm64 libavcodec-dev:arm64 libavformat-dev:arm64 \
libavfilter-dev:arm64 libavdevice-dev:arm64 libswresample-dev:arm64 libfftw3-dev:arm64
RUN apt-get install -y libavutil-dev:armhf libavcodec-dev:armhf libavformat-dev:armhf \
libavfilter-dev:armhf libavdevice-dev:armhf libswresample-dev:armhf libfftw3-dev:armhf
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin/:${PATH}"
RUN rustup target add aarch64-unknown-linux-gnu && \
rustup target add arm-unknown-linux-gnueabihf
RUN mkdir /.cargo && \
echo '[target.aarch64-unknown-linux-gnu]\nlinker = "aarch64-linux-gnu-gcc"' > /.cargo/config && \
echo '[target.arm-unknown-linux-gnueabihf]\nlinker = "arm-linux-gnueabihf-gcc"' >> /.cargo/config
RUN mkdir /build
ENV CARGO_TARGET_DIR /build
ENV CARGO_HOME /build/cache
RUN mkdir /src
WORKDIR /src
CMD ["/src/docker/docker-build.sh"]
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
## #!/usr/bin/env bash
set -eux
uname -a
DESTDIR=/src/releases
mkdir -p $DESTDIR/bin
rm -rf $DESTDIR/bin/*
function build {
echo Building for $1 to $3...
if [[ ! -f /build/$1/release/bliss-analyser ]]; then
export RUST_BACKTRACE=full
export PKG_CONFIG=${1//unknown-/}-pkg-config
BINDGEN_EXTRA_CLANG_ARGS="--sysroot /usr/${1//unknown-/}" cargo build --release --target $1
fi
$2 /build/$1/release/bliss-analyser && cp /build/$1/release/bliss-analyser $DESTDIR/$3
}
build arm-unknown-linux-gnueabihf arm-linux-gnueabihf-strip bin/bliss-analyser-armhf
build aarch64-unknown-linux-gnu aarch64-linux-gnu-strip bin/bliss-analyser-aarch64
cp UserGuide.md $DESTDIR/README.md
cp LICENSE $DESTDIR/
cp configs/linux.ini $DESTDIR/config.ini
cp scripts/bliss-analyser-arm $DESTDIR/bliss-analyser
+4 -2
View File
@@ -11,7 +11,7 @@ import datetime, os, requests, shutil, subprocess, sys, tempfile, time
GITHUB_TOKEN_FILE = "%s/.config/github-token" % os.path.expanduser('~')
GITHUB_REPO = "CDrummond/bliss-analyser"
GITHUB_ARTIFACTS = ["bliss-analyser-linux", "bliss-analyser-mac", "bliss-analyser-windows"]
GITHUB_ARTIFACTS = ["bliss-analyser-linux-x86-ffmpeg4", "bliss-analyser-linux-x86-ffmpeg5", "bliss-analyser-linux-arm", "bliss-analyser-mac", "bliss-analyser-windows"]
def info(s):
print("INFO: %s" %s)
@@ -69,7 +69,7 @@ def download_artifacts(version):
def make_executable(version):
cwd = os.getcwd()
for a in ["bliss-analyser-linux", "bliss-analyser-mac"]:
for a in ["bliss-analyser-linux-x86-ffmpeg4", "bliss-analyser-linux-x86-ffmpeg5", "bliss-analyser-linux-arm", "bliss-analyser-mac"]:
archive = "%s-%s.zip" % (a, version)
info("Making analyser executable in %s" % archive)
with tempfile.TemporaryDirectory() as td:
@@ -77,6 +77,8 @@ def make_executable(version):
os.remove(archive)
os.chdir(td)
subprocess.call(["chmod", "a+x", "%s/bliss-analyser" % td], shell=False)
if a == "bliss-analyser-linux-arm":
subprocess.call(["chmod", "a+x", "%s/bin/bliss-analyser-armhf" % td, "%s/bin/bliss-analyser-aarch64" % td], shell=False)
shutil.make_archive("%s/%s-%s" % (cwd, a, version), "zip")
os.chdir(cwd)
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
ARCH=`arch`
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
if [ "$ARCH" = "aarch64" ] ; then
$SCRIPT_DIR/bin/bliss-analyser-aarch64 $*
else
$SCRIPT_DIR/bin/bliss-analyser-armhf $*
fi
+12 -10
View File
@@ -58,13 +58,15 @@ fn check_dir_entry(db: &mut db::Db, mpath: &Path, entry: DirEntry, track_paths:
cue_file.set_extension("cue");
if cue_file.exists() {
// For cue files, check if first track is in DB
let mut track_path = pb.clone();
let mut cue_track_path = pb.clone();
let ext = pb.extension().unwrap().to_string_lossy();
track_path.set_extension(format!("{}{}1", ext, db::CUE_MARKER));
let db_track = String::from(track_path.to_string_lossy());
if let Ok(id) = db.get_rowid(&db_track) {
if id<=0 {
track_paths.push(String::from(cue_file.to_string_lossy()));
cue_track_path.set_extension(format!("{}{}1", ext, db::CUE_MARKER));
if let Ok(cue_track_stripped) = cue_track_path.strip_prefix(mpath) {
let cue_track_sname = String::from(cue_track_stripped.to_string_lossy());
if let Ok(id) = db.get_rowid(&cue_track_sname) {
if id<=0 {
track_paths.push(String::from(cue_file.to_string_lossy()));
}
}
}
} else {
@@ -94,15 +96,14 @@ pub fn analyse_new_files(db: &db::Db, mpath: &PathBuf, track_paths: Vec<String>)
log::info!("Analysing new files");
for (path, result) in analyze_paths(track_paths) {
let pbuff = PathBuf::from(&path);
let stripped = pbuff.strip_prefix(mpath).unwrap();
let stripped = path.strip_prefix(mpath).unwrap();
let spbuff = stripped.to_path_buf();
let sname = String::from(spbuff.to_string_lossy());
progress.set_message(format!("{}", sname));
let mut inc_progress = true; // Only want to increment progress once for cue tracks
match result {
Ok(track) => {
let cpath = String::from(path);
let cpath = String::from(path.to_string_lossy());
match track.cue_info {
Some(cue) => {
match track.track_number {
@@ -164,7 +165,8 @@ pub fn analyse_new_files(db: &db::Db, mpath: &PathBuf, track_paths: Vec<String>)
}
}
progress.finish_with_message(format!("{} Analysed. {} Failure(s).", analysed, failed.len()));
progress.finish_with_message("Finished!");
log::info!("{} Analysed. {} Failure(s).", analysed, failed.len());
if !failed.is_empty() {
let total = failed.len();
failed.truncate(MAX_ERRORS_TO_SHOW);
+3 -3
View File
@@ -20,7 +20,7 @@ pub fn read(track: &String) -> db::Metadata {
..db::Metadata::default()
};
if let Ok(file) = lofty::read_from_path(Path::new(track), true) {
if let Ok(file) = lofty::read_from_path(Path::new(track)) {
let tag = match file.primary_tag() {
Some(primary_tag) => primary_tag,
None => file.first_tag().expect("Error: No tags found!"),
@@ -32,8 +32,8 @@ pub fn read(track: &String) -> db::Metadata {
meta.album_artist = tag.get_string(&ItemKey::AlbumArtist).unwrap_or_default().to_string();
meta.genre = tag.genre().unwrap_or_default().to_string();
// Check whether MP3 as numeric genre, and if so covert to text
if file.file_type().eq(&lofty::FileType::MP3) {
// Check whether MP3 has numeric genre, and if so covert to text
if file.file_type().eq(&lofty::FileType::MPEG) {
match tag.genre() {
Some(genre) => {
let test = genre.parse::<u8>();