edgefirst-codec 0.37.0

Image and video codecs for EdgeFirst tensors: JPEG/PNG decode into pre-allocated tensors and hardware H.264 encode
Documentation
[package]
name = "edgefirst-codec"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
description = "Image and video codecs for EdgeFirst tensors: JPEG/PNG decode into pre-allocated tensors and hardware H.264 encode"
homepage.workspace = true
repository.workspace = true
readme = "README.md"
license.workspace = true
keywords = ["jpeg", "png", "image-decoding", "zero-copy", "edge-ai"]
categories = ["multimedia::images", "embedded"]
documentation = "https://docs.rs/edgefirst-codec"

[features]
# v4l2 and nvjpeg are on by default but their backend code is fully gated
# `#[cfg(all(target_os = "linux", feature = "..."))]`, so off Linux they compile
# to nothing. nvjpeg is pure dlopen (no link-time CUDA dependency) — it loads
# libnvjpeg.so.12 at runtime and degrades to the V4L2/CPU decoders when absent.
default = ["v4l2", "nvjpeg", "png"]
v4l2 = ["dep:edgefirst-v4l2"]
png = ["dep:zune-png"]
nvjpeg = ["dep:libloading"]
opencv = ["dep:opencv"]
turbojpeg = ["dep:turbojpeg"]

[dependencies]
edgefirst-tensor = { workspace = true, default-features = false }
kamadak-exif = { workspace = true }
libloading = { workspace = true, optional = true }
log = { workspace = true }
num-traits = { workspace = true }
opencv = { workspace = true, optional = true }
tracing = { workspace = true }
turbojpeg = { version = "1.4", optional = true }
zune-png = { workspace = true, optional = true }

# Hardware JPEG decode (v4l2 feature). Linux-only: edgefirst-v4l2 provides
# device discovery, the buffer queues and events.
[target.'cfg(target_os = "linux")'.dependencies]
edgefirst-v4l2 = { workspace = true, optional = true }

[dev-dependencies]
edgefirst-bench = { workspace = true }
env_logger = { workspace = true }
image = { workspace = true }
# zune-jpeg is used only by parity tests and the comparison benchmark.
zune-jpeg = { workspace = true }
# Comparison arm in codec_benchmark; independent of our own `png` feature.
zune-png = { workspace = true }


[[bench]]
name = "codec_benchmark"
harness = false

[[example]]
name = "video-encode"
path = "examples/video_encode.rs"

[[example]]
name = "video-decode"
path = "examples/video_decode.rs"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage,coverage_nightly)'] }