Code Monkey home page Code Monkey logo

av-metrics's Introduction

Rust-AV

Actions Status CodeCov dependency status IRC LICENSE

Pure-rust implementation of multimedia primitives and eventually some examples of demuxers, muxers and codecs.

Compiling

cargo build --workspace

Running tests

cargo test --workspace

Examples

Examples can be found in the examples repository.

Notes

The code is still in flux and the API is getting slowly fleshed out, please refer to the sub-crates. Until we reach version 1.0 assume that the API could change a lot.

License

Released under the MIT License.

Developing

I suggest to use the cargo paths override to have a local rust-av:

# Clone the trees
$ git clone https://github.com/rust-av/rust-av
$ git clone https://github.com/rust-av/${other package}
# Setup the override
$ cd ${other package}
$ mkdir .cargo
$ echo 'paths=["../rust-av"]' > .cargo/config
# Check it is doing the right thing
$ cargo build

Getting in Touch

Come chat with us on our IRC channel clicking the badge above! You can also use a web client to join with a web browser.

Otherwise, you can open a new discussion explaining your idea or problem as best as possible.

av-metrics's People

Contributors

decathorpe avatar dependabot-preview[bot] avatar dvermd avatar dwbuiten avatar freezylemon avatar lu-zero avatar luni-4 avatar monst12 avatar shssoichiro avatar vibhoothi 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

av-metrics's Issues

SSIM should consider pixel aspect ratio

Daala's dump_ssim script considers the input pixel aspect ratio of a video for its calculations. av-metrics doesn't, but it should. This requires at least one new test where the input and output have differing PARs.

Failed to install when fetching from Cargo

When we try to install av-metrics with the help of the command
cargo install av-metrics-tool
it fails to install, error log

/home/mindfreeze/.cargo/registry/src/github.com-1ecc6299db9ec823/av-metrics
-tool-0.7.0/src/main.rs:359:34
    |
359 |	  fn calculate_video_metric<D: Decoder>(
    |				       ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
1   | use av_metrics::video::decode::Decoder;
    |
1   | use crate::decode::Decoder;
    |

error[E0405]: cannot find trait `Decoder` in this scope

Full Error Log: https://paste.debian.net/plain/1185456

When we clone and build it works fine.

At the same time when we try to install like cargo install av-metrics alone, it does not work as mentioned in the readme, it is advised to have av-metrics-tool. So if we fix the confusion of having two av-metrics when we try to fix it will be better.
error: specified package av-metrics v0.6.2 has no binaries

0.5.1 was a hard API break; should be 0.6 - breaks semver

It should be reverterted, tagged as 0.5.2, and then pushed again, and tagged ast 0.6.0 properly.

e.g. see:

   Compiling av-metrics v0.4.0
error[E0107]: wrong number of lifetime arguments: expected 0, found 1
  --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/av-metrics-0.4.0/src/video/decode/y4m.rs:28:40
   |
28 | impl<R: Read> Decoder for y4m::Decoder<'_, R> {
   |                                        ^^ unexpected lifetime argument

error: aborting due to previous error

For more information about this error, try `rustc --explain E0107`.
error: could not compile `av-metrics`.

Move to err-derive

I doubt we'll ever need the backtrace facility failure provides and I moved away the rest of rust-av from it since the failure crate had been in the list of the bloat-delivering ones.

C library can no longer be built

The latest cargo-c cannot build av-metrics:

~/av-metrics$ cargo cbuild  --version
cargo-c 0.6.5
~/av-metrics$ cargo cinstall --prefix=/some/path
Error: CliError { error: Some(manifest path `/path/av-metrics/Cargo.toml` is a virtual manifest, but this command requires running against an actual package in this workspace), exit_code: 101 }
~/av-metrics$

CIEDE2000 reports infinity for long videos

Tested against pair of 5000 frame 720p clips.

PSNR - Y: 50.1176  U: 54.2056  V: 54.5304  Avg: 51.1303
APSNR - Y: 50.8060  U: 54.7653  V: 55.1817  Avg: 51.7696
PSNR HVS - Y: 51.2208  U: 52.7011  V: 52.5036  Avg: 48.1122
SSIM - Y: 24.6719  U: 25.0490  V: 25.4352  Avg: 24.8524
MSSSIM - Y: 30.9129  U: 31.4632  V: 31.8206  Avg: 31.1415
CIEDE2000 - inf

Split psnr and apsnr

To maintain the consistency with the other metrics, it would be useful to remove the PsnrResults struct and return two different PlanarMetrics for the psnr and apsnr metrics

Add an optional compare tool

  • take in some compressed format (e.g. av1 in ivf) (potentially multiple)
  • take in the reference (e.g. raw in y4m)
  • generate a table with the metrics for each
  • generate a json/csv with the same information
  • generate a json/csv with per-frame information

Implement VMAF support

The codebase for VMAF is quite large, but it would be nice to have a pure Rust implementation. This is by no means high priority, just if someone (probably me) gets bored.

Use async-await on metrics

Since the async-await construct is now stable on Rust, it would be helpful to use it on metrics in order to speed up their computation.

Optionally add support for sqlx

Implementation details

  • create the table if it doesn't exist
  • save the file paths not as key
  • Put it behind a export-sql feature
  • Document how to use it on the readme

Test failure on 32 bits arch for msssim_yuv420p10

On both i686 and armv7hl, the test for msssim_yuv420p10 fails:

running 28 tests
test video::psnr::tests::psnr_yuv420p8 ... ok
test video::psnr::tests::psnr_yuv444p8 ... ok
test video::psnr::tests::apsnr_yuv420p10 ... ok
test video::psnr_hvs::tests::psnr_hvs_yuv420p10 ... ok
test video::psnr_hvs::tests::psnr_hvs_yuv420p8 ... ok
test video::psnr_hvs::tests::psnr_hvs_yuv444p8 ... ok
test video::ssim::tests::msssim_yuv422p8 ... ok
test video::ssim::tests::msssim_yuv420p10 ... FAILED
test video::ssim::tests::msssim_yuv444p8 ... ok
test video::ciede::tests::ciede2000_yuv420p10 ... ok
test video::ciede::tests::ciede2000_yuv420p8 ... ok
test video::ciede::tests::ciede2000_yuv420p10_nosimd ... ok
test video::ciede::tests::ciede2000_yuv422p8_nosimd ... ok
test video::ciede::tests::ciede2000_yuv444p8 ... ok
test video::ciede::tests::ciede2000_yuv420p8_nosimd ... ok
test video::psnr::tests::psnr_yuv420p10 ... ok
test video::ciede::tests::ciede2000_yuv422p8 ... ok
test video::ssim::tests::ssim_yuv420p10 ... ok
test video::psnr_hvs::tests::psnr_hvs_yuv422p8 ... ok
test video::ssim::tests::msssim_yuv420p8 ... ok
test video::ssim::tests::ssim_yuv420p8 ... ok
test video::psnr::tests::psnr_yuv422p8 ... ok
test video::ssim::tests::ssim_yuv422p8 ... ok
test video::ciede::tests::ciede2000_yuv444p8_nosimd ... ok
test video::psnr::tests::apsnr_yuv422p8 ... ok
test video::ssim::tests::ssim_yuv444p8 ... ok
test video::psnr::tests::apsnr_yuv420p8 ... ok
test video::psnr::tests::apsnr_yuv444p8 ... ok
failures:
---- video::ssim::tests::msssim_yuv420p10 stdout ----
thread 'video::ssim::tests::msssim_yuv420p10' panicked at 'Expected 19.039, got 19.01115031625374', src/lib.rs:58:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Apply cargo-c on av-metrics

Allow C/C++ projects to use av-metrics

  • create a capi.rs
  • conditionally add it depending on the cargo_c feature
  • write an example in the c-example/ directory

Releases?

I'd just to state my 2ct that not everyone is building this for themselves, but use the pre-compiled pr pre-pracked Releases.

At the time of this Issue, the last Release 0.7.2 is from Oct 23, 2021 - the last git is 0.9.0-ish and from Apr 7, 2024.

Output per-frame metrics

This has been requested for AWCY, probably useful for other purposes as well.

The API exists, just needs CLI support. Should be controlled by a CLI flag (off by default).

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.