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

If you need example files, you can find them in https://github.com/BabitMF/bmf/releases/download/files/files.tar.gz

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.2.0-cp312-cp312-manylinux_2_28_x86_64.whl (37.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl (37.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl (37.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.2.0-cp39-cp39-manylinux_2_28_x86_64.whl (37.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.2.0-cp38-cp38-manylinux_2_28_x86_64.whl (37.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.2.0-cp37-cp37m-manylinux_2_28_x86_64.whl (37.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.28+ x86-64

BabitMF_GPU-0.2.0-cp36-cp36m-manylinux_2_28_x86_64.whl (37.7 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.28+ x86-64

File details

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

File metadata

File hashes

Hashes for BabitMF_GPU-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ec4e70cfbdb4e208886ee2e5ee4b483f36741d7f1ed2cf8ee81df5581a1d8465
MD5 4bdf2aae74440fc50ddb754a875bdec0
BLAKE2b-256 3862628dc0f51becd80108867e89dd95a911625fd35a5b09ceac6f412ea48648

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BabitMF_GPU-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d7d9d0907de8c255cee6e016c523cbee76542a6759ea5d49c1238949edbf3259
MD5 8ead7a8ac6bee99f3a6f4e960c1aa70b
BLAKE2b-256 97d6e4a6becb7b9744f1d2b1c7b29b9347f377d743da04441d979c13217b9efb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BabitMF_GPU-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 285585de216bc4d1efabed3b02c3fdf13b131b96b111eca747700da466a3045b
MD5 1aaedea6bfd85c608f6861e6fc99a8a1
BLAKE2b-256 42784263bd214ef5fe059fad4e4312382d6eae9a5026f0b4d47c98c224069a39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BabitMF_GPU-0.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e2a58f7c079d35989be213a40c8b9e7ab51c44d9d4d17fe047e402154705fe1f
MD5 689a564269e2cd6487908db0012a3e24
BLAKE2b-256 f84d77215d648f5a499370f0a805b53a5688ff0d1ca45cd72ff7ceb2ed3076d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BabitMF_GPU-0.2.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 58c2c3b96f15efb273b36cac0cb9145b3f0631abfe39ab8977774bbe7b4b32e5
MD5 fcade96e7ecbe45aa1d4ac6bbc450f7c
BLAKE2b-256 bd700d57c962bf269f29d59e8addf98280a216820754655789ac647568527ccb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BabitMF_GPU-0.2.0-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0861e4c2c3c3c11469f1ff9ca421077e4b45ec72f65fecc036c8bca298a753cc
MD5 97ad2f0f1e198ae1381c87fd26090797
BLAKE2b-256 1155c16647831d8c3c18cfa57b971720b0be963195e144aeb86996a57c6cdb55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BabitMF_GPU-0.2.0-cp36-cp36m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1cec47d24d51e3211b7bcdd07413ebcf1325034264009997b72656295cdbf10c
MD5 fc3be68d13dfe768a3656218af861942
BLAKE2b-256 b28a974f94dc9e4bd0df6b1dfbd4d9caa18914f6c0eedb1a60a10bb0c5497967

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