Giter Site home page Giter Site logo

ffv1'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.

ffv1's People

Contributors

dependabot-preview[bot] avatar est31 avatar ford-prefect avatar lu-zero avatar luisbg avatar luni-4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffv1's Issues

Add overflow when decoding 12 bit RGB

thread '<unnamed>' panicked at 'attempt to add with overflow', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/jpeg2000rct.rs:74:58
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:50:5
   3: <u16 as ffv1::jpeg2000rct::Rct<u8>>::rct
   4: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:714:17
   5: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
   6: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
   7: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:377:29

See attached file: test.mkv.zip

Subtraction overflow when decoding 8 bit RGB

thread '<unnamed>' panicked at 'attempt to subtract with overflow', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/jpeg2000rct.rs:33:29
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:50:5
   3: <u8 as ffv1::jpeg2000rct::Rct<u16>>::rct
   4: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:694:17
   5: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
   6: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
   7: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:376:29
   8: gstreamer_video::subclass::video_decoder::video_decoder_handle_frame::{{closure}}
             at /home/slomo/.cargo/git/checkouts/gstreamer-rs-79e52a2d27eb91a3/4b2f0a9/gstreamer-video/src/subclass/video_decoder.rs:713:9

See attached file: test.mkv.zip

Index out of bounds when decoding 4:4:2:0 YUV

thread '<unnamed>' panicked at 'index out of bounds: the len is 2 but the index is 2', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:519:26
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:69:5
   3: <usize as core::slice::index::SliceIndex<[T]>>::index_mut
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/slice/index.rs:190:14
   4: core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/slice/index.rs:26:9
   5: <alloc::vec::Vec<T,A> as core::ops::index::IndexMut<I>>::index_mut
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/vec/mod.rs:2444:9
   6: ffv1::decoder::Decoder::decode_line
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:519:26
   7: ffv1::decoder::Decoder::decode_slice_content_yuv
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:591:17
   8: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:668:17
   9: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
  10: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
  11: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:426:29

See attached file: test.mkv.zip

Index out of bounds when decoding 12 bit RGBA

thread '<unnamed>' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/jpeg2000rct.rs:98:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:69:5
   3: <u16 as ffv1::jpeg2000rct::Rct<u32>>::rct
   4: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:730:17
   5: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
   6: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
   7: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:376:29
   8: gstreamer_video::subclass::video_decoder::video_decoder_handle_frame::{{closure}}
             at /home/slomo/.cargo/git/checkouts/gstreamer-rs-79e52a2d27eb91a3/4b2f0a9/gstreamer-video/src/subclass/video_decoder.rs:713:9

See attached file: test.mkv.zip

Index out of bounds when decoding files with odd width

thread '<unnamed>' panicked at 'index out of bounds: the len is 3600 but the index is 3600', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:560:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:69:5
   3: ffv1::decoder::Decoder::decode_line
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:560:13
   4: ffv1::decoder::Decoder::decode_slice_content_yuv
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:591:17
   5: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:668:17
   6: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
   7: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
   8: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:376:29
[...]

Happens with the attached file: test.mkv.zip

Index out of bounds when decoding 8 bit RGBA

thread '<unnamed>' panicked at 'index out of bounds: the len is 2 but the index is 2', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:519:26
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:69:5
   3: <usize as core::slice::index::SliceIndex<[T]>>::index_mut
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/slice/index.rs:190:14
   4: core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/slice/index.rs:26:9
   5: <alloc::vec::Vec<T,A> as core::ops::index::IndexMut<I>>::index_mut
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/vec/mod.rs:2444:9
   6: ffv1::decoder::Decoder::decode_line
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:519:26
   7: ffv1::decoder::Decoder::decode_slice_content_rct
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:640:17
   8: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:688:17
   9: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
  10: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
  11: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:376:29
  12: gstreamer_video::subclass::video_decoder::video_decoder_handle_frame::{{closure}}
             at /home/slomo/.cargo/git/checkouts/gstreamer-rs-79e52a2d27eb91a3/4b2f0a9/gstreamer-video/src/subclass/video_decoder.rs:713:9

See attached file: test.mkv.zip

Index out of bounds with 8 bit grayscale

thread '<unnamed>' panicked at 'index out of bounds: the len is 5667 but the index is 5667', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/golombcoder/bitreader.rs:26:29
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:69:5
   3: ffv1::golombcoder::bitreader::BitReader::u
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/golombcoder/bitreader.rs:26:29
   4: ffv1::golombcoder::golomb::Coder::get_ur_golomb
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/golombcoder/golomb.rs:203:16
   5: ffv1::golombcoder::golomb::Coder::get_sr_golomb
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/golombcoder/golomb.rs:190:17
   6: ffv1::golombcoder::golomb::Coder::get_vlc_symbol
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/golombcoder/golomb.rs:158:21
   7: ffv1::golombcoder::golomb::Coder::sg
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/golombcoder/golomb.rs:142:13
   8: ffv1::decoder::Decoder::decode_line
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:517:56
   9: ffv1::decoder::Decoder::decode_slice_content_yuv
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:591:17
  10: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:668:17
  11: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
  12: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
  13: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:432:29
  14: gstreamer_video::subclass::video_decoder::video_decoder_handle_frame::{{closure}}
             at /home/slomo/.cargo/git/checkouts/gstreamer-rs-79e52a2d27eb91a3/4b2f0a9/gstreamer-video/src/subclass/video_decoder.rs:713:9

See attached file: test.mkv.zip

Tests are broken on debug builds

More overflow-related failure:

$ cargo test                              
   Compiling ffv1 v0.0.0 (/home/arun/code/misc/ffv1)
    Finished test [unoptimized + debuginfo] target(s) in 0.61s
     Running unittests (target/debug/deps/ffv1-1364b031eaa6b614)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/decode.rs (target/debug/deps/decode-0024f3ae37f50235)

running 3 tests
test test_bgr0 ... FAILED
test test_gbrp16le ... FAILED
test test_yuv420 ... ok

failures:

---- test_bgr0 stdout ----
thread 'test_bgr0' panicked at 'attempt to subtract with overflow', src/jpeg2000rct.rs:34:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- test_gbrp16le stdout ----
thread 'test_gbrp16le' panicked at 'attempt to subtract with overflow', src/jpeg2000rct.rs:104:29


failures:
    test_bgr0
    test_gbrp16le

test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.30s

Panics with 16 bit grayscale

thread '<unnamed>' panicked at 'WTF range coder!', /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/rangecoder/range.rs:119:17
stack backtrace:
   0: std::panicking::begin_panic
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:541:12
   1: ffv1::rangecoder::range::RangeCoder::symbol
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/rangecoder/range.rs:119:17
   2: ffv1::rangecoder::range::RangeCoder::sr
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/rangecoder/range.rs:97:9
   3: ffv1::decoder::Decoder::decode_line
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:523:21
   4: ffv1::decoder::Decoder::decode_slice_content_yuv
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:591:17
   5: ffv1::decoder::Decoder::decode_slice_content
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:675:17
   6: ffv1::decoder::Decoder::decode_slice
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:826:9
   7: ffv1::decoder::Decoder::decode_frame
             at /home/slomo/.cargo/git/checkouts/ffv1-08f2e3b26709fb34/2afb025/src/decoder.rs:245:23
   8: <gstffv1::ffv1dec::imp::Ffv1Dec as gstreamer_video::subclass::video_decoder::VideoDecoderImpl>::handle_frame
             at ./src/ffv1dec/imp.rs:432:29
   9: gstreamer_video::subclass::video_decoder::video_decoder_handle_frame::{{closure}}
             at /home/slomo/.cargo/git/checkouts/gstreamer-rs-79e52a2d27eb91a3/4b2f0a9/gstreamer-video/src/subclass/video_decoder.rs:713:9

See attached file: test.mkv.zip

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.