Coder Social home page Coder Social logo

videoprocessing's Introduction

VideoProcessing

Frame by frame processing of video on Android using OpenGL

Frameworks used

MediaCodec, MediaExtractor

Description

The application extracts the first 10 frames of the first video track of a video file, applies some custom processing on each frame and saves it in DCIM/VideoProcessing.

Frame extraction, decoding and editing are done asynchronously.

The frame processing is done with OpenGL.

The number of frames extracted is a integer resource and can easily be changed.

The OpenGL shaders are in the assets folder. Currently, the use of the negative fragment shader is hardcoded. You can easily add your own shaders.

In addition to that, the project is quite modular so that each functionality is as separated as possible from the rest, making it easier to read and extend.

Asynchronous decoding

MediaCodec works in asynchronous mode, which is the suggested mode of operation. Still, synchronization with the OpenGL rendering thread is needed. The reason for this is that, the decoder will produce frames faster than OpenGL processing (including reading the pixels and saving to a file) can handle.

Without synchronization, frames will be dropped and the application will not decode the first specified number of frames. It will decode the specified number of frames but it is unpredictable which ones.

A significant speed up can come from saving the output bitmaps to a file offline, but it would need more memory for storing the bitmaps.

videoprocessing's People

Contributors

detsikas avatar

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.