Skip to content

mmstreamer is a media streamer written in C and made for the linux OS.

License

Notifications You must be signed in to change notification settings

BoubacarDiene/mmstreamer

Repository files navigation

GitHub license Build Status

Table of contents

Install and run

  • INSTALL : Prepare your environment and build mmstreamer project (with or without docker)
  • TROUBLESHOOT : Fix issues encountered when building and/or running mmstreamer
  • HOWTO : Run mmstreamer, update configuration files, etc.

Description

mmstreamer is a v4l2-based media streamer written in C that currently allows to stream captured video frames through inet and/or unix sockets.

Any client (HTTP browser, VLC, ...) from any device (mobile, computer) can be used to connect to its server(s).

However, mmstreamer provides its own "Clients" module which can also be used to get video signal from a remote streamer and display it locally using "Graphics" module.

The application aims to be an easy-to-use application that can be customized to suit your own needs.

Modules

mmstreamer currently includes 4 independent modules :

  • Videos : To capture frames from video devices
  • Servers : To stream frames using unix or inet socket
  • Clients : To get video stream from local or remote streamer
  • Graphics : To locally display video

Configuration

It has been designed to make configuring above modules as simple as possible. Unless you have very specific needs, the following xml resources should be sufficient to use it :

File Description
Main.xml Choose which modules to launch and how to keep app alive
Videos.xml Configure video devices and outputs
Servers.xml Configure servers
Clients.xml Configure clients
Graphics.xml Customize UI and locally display captured video
Colors.xml Define colors
Fonts.xml List fonts files
Images.xml List images files
Strings.xml Define strings

Control

mmstreamer engine can currently be controlled in two different ways :

  • By user using graphics elements on the UI (See Graphics.xml)
  • By an external library without any user action

Such libraries are listed in Main.xml --> Controllers and are simply called "controllers". See mmcontroller project to get some ideas about creating a controller.

Usage

HOWTO gives details on how to use mmstreamer.

Another simple usage is to make it behave like a HTTP streamer by streaming video signal from your personal computer's webcam toward browsers.

To reach this goal, "Videos" module continuously captures frames from camera which it can locally display using "Graphics" module before they are sent to connected clients through "Servers" module.

As mentioned earlier, all kinds of clients are supported : Browsers, Applications (VLC, ...) Connections can also be initiated from any type of devices (computers, mobiles).

Finally, note that mmstreamer can have different other usages. Your mind is its only limit. For example, by enabling "Clients" and "Graphics" / "Servers" modules ("Videos" disabled), it is possible to get video from a remote streamer (E.g. vlc - See below) and display it locally and/or stream it over another network interface.

 cvlc v4l2:///dev/video0:chroma=mjpg:width=640:height=480 --sout '#std{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=127.0.0.1:9090/webcam}'

Goal

The initial purpose of mmstreamer project was to help me have a better understanding of v4l2 API. It was only composed of one .c file which captured video signal from my personal webcam and made it available to HTTP clients.

Because I think it can be useful to many people, I will make mmstreamer evolve by gradually adding new features taking advantage of possibilities offered by v4l2 API (among others) :

  • Webcam video capture
  • Simultaneously capture from several video devices
  • Stream video frames through inet and/or unix sockets
  • Locally display video on a customizable UI
  • Get frames from remote video streamers as a client
  • Make mmstreamer extensible and controllable from external libraries
  • Play and stream local video files of any formats
  • Video recording
  • Motion detection
  • Support of TV tuners
  • Encryption to secure the data before transmission
  • Code cleaning

License

mmstreamer is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) version 2. Please, see http://www.gnu.org/licenses/ for more details.

Maintenance and support

I do all this on my free time without being paid or asking for any donations. Thus, bug fixing and updates mainly depend on my availibility.

However, I will soon try to write and provide all necessary documentation so as to make mmstreamer easier to understand.

UI example based on provided config file

This simple UI has been designed using Graphics.xml.

In this example,

  • Video capture is performed from my personal computer's webcam using "Videos" module
  • Captured frames are displayed locally at top-left of video area by "Graphics" module
  • Frames are then streamed over a local inet network using "Servers" module
  • "Clients" module connects to that server and displays received data at bottom-right of video area
  • "Stop" / "Start" buttons can be used to stop/start client
  • It's also possible to take screenshot (Everything diplayed saved to /tmp/mmstreamer/screenshot_xxxx.png) and selfy (Last frame displayed in top-left video area is saved to /tmp/mmstreamer/picture_xxxx.png)
  • etc

alt text