Code Monkey home page Code Monkey logo

ivf-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.

ivf-rs's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

luni-4

ivf-rs's Issues

set_option is not implemented for IvfMuxer

Theoretically it should be able to set any of the properties on IvfMuxer (except info). Although this might just be a secondary interface when there's no GlobalInfo struct available.

Example doesn't compile

Hi, I get errors when trying to compile the example remuxer.rs.

Error:

   Compiling av-ivf v0.2.1
error[E0053]: method `write_packet` has an incompatible type for trait
   --> /home/redzic/.cargo/registry/src/github.com-1ecc6299db9ec823/av-ivf-0.2.1/src/muxer.rs:114:5
    |
114 |     fn write_packet(&mut self, buf: &mut dyn Write, pkt: Arc<Packet>) -> Result<()> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `av_data::packet::Packet`, found struct `Packet`
    |
    = note: expected fn pointer `fn(&mut IvfMuxer, &mut dyn std::io::Write, Arc<av_data::packet::Packet>) -> std::result::Result<_, _>`
               found fn pointer `fn(&mut IvfMuxer, &mut dyn std::io::Write, Arc<Packet>) -> std::result::Result<_, _>`
    = note: perhaps two different versions of crate `av_data` are being used?

error[E0053]: method `set_option` has an incompatible type for trait
   --> /home/redzic/.cargo/registry/src/github.com-1ecc6299db9ec823/av-ivf-0.2.1/src/muxer.rs:137:5
    |
137 |     fn set_option<'a>(&mut self, _key: &str, _val: Value<'a>) -> Result<()> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `av_data::value::Value`, found enum `Value`
    |
    = note: expected fn pointer `fn(&mut IvfMuxer, &str, av_data::value::Value<'a>) -> std::result::Result<_, _>`
               found fn pointer `fn(&mut IvfMuxer, &str, Value<'_>) -> std::result::Result<_, _>`
    = note: perhaps two different versions of crate `av_data` are being used?

error[E0308]: mismatched types
  --> /home/redzic/.cargo/registry/src/github.com-1ecc6299db9ec823/av-ivf-0.2.1/src/demuxer.rs:63:29
   |
63 |                       params: CodecParams {
   |  _____________________________^
64 | |                         extradata: None,
65 | |                         bit_rate: header.rate as usize,
66 | |                         delay: 0,
...  |
73 | |                         })),
74 | |                     },
   | |_____________________^ expected struct `av_data::params::CodecParams`, found struct `CodecParams`
   |
   = note: perhaps two different versions of crate `av_data` are being used?

error[E0308]: mismatched types
   --> /home/redzic/.cargo/registry/src/github.com-1ecc6299db9ec823/av-ivf-0.2.1/src/demuxer.rs:116:42
    |
116 |                         Event::NewPacket(pkt),
    |                                          ^^^ expected struct `av_data::packet::Packet`, found struct `Packet`
    |
    = note: perhaps two different versions of crate `av_data` are being used?

error[E0308]: mismatched types
  --> /home/redzic/.cargo/registry/src/github.com-1ecc6299db9ec823/av-ivf-0.2.1/src/muxer.rs:60:29
   |
60 |                 if let Some(MediaKind::Video(video)) = &params.kind {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^    ------------ this expression has type `&Option<av_data::params::MediaKind>`
   |                             |
   |                             expected enum `av_data::params::MediaKind`, found a different enum `av_data::params::MediaKind`
   |
   = note: perhaps two different versions of crate `av_data` are being used?

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0053, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `av-ivf`
$ rustc -V
rustc 1.51.0 (2fd73fabe 2021-03-23)

Relevant section of Cargo.toml:

[dependencies]
log = "0.4.14"
av-format = "0.3.0"
av-ivf = "0.2.1"
structopt = "0.3.21"

Write the tests

They could match what is done in the matroska crate.

  • Make sure only certain formats are accepted (e.g. only vp8, vp9 and av1 are supported)
  • Make sure the same content is produced from a muxing/demuxing iteration

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.