Releases: nathanbabcock/ffmpeg-sidecar
v2.0.5
v2.0.4
What's Changed
- fix: handle non-utf8 bytes in log parser in #68
- chore(deps): bump hashbrown from 0.15.0 to 0.15.2 by @dependabot in #69
Full Changelog: v2.0.3...v2.0.4
v2.0.3
What's Changed
- fix for upstream
rustls
vulnerability in #65 by @dependabot - fix bug where audio-only outputs would not properly be read into
OutputChunk
events in #64 - fix bug where consecutive newlines on windows (
\r\n
) would produce empty string log message events in #64
Docs
- new example code for capturing mic audio and displaying a loudness meter in realtime
New Contributors
- @dependabot made their first contribution in #65
Full Changelog: v2.0.2...v2.0.3
v2.0.2
What's Changed
- Fix crash when using formats with bits per pixel size not divisible by 8 by @Wumpf in #61
- Fall back to chunked mode for unknown frame buffer sizes by @nathanbabcock in #62
Full Changelog: v2.0.1...v2.0.2
v2.0.1
What's Changed
- 🪲 Fix non-default feature build: Feature gate
unpack_ffmpeg
withdownload_ffmpeg
by @Wumpf in #56 - Replace
reqwest
withureq
by @emilk in #57 - Add
rust-toolchain
and set MSRV to 1.79 by @emilk in #58 - v2.0 docs & cleanup by @nathanbabcock in #59
New Contributors
Shoutout to the Rerun project for contributing some quick hotfixes on v2.x 🎉
Full Changelog: v2.0.0...v2.0.1
v2.0.0
✨ Highlights
TL;DR: Minimal breaking changes, improvements under the hood, and some powerful new tools
Audio stream metadata parsing
One of the main purposes of ffmpeg-sidecar
is to parse detailed metadata from log messages emitted by the FFmpeg CLI. Before now, metadata was only supported for video streams. In v2.0, that support is extended to audio streams as well. Information like sample_rate
and channels
are available both in the iterator events ParsedInputStream
and ParsedOutputStream
, as well as the FfmpegMetadata
struct.
This is a small breaking change, since in v1.x the AVStream
struct had fields that only correspond to video. In 2.x, this is replaced by a broader Stream
struct which can be narrowed down into specific variants via methods like is_video()
, video_data()
, is_audio()
, and audio_data()
. Migrating to 2.x only requires adding one of those checks before using the video metadata. Code that didn't read video metadata or reference the AVStream
struct directly will continue to work without any changes.
There's room here for future contributions to also augment the Subtitle
and Other
stream types with granular metadata as well.
Thank you to @PanCakeConnaisseur for this contribution! 🎉
Robust download handling
This is a feature that already landed in v1.2. Under the hood we've transitioned to using reqwest
to manage downloads of FFmpeg binaries. In v2.0 we are removing the deprecated curl()
and curl_to_file()
methods. Unless you were importing and using these methods directly, no migration is needed!
For some background on this: ffmpeg-sidecar
launched with a very lightweight download mechanism which relied on curl
and tar
binaries being available in the host environment. This resonated with the "sidecar" ethos — relying on industry-standard and widely available binaries rather than statically linking with source code dependencies to do the same thing. Since then, the auto-download feature has grown in popularity and may sometimes be used in environments where assumptions can't be made about the availability or behavior of curl
, tar
, and others. Maybe there is room for a curl-sidecar
crate here...but for the purposes of this library, using reqwest
for downloads gives a better guarantee of consistency across platforms, including CI environments.
The reqwest
implementation is behind a crate feature named download_ffmpeg
, which is enabled by default. If you prefer the sidecar curl
approach or any other one, you can disable the feature and roll your own function for it.
Thank you to @VirtualPirate for this contribution! 🎉
Cross-platform named pipe support
One of the most powerful use cases for ffmpeg-sidecar
is to stream data directly from FFmpeg's output into your Rust program for further processing. Then it can be used for various purposes like computer vision, image processing, or transcoding.
This approach is limited to a single output when using the most straightforward approach of outputting onto stdout from FFmpeg. It would be difficult to separate video and audio streams without spawning two separate instances of FFmepg (and potentially decoding the file twice). However, some downstream applications like Cap have extended this approach to support OS-level named pipes.
In v2.0, a new optional crate feature called named_pipes
provides a cross-platform abstraction over named pipes for the purposes of interop with FFmpeg. Some of the nuances of named pipes can be difficult to work with, particularly when it comes to synchronization logic about connecting to a pipe, whether it blocks while waiting for output to begin, etc — and these behaviors vary between Windows and Unix. The NamedPipe
struct provides a minimal wrapper over these details, and examples/named_pipes.rs
has an end-to-end example that can be taken as a starting point.
This crate feature is opt-in and disabled by default, since it requires OS dependencies (either winapi
or nix
) for a fairly niche use-case. Another alternative to consider would be using local TCP sockets to support multiple output streams, which have a bit more consistent and predictable behavior with great performance. See examples/sockets.rs
for an example of that approach.
Other/misc
- Switched from
usize
tou32
for some metadata struct fields - Fixed a bug where the first progress message would be missed if it contained
"bitrate=N/A"
- Improved the output of
print_command()
debug method to split the command onto multiple lines for better readability
PRs
- Remove tar dependency and used platform specific dependencies for different formats by @VirtualPirate in #51
- feat!: Add audio and subtitle stream parsing by @PanCakeConnaisseur in #50
- feat: Add option alias for subtitle codec by @PanCakeConnaisseur in #54
- feat: create named pipes by @nathanbabcock in #53
- chore: remove deprecated curl functions by @nathanbabcock in #55
New Contributors
- 📢 New contributors are welcome! For the most part this is a simple-to-understand and beginner-friendly codebase.
- @PanCakeConnaisseur made their first contribution in #50
Full Changelog: v1.2.0...v2.0.0
v1.2.0
Better download compatibility
by @VirtualPirate in #48
- Eliminates the dependency on native
curl
command - Deprecates
curl
andcurl_to_file
functions; they will be removed in the next major version - The new
reqwest
dependency can be opted out of by disabling thedownload_ffmpeg
feature - For more advanced download functionality like async streaming or progress updates, it's encouraged to opt out and roll your own
- Future work: also replace the dependency on native
tar
command in theunpack_ffmpeg
function (PRs welcome!)
Full Changelog: v1.1.2...v1.2.0
v1.1.2
What's Changed
- fix: apply windows creation flags to all command subprocesses in #42 (ty @clytras & @bliongosari1)
Full Changelog: v1.1.1...v1.1.2
v1.1.1: Mac M1 updates + bugfix
What's Changed
- 🪲 Prevent hang waiting for stdin on overwrite prompt in #36 (@jtof-dev)
- Mac M1: Support
check_latest_version
in #38 - Mac M1: Update auto download to FFmpeg v7.0
Full Changelog: v1.1...v1.1.1
v1.1: FFmpeg v7 compat + more arg methods
What's Changed
- Make README.md example same as /examples/ one by @Sobieg in #30
- Add two new options for video-options by @bvc3at in #32
- Fix for FFmpeg v7: "KiB" filesize units in progress updates, reported by @lovesegfault in #33
New Contributors
Full Changelog: v1.0.1...v1.1