Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
44c631a
update frame.rs test
phial3 Jun 9, 2026
24a40ca
update ci
phial3 Jun 9, 2026
d1a88e1
update
phial3 Jun 9, 2026
5664c12
update
phial3 Jun 9, 2026
9e631a7
aa
phial3 Jun 10, 2026
b2821c8
update ci
phial3 Jun 10, 2026
549421c
jrottenberg/ffmpeg 指定版本
phial3 Jun 10, 2026
bee5582
update
phial3 Jun 10, 2026
a6083d1
test in win
phial3 Jun 11, 2026
a9709eb
use build-shared.7z
phial3 Jun 11, 2026
54c7603
fix clippy warnings
phial3 Jun 11, 2026
a06805e
fix fmt
phial3 Jun 11, 2026
bbdc066
fix clippy
phial3 Jun 11, 2026
a157735
fix fmt
phial3 Jun 11, 2026
36fa9c2
update ci
phial3 Jun 11, 2026
859b178
update ci
phial3 Jun 11, 2026
94a00ca
add env:LD_LIBRARY_PATH
phial3 Jun 11, 2026
d3b5563
fix The system library required by crate was not found.
phial3 Jun 11, 2026
2c34b6d
fix pkg not exists
phial3 Jun 11, 2026
f132f7d
fix
phial3 Jun 11, 2026
55f62b6
update
phial3 Jun 11, 2026
9806512
fix: could not find native static library
phial3 Jun 11, 2026
3bfb738
update
phial3 Jun 11, 2026
4e2ba34
delete build.rs
phial3 Jun 11, 2026
52d2a30
fix test-windows arm64
phial3 Jun 11, 2026
2952153
fix win-arm64
phial3 Jun 12, 2026
42840bd
update ci fmt
phial3 Jun 12, 2026
b324211
fix(audio AVFrame): frame.set_ch_layout()
phial3 Jun 12, 2026
266ba60
up
phial3 Aug 4, 2026
c94a3b5
fix(src/colors.rs):warning: use of deprecated trait `palette::chromat…
phial3 Aug 5, 2026
69a99e8
use custom rsmpeg
phial3 Aug 7, 2026
aac7cae
fix(swctx): windows ffmpeg8.1 compile error:
phial3 Aug 7, 2026
965b83c
fix warning
phial3 Aug 7, 2026
93ed5aa
fix windows ffmpeg 8.1 error:
phial3 Aug 7, 2026
9b9b07d
fix(ci): remove system FFmpeg dev libs before running test-linux to a…
phial3 Aug 9, 2026
db261c3
fix
phial3 Aug 9, 2026
19c68e3
test: improve assertions and unify structure across unit tests
phial3 Aug 9, 2026
625e6c9
refactor: unify builder setter signatures and simplify usage in examp…
phial3 Aug 9, 2026
8ede31b
refactor(frame): expose type-safe video_format/audio_format accessors
phial3 Aug 9, 2026
5fa6561
feat(examples): add focused topic examples and fix reader/writer form…
phial3 Aug 9, 2026
5538ace
feat(filter): add video/audio enhancement filters, time watermark, an…
phial3 Aug 9, 2026
91ea98a
feat(filter): add Delogo multi-region builder and make filter_demo pr…
phial3 Aug 9, 2026
e6f10eb
feat(decode): add decode_frame() convenience and document decoder bui…
phial3 Aug 9, 2026
cab2444
fix error msg
phial3 Aug 9, 2026
54313ca
feat(colors): add perceptual color difference, explicit color matrice…
phial3 Aug 9, 2026
9c42d1a
feat(encode): add writer-free quick encoding with write_frame and wit…
phial3 Aug 10, 2026
37aca13
fix fmt
phial3 Aug 10, 2026
6943d98
update
phial3 Aug 10, 2026
d9ec682
update examples
phial3 Aug 10, 2026
d6da9e6
feat(swctx): make decoder scaling algorithm configurable
phial3 Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
419 changes: 267 additions & 152 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

65 changes: 48 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "rsmedia"
version = "0.1.0"
edition = "2021"
build = "build.rs"
readme = "README.md"
license = "MIT OR Apache-2.0"
description = "High-level video toolkit based on ffmpeg."
Expand All @@ -18,20 +17,20 @@ ffmpeg6 = ["rsmpeg/ffmpeg6"]
ffmpeg7 = ["rsmpeg/ffmpeg7_1"]
ffmpeg8 = ["rsmpeg/ffmpeg8"]
## unxi linking ffmpeg with pkg-config.
link_system_ffmpeg = ["rsmpeg/link_system_ffmpeg", "pkg-config"]
link_system_ffmpeg = ["rsmpeg/link_system_ffmpeg"]
## windows linking ffmpeg with vcpkg.
link_vcpkg_ffmpeg = ["rsmpeg/link_vcpkg_ffmpeg", "vcpkg"]
link_vcpkg_ffmpeg = ["rsmpeg/link_vcpkg_ffmpeg"]

[dependencies]
pix = "0.14"
pix = "1.0"
rgb = "0.8"
yuv = { version = "0.8", features = ["rayon", "professional_mode"] }
color = "0.3"
yuv = { version = "0.8", features = ["rayon", "professional_mode"] }
colorous = "1.0"
colorutils-rs = "0.7"
colorutils-rs = "0.8"
palette = "0.7"
image = "0.25"
imageproc = "0.26"
imageproc = "0.27"
num-traits = "0.2"
anyhow = "1.0"
log = "0.4"
Expand All @@ -43,34 +42,32 @@ dashmap = "6.1"
once_cell = "1.21"
num_cpus = "1.17"
ndarray = { version = "0.17", optional = true }
rsmpeg = { git = "https://github.com/larksuite/rsmpeg", default-features = false }
# use custom rsmpeg
rsmpeg = { git = "https://gitee.com/phial3/rsmpeg", branch = "dev", default-features = false }

[dev-dependencies]
libc = "0.2"
camino = "1.2"
chrono = "0.4"
ringbuf = "0.4"
ctor = "0.6"
ringbuf = "0.5"
ctor = "1.0"
dtor = "1.0"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter", "chrono"] }
ab_glyph = "0.2"
libblur = "0.23"
libblur = "0.24"
pic-scale = "0.7"
fast_image_resize = "6.0"
histogram_equalization = "0.2"
## security & async
futures = "0.3"
tokio = { version = "1", features = ["full"] }
## sound & audio
cpal = "0.17"
cpal = "0.18"
wavers = "1.5"
rubato = "1.0"
rubato = "4.0"
dasp = { version = "0.11", features = ["all"] }
rodio = { version = "0.22", features = ["symphonia-all", "tracing"] }

[build-dependencies]
vcpkg = { version = "0.2", optional = true }
pkg-config = { version = "0.3", optional = true }

[package.metadata.docs.rs]
all-features = true

Expand All @@ -83,3 +80,37 @@ required-features = ["ndarray"]
name = "encoding"
path = "examples/encoding.rs"
required-features = ["ndarray"]

[[example]]
name = "decode_raw"
path = "examples/decode_raw.rs"

[[example]]
name = "audio"
path = "examples/audio.rs"
required-features = ["ndarray"]

[[example]]
name = "seek"
path = "examples/seek.rs"
required-features = ["ndarray"]

[[example]]
name = "metadata"
path = "examples/metadata.rs"
required-features = ["ndarray"]

[[example]]
name = "filter_demo"
path = "examples/filter_demo.rs"
required-features = ["ndarray"]

[[example]]
name = "color_professional"
path = "examples/color_professional.rs"
required-features = ["ndarray"]

[[example]]
name = "quick_write"
path = "examples/quick_write.rs"
required-features = ["ndarray"]
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export FFMPEG_DLL_PATH=$FFMPEG_DIR/lib/libffmpeg.dll
fn main() {
rsmedia::init().unwrap();

let input_path = Path::new("/tmp/bear.mp4");
let input_path = Path::new("/tmp/test.mp4");
let mut demuxer = Demuxer::new(input_path).unwrap();

// demux and mux all streams frame
Expand Down Expand Up @@ -202,7 +202,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
let mut decoder = DecoderBuilder::new(MediaType::VIDEO)
// decoder with CUDA acceleration
// .with_hardware_device(Some(HWDeviceType::CUDA.auto_best_config().unwrap()))
// .with_codec_name(Some("h264_cuvid".to_string()))
// .with_codec_name("h264_cuvid".to_string())
.build_wrapped(source)
.context("failed to create decoder")?;

Expand All @@ -211,7 +211,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
Ok(Some(yuv_frame)) => {
println!(
"decoded frame pts: {}, type: {:?}, format:{:?}",
yuv_frame.pts, yuv_frame.media_type, yuv_frame.format
yuv_frame.pts,
yuv_frame.media_type,
yuv_frame
.video_format()
.map(|f| f.get_pix_fmt_name())
.unwrap_or_else(|| "n/a".to_string())
);

// processing frame here...
Expand Down Expand Up @@ -243,9 +248,9 @@ fn main() -> Result<(), Box<dyn Error>> {
// encoder with CUDA acceleration
// .with_hardware_device(Some(HWDeviceType::CUDA.auto_best_config().unwrap()))
// libx264, libx265, h264_nvenc, h264_vaapi
// .with_codec_name(Some("h264_nvenc".to_string()))
// .with_options(Some(Options::preset_h264_nvenc()))
.with_filters(Some(filters))
// .with_codec_name("h264_nvenc".to_string())
// .with_options(Options::preset_h264_nvenc())
.with_filters(filters)
.build_wrapped(output_path)
.expect("failed to create encoder");

Expand Down
Loading
Loading