Code Monkey home page Code Monkey logo

raspberrypi-openmax-h264's Introduction

openmax-h264

An OpenMAX IL example that records an H.264 video with a Raspberry Pi

The Multi-Media Abstraction Layer (MMAL) library provided by Broadcom is not documented, so it's nearly impossible to understand how to use it. Furthermore, it's a library that wraps all the OpenMAX IL specification, so if you simply need to record an H.264 video like in this example, you can just ignore that extra layer and talk directly to OpenMAX IL. Once you understand OpenMAX IL, it's affordable to try to write your own programs without MMAL. In other words, if you are new to the OpenMAX world, it's better to learn OpenMAX IL than MMAL, which is not documented and only works with Broadcom devices.

This example records a 3 second video in H.264 format. The components involved are: camera, video_encode and null_sink.

If you want to play the video, you'll need to wrap it with a container format (some video players couldn't require this step), e.g. Matroska. You can download Matroska tools from here. Then, convert the H.264 file to a Matroska file:

$ mkvmerge --default-duration 0:25p -o video.mkv video.h264

Where 25p is the encoding framerate of the h264 video. For example, if you record 640x480 @30fps, then you should encode the matroska file with --default-duration 0:30p.

Build steps:

  • Download and install the gcc and make programs.
  • Download this repository.
  • Compile and execute: make && ./h264

Useful documentation:

raspberrypi-openmax-h264's People

Watchers

 avatar  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.