Repository navigation
Refactor and enhance FFmpeg integration with tests and features - #54
Merged
Merged
Conversation
…ic_adaptation::AdaptInto`: replaced by `palette::chromatic_adaptation::AdaptIntoUnclamped`
error[E0308]: mismatched types --> src\swctx.rs:97:9 | 90 | let sws_ctx = SwsContext::get_context( | ----------------------- arguments to this function are incorrect 97 | flags, | ^^^^^ expected `u32`, found `i32`
error[E0308]: mismatched types expected `u32`, found `i32`
…void dual-FFmpeg heap corruption The runner image may ship system FFmpeg dev libraries that, together with the downloaded BtbN FFmpeg (different soname), get linked into the test binary. This causes AVFrame allocated by one libavutil and freed by another, triggering heap corruption (SIGABRT) in frame audio tests on ffmpeg 7.1/8.1.
- codec: replace pure println with real assertions (non-empty supported formats), deduplicate via helper functions - pixel: assert best pix fmt belongs to candidates, loss non-negative, zero loss for same-format conversion - colors: assert HSV output stays in valid ranges instead of printing - frame: remove debug println output, assert AAC encoder exposes formats
…les/tests - Accept impl Into<Option<T>> for with_codec_name/with_filters/with_options - Have DecoderBuilder::build and Decoder::new_video/new_audio return DecoderWrapper<StreamReader> that owns the reader - Make Encoder::encode return Result<()> and discard the produced packet - Drop redundant Some() wrappers across examples, tests and README
Make MediaFrame.format private and add video_format()/audio_format() accessors that return Option<PixelFormat>/Option<SampleFormat> based on media_type, removing the ambiguous bare-i32 format field from the public API. Update decoding example and README to print a readable format name.
…at panic Add decode_raw, audio, seek, and metadata examples demonstrating the raw frame path, audio encode/decode, seeking, and metadata getters. Fix StreamReader/StreamWriter builders to skip the format hint when unset (maybe_format) instead of panicking on unwrap, allowing FFmpeg to infer the format. Rename test input file to /tmp/test.mp4 across examples, tests, and README.
…d fix FFmpeg 8 sink options
- Add DrawText::time_text() for dynamic time watermark (%{localtime} etc.)
- Add video denoise/enhancement filters: hqdn3d, nlmeans, gamma, saturation, vibrance, deblock
- Add audio denoise convenience and common video filters (yadif, pad, subtitles, setdar/setsar, hue)
- Replace FilterFactory with top-level fifo/split/setpts/trim functions
- Make compressor return Result instead of panicking
- Fix FFmpeg 8 filter sink init by using alloc_filter_context + opt_set + init_str
- Add unit tests for filter spec generation and add filter_demo example
…ocess real video - Add Delogo builder supporting multiple regions, band and show options - Document delogo constraint that logo area must keep >= band margin from frame edge - Rework filter_demo to decode a real video through a filter chain (scale/crop/delogo/hqdn3d/saturation) and save processed frames as PNG - Add unit tests for delogo spec generation
…ld methods - Add Decoder::decode_frame() and DecoderWrapper::decode_frame() returning MediaFrame<u8>, avoiding the verbose decode::<u8>() in the common path - Document differences between build/build_wrapped/build_from_reader and clarify why seek is only available on DecoderWrapper - Clarify that decoded video frames are always converted to YUV420P before filtering (source pix_fmt is handled, not a correctness bug) - Update decoding/seek/filter_demo examples to use decode_frame()
…s, colormap - Add colors::color_delta_e() (CIEDE2000 via palette) for perceptually uniform color difference, useful for quality assessment and watermark removal eval - Add colors::colormap_lookup() and grayscale_to_colormap() (via colorous) for pseudo-color visualization of grayscale/heat/depth frames - Add MediaFrame::convert_rgb_to_yuv_with_matrix() to explicitly select BT.601/BT.709/BT.2020 matrix; keep automatic resolution-based selection - Extract shared RGB24 validation into private check_rgb24_supported() - Add unit tests and a color_professional example (registered in Cargo.toml)
…h_fps - Add EncoderWrapper::write_frame() that auto-maintains pts for both video (by frame rate) and audio (by sample count/sample rate), so callers no longer need to set_pts manually; encode() remains for full control - Add EncoderBuilder::with_fps(f32) converting a float fps via av_d2q; keep the default time_base (TIME_BASE) to stay consistent with pkt_time_base - Add EncoderBuilder::preset_h264_yuv420p() convenience preset - Bump default FRAME_RATE to 30 and add FPS_MAX const for fps conversion - Fix new_video doc params and Decoder::decode doc example - Add quick_write example demonstrating writer-free encoding
- Add ScaleAlgorithm enum covering all 11 sws_flags algorithm bits (FastBilinear/Bilinear/Bicubic/Experimental/Point/Area/BicubicLinear/ Gaussian/Sinc/Lanczos/Spline), defaulting to Bicubic - Add swctx::scale_with_flags() and parameterize setup_scaler; keep scale()/scale_frame() default behavior unchanged - Add DecoderBuilder::with_scale_algorithm() and export ScaleAlgorithm, applying the algorithm to the decoded native -> YUV420P conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.