Crates.io | hls_transcoder |
lib.rs | hls_transcoder |
version | 0.1.0 |
source | src |
created_at | 2024-10-08 19:56:25.666383 |
updated_at | 2024-10-08 19:56:25.666383 |
description | High-performance Rust library for transcoding media to HLS using GStreamer. |
homepage | |
repository | https://github.com/RustLangLatam/hls_transcoder |
max_upload_size | |
id | 1401622 |
size | 97,319 |
HLS Transcoder is a high-performance Rust library designed for building GStreamer-based pipelines that transcode media files into HLS (HTTP Live Streaming) format. It supports both hardware and software video encoding, making it versatile for a wide range of use cases, including live streaming and video on demand (VoD).
The main goal of this library is to simplify the creation of GStreamer pipelines for HLS transcoding. It provides a comprehensive API for configuring various elements, such as file sources, decoders, encoders, muxers, and sinks, along with support for both NVIDIA NVENC hardware acceleration and software-based x264 encoding.
To use this library, ensure that you have Rust and GStreamer installed on your system. You can create a new transcoding pipeline by configuring various elements and linking them together using the builder pattern provided by the library.
use hls_transcoder::PipelineBuilder;
fn main() {
let pipeline = PipelineBuilder::new(
"input.mp4".to_string(),
"output".to_string(),
"variant".to_string(),
1280, 720, 2_000_000, true,
)
.build()
.expect("Failed to build pipeline");
pipeline.set_state(gst::State::Playing).expect("Failed to set pipeline to playing state");
}
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Please feel free to submit issues or pull requests to help improve this library.