### Install Static FFmpeg with Hardware Acceleration on Windows via vcpkg Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/hardware_acceleration/README.md Installs a static version of FFmpeg on Windows using vcpkg, including the same set of hardware acceleration features as the dynamic version. This command uses the x64-windows-static-md triplet for static linking. ```bash vcpkg install ffmpeg[core,avcodec,avformat,avfilter,avdevice,swresample,swscale,nvcodec,qsv,amf,x264]:x64-windows-static-md ``` -------------------------------- ### Install FFmpeg with VideoToolbox on macOS Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/hardware_acceleration/README.md Installs FFmpeg on macOS using the Homebrew package manager. This command typically includes support for VideoToolbox hardware acceleration by default, requiring no further configuration for basic use. ```sh brew install ffmpeg ``` -------------------------------- ### Install FFmpeg with Hardware Acceleration on Windows via vcpkg Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/hardware_acceleration/README.md Installs FFmpeg on Windows using vcpkg, enabling a comprehensive set of features including core components, various codecs (avcodec, avformat, avfilter, avdevice, swresample, swscale), and hardware acceleration support for Nvidia (nvcodec), Intel (qsv), and AMD (amf). This command targets the x64-windows triplet. ```sh vcpkg install ffmpeg[core,avcodec,avformat,avfilter,avdevice,swresample,swscale,nvcodec,qsv,amf,x264]:x64-windows ``` -------------------------------- ### Enable Static Feature in ez-ffmpeg Cargo.toml Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/hardware_acceleration/README.md Configures the ez-ffmpeg dependency in the Cargo.toml file to enable the 'static' feature. This is necessary when linking against a statically compiled version of FFmpeg, such as one installed via vcpkg with the static triplet. ```toml [dependencies] ez-ffmpeg = { version = "x.x.x", features = ["static"] } ``` -------------------------------- ### Install FFmpeg on Windows (Static Linking) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/README.md Command to install the FFmpeg library on Windows for static linking using vcpkg. Requires enabling the 'static' feature in `ez-ffmpeg`. This is a prerequisite for using the `ez-ffmpeg` Rust crate. ```Bash vcpkg install ffmpeg:x64-windows-static-md ``` -------------------------------- ### Basic ez-ffmpeg Usage Example (Rust) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/README.md A simple Rust program demonstrating how to use `ez-ffmpeg` to process a media file. It shows how to build an `FfmpegContext` with input, output, and an optional filter, and then execute it synchronously using `FfmpegScheduler`. ```Rust use ez_ffmpeg::FfmpegContext; use ez_ffmpeg::FfmpegScheduler; fn main() -> Result<(), Box> { // 1. Build the FFmpeg context let context = FfmpegContext::builder() .input("input.mp4") .filter_desc("hue=s=0") // Example filter: desaturate (optional) .output("output.mov") .build()?; // 2. Run it via FfmpegScheduler (synchronous mode) let result = FfmpegScheduler::new(context) .start()?; result.wait(); result?; // Propagate any errors that occur Ok(()) } ``` -------------------------------- ### Install FFmpeg on macOS Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/README.md Command to install the FFmpeg library on macOS using Homebrew, which is a prerequisite for using the `ez-ffmpeg` Rust crate. ```Bash brew install ffmpeg ``` -------------------------------- ### Install FFmpeg on Windows (Dynamic Linking) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/README.md Command to install the FFmpeg library on Windows for dynamic linking using vcpkg. This is a prerequisite for using the `ez-ffmpeg` Rust crate. ```Bash vcpkg install ffmpeg ``` -------------------------------- ### Set Start Time on Output (1 second) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/video_clipping/README.md Sets the start time for the output stream to 1 second (1,000,000 microseconds). This effectively starts the processing and encoding from the 1-second mark of the input video. ```Python .set_start_time_us(1000_000) ``` -------------------------------- ### Set Start Time on Input (2 seconds) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/video_clipping/README.md Sets the start time for processing the input video to 2 seconds (2,000,000 microseconds). FFmpeg will skip the first 2 seconds and begin reading from that point. ```Python .set_start_time_us(2000_000) ``` -------------------------------- ### Create Still Video from Image using FFmpeg Command Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/still_video_from_image/README.md This command uses FFmpeg to create a 10-second MP4 video from the input image `logo.jpg`. It loops the image (`-loop 1`), sets the duration (`-t 10`), and scales the image to 1280x720 resolution (`-vf scale=1280:720`). The output is saved as `output.mp4`. ```bash ffmpeg -loop 1 -i logo.jpg -t 10 -vf scale=1280:720 output.mp4 ``` -------------------------------- ### Split Video Audio to WAV Segments using FFmpeg Command Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/split_video_to_wav/README.md This command uses the FFmpeg tool to process an input video file, extract its audio, and split it into multiple WAV files. The -f segment option enables segmenting, and -segment_time 10 sets the duration of each segment to 10 seconds. The output pattern output_%03d.wav generates sequentially numbered files. ```sh ffmpeg -i input.mp4 -f segment -segment_time 10 output_%03d.wav ``` -------------------------------- ### Extract Single Thumbnail with ez-ffmpeg Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/thumbnail_extraction/README.md This example shows how to extract a single thumbnail from a video using ez-ffmpeg. It applies a scale filter to resize the output image and uses the set_max_video_frames option to limit the output to just one frame. ```FFmpeg Filter scale=w='min(160, iw)':h=-1 ``` ```ez-ffmpeg Option set_max_video_frames(1) ``` -------------------------------- ### Enable RTMP Feature in Cargo.toml Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/rtmp_streaming/README.md To use the embedded RTMP server functionality provided by ez-ffmpeg, you must enable the 'rtmp' feature flag in your project's Cargo.toml file. This snippet shows the required dependency configuration. ```TOML [dependencies] ez-ffmpeg = { version = "X.Y.Z", features = ["rtmp"] } ``` -------------------------------- ### Extract Multiple Thumbnails with ez-ffmpeg Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/thumbnail_extraction/README.md This example demonstrates extracting multiple thumbnails from a video using ez-ffmpeg. It uses the same scale filter for resizing and the set_max_video_frames option to specify the desired number of output frames, saving them with a sequential filename pattern. ```FFmpeg Filter scale=w='min(160, iw)':h=-1 ``` ```ez-ffmpeg Option set_max_video_frames(5) ``` ```FFmpeg Output Pattern %03d ``` -------------------------------- ### Generate Black Video with Silent Audio using FFmpeg Command Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/generate_black_video/README.md This bash command uses FFmpeg to generate a video file named 'output.mp4'. It sources a black color video stream ('color=c=black:s=1280x720:r=30') and a silent audio stream ('anullsrc=r=44100:cl=stereo') using the 'lavfi' (libavfilter) input format. The video resolution is 1280x720, frame rate is 30 fps, audio sample rate is 44100 Hz, and the duration is set to 10 seconds. ```bash ffmpeg -f lavfi -i color=c=black:s=1280x720:r=30 -f lavfi -i anullsrc=r=44100:cl=stereo -t 10 output.mp4 ``` -------------------------------- ### Add ez-ffmpeg Dependency (Cargo.toml) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/README.md Configuration required in the `Cargo.toml` file to add the `ez-ffmpeg` crate as a dependency to your Rust project. ```TOML [dependencies] ez-ffmpeg = "*" ``` -------------------------------- ### Enable OpenGL Feature in Cargo.toml Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/video_effects/README.md This TOML snippet shows how to enable the 'opengl' feature for the ez-ffmpeg dependency in your project's Cargo.toml file. This feature is required to use the OpenGLFrameFilter for applying shader-based effects. ```TOML [dependencies.ez-ffmpeg] version = "x.y.z" features = ["opengl"] ``` -------------------------------- ### Set Recording Duration on Output (1 second) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/video_clipping/README.md Limits the duration of the output video to 1 second (1,000,000 microseconds). The encoding process will stop after 1 second of output content has been generated. ```Python .set_recording_time_us(1000_000) ``` -------------------------------- ### Set Stop Time on Input (1 second) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/video_clipping/README.md Sets an absolute stop time for reading the input video at 1 second (1,000,000 microseconds) from the beginning of the stream. FFmpeg will stop processing when this timestamp is reached. ```Python .set_stop_time_us(1000_000) ``` -------------------------------- ### Set Stop Time on Output (1 second) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/video_clipping/README.md Sets an absolute stop time for the output stream at 1 second (1,000,000 microseconds). The encoding process will stop when the output reaches this timestamp. ```Python .set_stop_time_us(1000_000) ``` -------------------------------- ### Set Recording Duration on Input (1 second) Source: https://github.com/yeautyye/ez-ffmpeg/blob/main/examples/video_clipping/README.md Limits the duration of the processed input video to 1 second (1,000,000 microseconds). FFmpeg will stop reading the input after processing 1 second of content. ```Python .set_recording_time_us(1000_000) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.