Wednesday 8 July 2015

Setting up Open Broadcasting Software on Ubuntu

Introduction:

Open broadcasting software (OBS) is one of those really awesome tools out there for streaming video from your PC.

You can find out more information about them from this link.

Installation:

First things first, make sure you've got the required hardware (I found this out the hard way)

Install mesa-utils like so:

sudo apt-get install mesa-utils


after that run the command below:

glxinfo | grep OpenGL

Check the resulting string for your Open GL version, OBS requires that you have Open GL >= 3.2

If you don't, then you will have to change your GPU .

If you are among the chosen, and your system is good to go, next step is to install some dependencies.

OBS requires ffmpeg and so if you do not already have it installed, I suggest you hit this link for a guide.

Now with ffmpeg installed, the next step would be to install OBS.

Add the OBS ppa like so

sudo add-apt-repository ppa:obsproject/obs-studio


Then:

sudo apt-get update && sudo apt-get install obs-studio


When I did this, I got this error:

Depends: libavcodec-ffmpeg56 (>= 7:2.4) which is a virtual package. 

Depends: libavdevice-ffmpeg56 (>= 7:2.4) which is a virtual package.

Depends: libavfilter-ffmpeg5 (>= 7:2.4) which is a virtual package.

Depends: libavformat-ffmpeg56 (>= 7:2.4) which is a virtual package.

Depends: libavutil-ffmpeg54 (>= 7:2.4) which is a virtual package.

Depends: libswresample-ffmpeg1 (>= 7:2.4) which is a virtual package.

Depends: libswscale-ffmpeg3 (>= 7:2.4) 


Quick fix, you need to add the universe source to your list of sources, so edit the /etc/apt/sources.list file and add this line at the end of the file:

deb http://us.archive.ubuntu.com/ubuntu vivid main universe

Then the usual:

sudo apt-get update && sudo apt-get install libavcodec-ffmpeg56

And you can install obs-studio like so:

sudo apt-get install obs-studio
And you're good!

Installing FFMpeg in Linux (Debian and Ubuntu)

So this was surprisingly easy. I had tried to do this a few months back (a method that involved building from source *weeping*  *sobbing hysterically*)

The FFMpeg guys (God bless their souls) have an excellent guide on their website.

For Debian:

The instructions are here:

Basically follow these steps:

1. check your debian version ( cat /etc/debian_version)

2. Depending on your debian version ( squeeze = Debian 6, wheezy = Debian 7, jessie = Debian 8), add one of the sources  given in this link to your /etc/apt/sources.list file.

3. As at the time of writing this, the maintainer of the repository had some issues with his GPG key, so as instructed by him, run the following first

wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2015.6.1_all.deb

and

sudo dpkg -i deb-multimedia-keyring_2015.6.1_all.deb

Then
sudo apt-get update

and finally
sudo apt-get dist-upgrade

With this all done you can now run (with peace of mind):

sudo apt-get install ffmpeg

And that's it, you're good to go.

NOTE: This was pretty straightforward(maybe too easy even), I am still observing to see if any issues come up.

For Ubuntu:

Basically add the Ubuntu Multimedia PPA like so:


sudo add-apt-repository ppa:mc3man/trusty-media


Then update and upgrade like so:
sudo apt-get update && apt-get dist-upgrade

And finally like before:
sudo apt-get install ffmpeg


And that's all.
God bless the FFMpeg guys for some detailed instructions!

Monday 6 July 2015

Password Protect specific URL with htpassword

So I found this on stackoverflow here.

But here is the gist:

Enable your mod_auth, and mod_env apache modules and add the following apache directives to the Directory section of your virtual host configuration:


# Do the regex check against the URI here, if match, set the "require_auth" var
SetEnvIf Request_URI ^/pretty/url require_auth=true

# Auth stuff
AuthUserFile /var/www/htpasswd
AuthName "Password Protected"
AuthType Basic

# Setup a deny/allow
Order Deny,Allow
# Deny from everyone
Deny from all
# except if either of these are satisfied
Satisfy any
# 1. a valid authenticated user
Require valid-user
# or 2. the "require_auth" var is NOT set
Allow from env=!require_auth

And reload your apache and you are a go