GithubHelp home page GithubHelp logo

aom-rs'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.

aom-rs's People

Contributors

brandondyer64 avatar cuviper avatar dependabot-preview[bot] avatar eclipseo avatar gibix avatar lu-zero avatar luni-4 avatar sdroege avatar the-pat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aom-rs's Issues

Test segfault on armv7hl

On armv7hl only, i686 is good:

Running `/builddir/build/BUILD/aom-sys-0.1.3/target/release/deps/aom_sys-e44a63ac9358c24c`
running 32 tests
test aom::bindgen_test_layout_Av1DecodeReturn ... ok
test aom::bindgen_test_layout___fsid_t ... ok
test aom::bindgen_test_layout_aom_active_map ... ok
test aom::bindgen_test_layout_aom_codec_ctx__bindgen_ty_1 ... ok
test aom::bindgen_test_layout_aom_codec_cx_pkt ... ok
test aom::bindgen_test_layout_aom_codec_cx_pkt__bindgen_ty_1 ... ok
test aom::bindgen_test_layout_aom_codec_cx_pkt__bindgen_ty_1__bindgen_ty_1 ... ok
test aom::bindgen_test_layout_aom_codec_cx_pkt__bindgen_ty_1_aom_psnr_pkt ... ok
test aom::bindgen_test_layout_aom_codec_dec_cfg ... ok
test aom::bindgen_test_layout_aom_codec_enc_cfg ... ok
test aom::bindgen_test_layout_aom_codec_frame_buffer ... ok
test aom::bindgen_test_layout_aom_codec_stream_info ... ok
test aom::bindgen_test_layout_aom_fixed_buf ... ok
test aom::bindgen_test_layout_aom_image ... ok
test aom::bindgen_test_layout_aom_image_rect ... ok
test aom::bindgen_test_layout_aom_inspect_init ... ok
test aom::bindgen_test_layout_aom_postproc_cfg ... ok
test aom::bindgen_test_layout_aom_rational ... ok
test aom::bindgen_test_layout_aom_roi_map ... ok
test aom::bindgen_test_layout_aom_scaling_mode ... ok
test aom::bindgen_test_layout_aom_svc_layer_id ... ok
test aom::bindgen_test_layout_aom_svc_params ... ok
test aom::bindgen_test_layout_aom_svc_ref_frame_config ... ok
test aom::bindgen_test_layout_aom_tile_data ... ok
test aom::bindgen_test_layout_av1_ext_ref_frame ... ok
test aom::bindgen_test_layout_av1_ref_frame ... ok
test aom::bindgen_test_layout_cfg_options ... ok
test aom::bindgen_test_layout_imaxdiv_t ... ok
test aom::bindgen_test_layout_max_align_t ... ok
test tests::version ... ok
test aom::bindgen_test_layout_aom_codec_ctx ... ok
error: process didn't exit successfully: `/builddir/build/BUILD/aom-sys-0.1.3/target/release/deps/aom_sys-e44a63ac9358c24c` (signal: 11, SIGSEGV: invalid memory reference)

Looks like tests::encode is segfaulting for some reason.

type error with aom_image

With the same changes as #rust-av/vpx-rs#42, I meet type error.

here in encoder.rs
here in decoder.rs

The rust think the fields cp, tc and mc in aom_image is i32, but the code assign them to u32.
I thought libaom changed their type at first, while aom-sys/cargo.toml require aom 3.0.0 but I have a 3.2.0. But I find the type are not changed between these two version just now. They keep enum type.
So I think the problem maybe caused by bindgen or other converting package, please check this:

Cargo.lock

Build failure on 32bits arch

On both i686 and armv7hl:

BUILDSTDERR:    Compiling aom-sys v0.1.0 (/builddir/build/BUILD/aom-sys-0.1.0)
BUILDSTDERR:      Running `/usr/bin/rustc --edition=2018 --crate-name aom_sys src/lib.rs --color never --emit=dep-info,link -C opt-level=3 --test -C metadata=893460a485c4d3af -C extra-filename=-893460a485c4d3af --out-dir /builddir/build/BUILD/aom-sys-0.1.0/target/release/deps -L dependency=/builddir/build/BUILD/aom-sys-0.1.0/target/release/deps -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now -L native=/usr/lib -l aom -l m -l pthread`
BUILDSTDERR: error[E0308]: mismatched types
BUILDSTDERR:   --> src/lib.rs:79:70
BUILDSTDERR:    |
BUILDSTDERR: 79 |                 let ret = aom_codec_encode(&mut ctx, &mut raw, i, 1, flags as i64);
BUILDSTDERR:    |                                                                      ^^^^^^^^^^^^ expected i32, found i64
BUILDSTDERR: error: aborting due to previous error
BUILDSTDERR: For more information about this error, try `rustc --explain E0308`.
BUILDSTDERR: error: Could not compile `aom-sys`.

Consider adding a build feature

cmake-rs could be optionally leveraged for this purpose.

  • fetch and build the current libaom from git
  • provide overrides for the repo and commit hash
  • provide overrides for the build options

Support aom-2.0

The test fails with a segfault:

* thread #2, name = 'decoder::tests::decode', stop reason = signal SIGABRT
  * frame #0: 0x00007fff7328d33a libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff73349e60 libsystem_pthread.dylib`pthread_kill + 430
    frame #2: 0x00007fff73214808 libsystem_c.dylib`abort + 120
    frame #3: 0x00007fff73213ac6 libsystem_c.dylib`__assert_rtn + 314
    frame #4: 0x00000001004aa781 libaom-81d40c77a10d39e5`create_enc_workers(cpi=0x0000000118078020, num_workers=1) at ethread.c:515:3
    frame #5: 0x00000001004abb1f libaom-81d40c77a10d39e5`av1_encode_tiles_row_mt(cpi=0x0000000118078020) at ethread.c:1019:5
    frame #6: 0x00000001004511b8 libaom-81d40c77a10d39e5`encode_frame_internal(cpi=0x0000000118078020) at encodeframe.c:5953:5
    frame #7: 0x000000010044feed libaom-81d40c77a10d39e5`av1_encode_frame(cpi=0x0000000118078020) at encodeframe.c:6155:5
    frame #8: 0x000000010049a355 libaom-81d40c77a10d39e5`determine_sc_tools_with_encoding(cpi=0x0000000118078020, q_orig=177) at encoder.c:5436:5
    frame #9: 0x000000010049783f libaom-81d40c77a10d39e5`encode_with_recode_loop(cpi=0x0000000118078020, size=0x000070000674e988, dest="") at encoder.c:5624:3
    frame #10: 0x000000010049684c libaom-81d40c77a10d39e5`encode_with_recode_loop_and_filter(cpi=0x0000000118078020, size=0x000070000674e988, dest="", sse=0x0000000000000000, rate=0x0000000000000000, largest_tile_id=0x000070000674e748) at encoder.c:5819:11
    frame #11: 0x000000010048926e libaom-81d40c77a10d39e5`encode_frame_to_data_rate(cpi=0x0000000118078020, size=0x000070000674e988, dest="") at encoder.c:6611:9
    frame #12: 0x0000000100488a33 libaom-81d40c77a10d39e5`av1_encode(cpi=0x0000000118078020, dest="", frame_input=0x000070000674e9e0, frame_params=0x000070000674e990, frame_results=0x000070000674e988) at encoder.c:6759:9
    frame #13: 0x0000000100479676 libaom-81d40c77a10d39e5`denoise_and_encode(cpi=0x0000000118078020, dest="", frame_input=0x000070000674e9e0, frame_params=0x000070000674e990, frame_results=0x000070000674e988) at encode_strategy.c:938:7
    frame #14: 0x0000000100478631 libaom-81d40c77a10d39e5`av1_encode_strategy(cpi=0x0000000118078020, size=0x000070000674ec30, dest="", frame_flags=0x000070000674ec2c, time_stamp=0x000070000674ed30, time_end=0x000070000674ed28, timestamp_ratio=0x0000000118008630, flush=0) at encode_strategy.c:1292:14
    frame #15: 0x0000000100489ae2 libaom-81d40c77a10d39e5`av1_get_compressed_data(cpi=0x0000000118078020, frame_flags=0x000070000674ec2c, size=0x000070000674ec30, dest="", time_stamp=0x000070000674ed30, time_end=0x000070000674ed28, flush=0, timestamp_ratio=0x0000000118008630) at encoder.c:7008:7
    frame #16: 0x0000000100404987 libaom-81d40c77a10d39e5`encoder_encode(ctx=0x0000000118008010, img=0x000070000674eed0, pts=17, duration=1, enc_flags=0) at av1_cx_iface.c:2224:26
    frame #17: 0x000000010009dcc2 libaom-81d40c77a10d39e5`aom_codec_encode(ctx=0x000070000674f0e0, img=0x000070000674eed0, pts=17, duration=1, flags=0) at aom_encoder.c:155:11
    frame #18: 0x000000010000d0d7 libaom-81d40c77a10d39e5`libaom::encoder::AV1Encoder::encode::h98ad9c433631a998(self=0x000070000674f0e0, frame=0x000070000674f120) at encoder.rs:213:27
frame #4: 0x00000001004aa781 libaom-81d40c77a10d39e5`create_enc_workers(cpi=0x0000000118078020, num_workers=1) at ethread.c:515:3
   512 	  MultiThreadInfo *const mt_info = &cpi->mt_info;
   513 	  int sb_mi_size = av1_get_sb_mi_size(cm);
   514
-> 515 	  assert(mt_info->workers != NULL);
   516 	  assert(mt_info->tile_thr_data != NULL);
   517
   518 	#if CONFIG_MULTITHREAD

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.