Skip to main content

Babit Multimedia Framework

Project description

BMF - Cross-platform, multi-language, customizable video processing framework with strong GPU acceleration

BMF (Babit Multimedia Framework) is a cross-platform, multi-language, customizable multimedia processing framework developed by ByteDance. With over 4 years of testing and improvements, BMF has been tailored to adeptly tackle challenges in our real-world production environments. It is currently widely used in ByteDance's video streaming, live transcoding, cloud editing and mobile pre/post processing scenarios. More than 2 billion videos are processed by the framework every day.

Here are some key features of BMF:

  • Cross-Platform Support: Native compatibility with Linux, Windows, and macOS, as well as optimization for both x86 and ARM CPUs.

  • Easy to use: BMF provides Python, Go, and C++ APIs, allowing developers the flexibility to code in their favourite languages.

  • Customizability: Developers can enhance the framework's features by adding their own modules independently because of BMF decoupled architecture.

  • High performance: BMF has a powerful scheduler and strong support for heterogeneous acceleration hardware. Moreover, NVIDIA has been cooperating with us to develop a highly optimized GPU pipeline for video transcoding and AI inference.

  • Efficient data conversion: BMF offers seamless data format conversions across popular frameworks (FFmpeg/Numpy/PyTorch/OpenCV/TensorRT), conversion between hardware devices (CPU/GPU), and color space and pixel format conversion.

BMFLite is a client-side cross-platform, lightweight, more efficient client-side multimedia processing framework. So far, the BMFLite client-side algorithm is used in apps such as Douyin/Xigua, serving more than one billion users in live streaming/video playing/pictures/cloud games and other scenarios, and processing videos and pictures trillions of times every day.

Dive deeper into BMF's capabilities on our website for more details.

Quick Experience

In this section, we will directly showcase the capabilities of the BMF framework around six dimensions: Transcode, Edit, Meeting/Broadcaster, GPU acceleration, AI Inference, and client-side Framework. For all the demos provided below, corresponding implementations and documentation are available on Google Colab, allowing you to experience them intuitively.

Transcode

This demo describes step-by-step how to use BMF to develop a transcoding program, including video transcoding, audio transcoding, and image transcoding. In it, you can familiarize yourself with how to use BMF and how to use FFmpeg-compatible options to achieve the capabilities you need.

If you want to have a quick experiment, you can try it on Open In Colab

Edit

The Edit Demo will show you how to implement a high-complexity audio and video editing pipeline through the BMF framework. We have implemented two Python modules, video_concat and video_overlay, and combined various atomic capabilities to construct a complex BMF Graph.

If you want to have a quick experiment, you can try it on Open In Colab

Meeting/Broadcaster

This demo uses BMF framework to construct a simple broadcast service. The service provides an API that enables dynamic video source pulling, video layout control, audio mixing, and ultimately streaming the output to an RTMP server. This demo showcases the modularity of BMF, multi-language development, and the ability to dynamically adjust the pipeline.

Below is a screen recording demonstrating the operation of broadcaster:

GPU acceleration

GPU Video Frame Extraction

The video frame extraction acceleration demo shows:

  1. BMF flexible capability of:

    • Multi-language programming, we can see multi-language modules work together in the demo
    • Ability to extend easily, there are new C++, Python modules added simply
    • FFmpeg ability is fully compatible
  2. Hardware acceleration quickly enablement and CPU/GPU pipeline support

    • Heterogeneous pipeline is supported in BMF, such as process between CPU and GPU
    • Useful hardware color space conversion in BMF

If you want to have a quick experiment, you can try it on Open In Colab

GPU Video Transcoding and Filtering

The GPU transcoding and filter module demo shows:

  1. Common video/image filters in BMF accelerated by GPU
  2. How to write GPU modules in BMF

The demo builds a transcoding pipeline which fully runs on GPU:

decode->scale->flip->rotate->crop->blur->encode

If you want to have a quick experiment, you can try it on Open In Colab

AI inference

LLM preprocessing

The prototype of how to build a video preprocessing for LLM training data in Bytedance, which serves billions of clip processing each day.

The input video will be split according to scene change, and subtitles in the video will be detected and cropped by OCR module, and the video quality will be assessed by BMF provided aesthetic module. After that, the finalized video clips will be encoded as output.

If you want to have a quick experiment, you can try it on Open In Colab

Deoldify

This demo shows how to integrate the state of art AI algorithms into the BMF video processing pipeline. The famous open source colorization algorithm DeOldify is wrapped as a BMF pyhton module in less than 100 lines of codes. The final effect is illustrated below, with the original video on the left side and the colored video on the right.

If you want to have a quick experiment, you can try it on Open In Colab

Super Resolution

This demo implements the super-resolution inference process of Real-ESRGAN as a BMF module, showcasing a BMF pipeline that combines decoding, super-resolution inference and encoding.

If you want to have a quick experiment, you can try it on Open In Colab

Video Quality Score

This demo shows how to invoke our aesthetic assessment model using bmf. Our deep learning model Aesmode has achieved a binary classification accuracy of 83.8% on AVA dataset, reaching the level of academic SOTA, and can be directly used to evaluate the aesthetic degree of videos by means of frame extraction processing.

If you want to have a quick experiment, you can try it on Open In Colab

Face Detect With TensorRT

This Demo shows a full-link face detect pipeline based on TensorRT acceleration, which internally uses the TensorRT-accelerated Onnx model to process the input video. It uses the NMS algorithm to filter repeated candidate boxes to form an output, which can be used to process a Face Detection Task efficiently.

If you want to have a quick experiment, you can try it on Open In Colab

Client-side Framework

Edge AI models

This case illustrates the procedures of integrating an external algorithm module into the BMFLite framework and management of its execution.

sr

Real-time denoise

This example implements the denoise algorithm as a BMF module, showcasing a BMF pipeline that combines video capture, noise reduction and rendering.

sr

Table of Contents

License

The project has an Apache 2.0 License. Third party components and dependencies remain under their own licenses.

Contributing

Contributions are welcomed. Please follow the guidelines.

We use GitHub issues to track and resolve problems. If you have any questions, please feel free to join the discussion and work with us to find a solution.

Acknowledgment

The decoder, encoder and filter reference ffmpeg cmdline tool. They are wrapped as BMF's built-in modules under the LGPL license.

The project also draws inspiration from other popular frameworks, such as ffmpeg-python and mediapipe. Our website is using the project from docsy based on hugo.

Here, we'd like to express our sincerest thanks to the developers of the above projects!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

BabitMF_GPU-0.0.13-cp312-cp312-manylinux_2_28_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.0.13-cp311-cp311-manylinux_2_28_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.0.13-cp310-cp310-manylinux_2_28_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.0.13-cp39-cp39-manylinux_2_28_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.0.13-cp38-cp38-manylinux_2_28_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.0.13-cp37-cp37m-manylinux_2_28_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.0.13-cp36-cp36m-manylinux_2_28_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.28+ x86-64

File details

Details for the file BabitMF_GPU-0.0.13-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for BabitMF_GPU-0.0.13-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 17ee5d348ecb37e1305b916454f939e1f5199f66faeed5fff44e687be4d6b93d
MD5 cd16ab0e407b5df108d53c2b694a1254
BLAKE2b-256 6fbb0eb5d33848afdf460646640dcd90abaede0d94b44ed20c4df23e0c49da90

See more details on using hashes here.

File details

Details for the file BabitMF_GPU-0.0.13-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for BabitMF_GPU-0.0.13-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef20e951c7ef6bb250a74ea567e2fd3d0a1192355ddc722c8d4da0eae91663a7
MD5 eba44e3cbb0edd6cc46a167d2dde84e1
BLAKE2b-256 0bcf544c4f39df0512dd9fb5eeac1c9e5a3f9cf4246c79046653b7664f62e959

See more details on using hashes here.

File details

Details for the file BabitMF_GPU-0.0.13-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for BabitMF_GPU-0.0.13-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f76642f797ecddff047ddfd99439ec9439533bdd70c0a308412cb278dd76c443
MD5 ec70d84fc053406797f73e9b5334e819
BLAKE2b-256 c14bb07ba9fd33ce399e8ebe55896dab148e0b1ca9a6566ce6c4c6a195309c71

See more details on using hashes here.

File details

Details for the file BabitMF_GPU-0.0.13-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for BabitMF_GPU-0.0.13-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7731b9cea67f937b3f557fe5749480342d7e755d467667d3b85f42eab2a1cc72
MD5 82db400a7ae07ae29cb4cd7eeb9f8201
BLAKE2b-256 17c4186802ffb4bce5375905e2f08bd63db1d7c9ce4464f8f5bd0e0d11ccd17d

See more details on using hashes here.

File details

Details for the file BabitMF_GPU-0.0.13-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for BabitMF_GPU-0.0.13-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c324125f5430dd656c77ddd0ce5b0b7b7298f38b16c777dc0b5640884c15287d
MD5 1eafb34dc218b7365a0526ffce3e4d48
BLAKE2b-256 2621ea995978e87c1ad58daf5b5289b18c0cfefed6d3183669eda5be530d4330

See more details on using hashes here.

File details

Details for the file BabitMF_GPU-0.0.13-cp37-cp37m-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for BabitMF_GPU-0.0.13-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d3b0610d5d3e16a90a728a53793cb85ae90b86d7123fdc10bf8db188481886d0
MD5 be35b70df16e9fc845f9f689273ad833
BLAKE2b-256 ce97b169e8abb13a015cbe9d3b0d6642273960b8fa2e3fc9ab327d13f168b297

See more details on using hashes here.

File details

Details for the file BabitMF_GPU-0.0.13-cp36-cp36m-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for BabitMF_GPU-0.0.13-cp36-cp36m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fdc423e097a110935286e96354bb00dd43ae594f64d1993d31a0033accbdc22d
MD5 db98b0a7f26ef74599749c2880c93ae2
BLAKE2b-256 2dfc29a47c101a51c4460a30c2c26ccb571ccd60447d6aabc9469db86b1e221a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page