GithubHelp home page GithubHelp logo

lyh990517 / android_h264_encoder_library Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 175 KB

The project is Create MP4 video by capturing the screen using H264 and MediaProjection.

Kotlin 100.00%
android h264 kotlin mediaprojection jetpack-compose

android_h264_encoder_library's Introduction

Screen Recording Module using H.264 and MediaProjection

Overview

This module provides a screen recording solution for Android using H.264 encoding and MediaProjection. It allows you to easily capture the device's screen and encode it into H.264 video format. Your support is greatly appreciated, so please consider giving us a ⭐star⭐ if you find this module useful!

How to Use

To use the Screen Recording Module, follow these steps:

  1. Add the module as a dependency in your Android project.

  2. Use the H264EncoderCapture interface to start and stop screen recording.

Methods

  1. startCapture(filePath: String, code: Int, data: Intent, context: Context): Initiates the screen recording process with the provided parameters.

    • filePath: A string representing the file path where the recorded video will be saved.
    • code: An integer obtained from the MediaProjection indicating the permission to capture the screen.
    • data: An Intent obtained from the MediaProjection with additional screen capture data.
    • context: The Android application context.
  2. stopCapture(): Stops the ongoing screen recording session, finalizing the recorded video.

This interface simplifies the process of integrating screen recording capabilities into your Android app using H.264 encoding and MediaProjection. It allows you to initiate and terminate screen recording with ease, making it a valuable tool for various applications.

Customization

You have the freedom to customize and tailor the screen recording module to your specific requirements. Feel free to modify the recording settings, file paths, or any other aspects of the module to best fit your application.

Usage Example

Here's an example of how to use the H264EncoderCapture interface to start screen recording:

// Start screen recording
val filePath = "your_file_path_here.mp4"
val code = // Obtain code from MediaProjection
val data = // Obtain ScreenCaptureIntent from MediaProjection

H264EncoderCapture.startCapture(filePath, code, data, context)

// Stop screen recording
H264EncoderCapture.stopCapture()

Please refer to the detailed usage code in the project :)

android_h264_encoder_library's People

Contributors

gunchimssak avatar lyh990517 avatar

Watchers

 avatar

android_h264_encoder_library's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.