Code Monkey home page Code Monkey logo

omxremote's Introduction

omxremote

Web interface and API for Raspberry Pi Omxplayer.

Overview

Omxplayer is made specifically for Raspberry Pi (RPi) and is one of the most simpliest video players you can find. Although there are many others, including raspbmc that work as a full-blown media center, omxplayer is a perfect fit for systems that do not have any GUI or peripherals and running stock Rasbpian OS. However, omxplayer was designed to be controlled via keyboard shortcuts and does not provide any way to control it remotely.

Omxremote project is an attempt to build a web frontend and simple API to control video playback on a remote RPi device. Its built in Go, which has capability to cross-compile source code for ARM and as a result provides a single binary with no external dependencies to be downloaded and installed on your Pi.

Screenshot

Requirements

In order to use omxremote you must have omxplayer installed on your RPi. Most recent distributions on Rasbpian should already come with omxplayer preinstalled.

In case if you dont have it installed, use the following commands:

sudo apt-get update
sudo apt-get install -y omxplayer

No special permissions are required in order to play videos with omxplayer and omxremote.

Install

Use Github Releases

Or run the following snippet for quick install:

curl -s https://raw.githubusercontent.com/sosedoff/omxremote/master/install.sh | bash

Compile

Compiling this project on RPi is a bit of a difficult task and does not necessarily makes sense since Go provides ability to cross-compile source code for multiple platforms on your local development environment. You can do that by following the steps:

make setup
make release

That will produce a binary that's ready to be transferred and executed on your RPi. In cases if you dont have Make available on your system, you can execute the following commands:

go get
GOOS=linux GOARCH=arm go build

Usage

To start omxremote, run the following command:

omxremote /path/to/media

Server will start on port 8080 and listen on all network interfaces. You can connect to it if you have any device (laptop, phone) on the same wifi network. If you dont know the IP address of your RPi, run ifconfig.

Running as daemon

You can run omxremote in a daemon mode with init.d. First, make sure omxremote is installed in a right place:

which omxremote
# => /usr/bin/omxremote

Use the following example to create a new init.d script:

sudo nano /etc/init.d/omxremote
sudo chmod +x /etc/init.d/omxremote

And then you can start the remote:

sudo /etc/init.d/omxremote start

API

Endpoints:

  • /status - Returns current player status
  • /browse - Returns files in specified media directory
  • /play - Start media playback
  • /command/:name - Execute a command

Available commands:

  • pause
  • stop
  • volume_up
  • volume_down
  • subtitles
  • seek_back
  • seek_back_fast
  • seek_forward
  • seek_forward_fast

Troubleshooting

ERROR: COMXAudio::Decode timeout

If you see this error when playing video files, make sure to give more memory to raspberry pi GPU. On B+ model the default is 16mb. Try setting it to 64/128mb. To edit settings, run: sudo raspi-config.

License

The MIT License (MIT)

Copyright (c) 2014 Dan Sosedoff, [email protected]

omxremote's People

Contributors

mckael avatar sosedoff avatar

Watchers

 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.