oddity-ai / video-rs

Video readers, writers, muxers, encoders and decoders for Rust based on ffmpeg libraries.
Apache License 2.0
248 stars 31 forks source link

Support selecting a specific stream #32

Closed EvysGarden closed 10 months ago

EvysGarden commented 10 months ago

To-do

See #31

EvysGarden commented 10 months ago

selecting an invalid index (like an audio stream) currently crashes ffmpeg. This could be handled more gracefully by probing the source first

gerwin3 commented 10 months ago

I like this functionality! Unfortunately I'd like the default new to have the same number of arguments (to make it really easy for starters to open a stream with sane defaults). Adding with_options_and_stream could work, but we'd also need with_options_and_resize_and_stream, etc... Seems like we need to convert to a builder pattern to do this.

I'll leave this PR open and hopefully I'll have some time to circle back on this later. @EvysGarden Of course you are free to implement it here if you have the time.

EvysGarden commented 10 months ago

I agree. give me a minute

EvysGarden commented 10 months ago

buider pattern will be implemented instead