Deprecated: Function create_function() is deprecated in /home/stiofan/public_html/wp-content/plugins/facebook-pagelike-widget/fb_class.php on line 174

Deprecated: Function create_function() is deprecated in /home/stiofan/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php on line 258

Warning: Cannot modify header information - headers already sent by (output started at /home/stiofan/public_html/wp-content/plugins/facebook-pagelike-widget/fb_class.php:174) in /home/stiofan/public_html/wp-includes/feed-rss2.php on line 8
Stiofan O'Connor Photographer and Wordpress Developer Sun, 11 Mar 2018 18:49:08 +0000 en-GB hourly 1 Raspberry Pi Webcam for Newcastle County Down Fri, 02 Mar 2018 00:25:49 +0000 I recently learned that YouTube now allows you to live stream 24/7 as a webcam. This is great news, having setup many webcams for businesses in the past i know the struggle of “live streaming” and the resources it can take, in the end mostly going with a still image refresh every 10-15 seconds.

Now that YouTube allows 24/7 streaming i wanted to try it out and i had a specific use for it also. I had a old first generation Raspberry Pi and pi camera gathering dust behind the TV so i dug it out and played around with ffmpeg but i think the webserver i had running was taking up too much resources to also be able to run a webcam, in the end i found a great docker solution here:

There were no 100% complete settings that were working for me and it took some time to find the sweat spot of quality and reliability, at first i was lowering and lowering the quality settings and it would still buffer on YouTube, but that low quality turned out to be the problem.

Anyway, if you just came here to figure out what settings i am using, this is what i did:

1. I followed Alex’s tutorial here to install the docker image:
2. Then used his gist to copy the congig file, i lso needed to change the file permission to get it to work right
3. My new settings which seem to keep quality and use about 1mb of bandwidth (of my 20mb upload – yes its your upload speed not your download speed this uses)
docker rm -f cam
echo Live-stream secret: $1

raspivid -o - -t 0 -w 1920 -h 1080 -vf -hf -fps 25 -b 0 -g 25 -qp 35 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i pipe:0 -c:v copy -c:a aac -ab 128k -g 25 -strict experimental -f flv -r 25 rtmp://$1

I would recommend using the pi cam v1 as you get full width native 1080p which you can’t get with the pi cam v2 direct without resizing which uses more resources. If you are using the pi cam v2.1+ then the above command will only use a zoomed in center portion of the camera, to use the native full width you can use the 16:9 (720p resolution)
of -w 1640 -h 922 or -w 3280 -h 2464 which gives you a 4:3 ration and apparently only supports 15 fps, info here:
if using the pi cam v2+ at 720p you can afford to increase the quality to around 32/30 and still keep below about 1.5mb of bandwidth.

The docker command to mentioned in the tutorial to auto restart on reboot only seemed to work if you did a soft reboot from terminal and not from a power reset reboot, to fix this i added a “” file.

Work from power reset

To make everything work from a power reset i did the following:
1. Edit the pi rc.local and add our own startup script
sudo nano /etc/rc.local
I added this line before the exit command: sudo bash /home/pi/ &
2. Create the file:
cd ~ (to take us to the pi home directory)
sudo nano (create the file)
#! /bin/sh

# remove the cam container incast it is already there
printf "Removing cam container"
docker rm -f cam

# start the live stream
printf "Starting live stream, oh yeah!"
docker run --privileged --restart=always --name cam -d alexellis2/streaming:latest xxxx-xxxx-xxxx-xxxx &

(replace the xxxx… with your youtube live key)
3. After saving the file you need to make it executable:
sudo chmod +x

And now the cam will start livestreaming straight from boot 🙂

Applying new settings

To apply new settings i do this:
cd streaming
sudo nano

You may also need to make the file executable:
sudo chmod +x
I then add my new settings and save changes.
2. Rebuild the container
sudo docker build -t alexellis2/streaming .
3. Run the docker cam container:
docker run --privileged --restart=always --name cam -ti alexellis2/streaming:latest xxxx-xxxx-xxxx-xxxx
(the xxxx-xxxx-xxxx-xxxx being the youtube streaming key.


This was running fine on my Pi v1.2 but i ended up buying a Pi zero w that came with a neat little case that also holds the camera.

So now i have a tiny live streaming webcam that will auto boot to live streaming to my YouTube channel 🙂

(soon to be installed in a local Newcastle County Down business)
Now Live:



]]> 0
Beached Whale – Newcastle County Down Wed, 04 Oct 2017 20:22:11 +0000 Yesterday as i finished work around 6pm i looked out my front window at the shore below and seen, unusually, around 50-60 people on the beach, for a moment i wondered what was going on and then i seen it, a beached whale! Is was splashing about trying desperately to free itself but to no avail. I knew i had to help it and i threw on a pair of shorts and a t-shirt, grabbed my camera and ran out side.

On my way towards the whale i seen a man in a dry suit had already reached it and was signaling for help, i took a few pictures and fortunately i was able to hand my Nikon D750 camera to one of my friends who was there before i waded in. At point another man in a wet suit was beside me and we were wading out together, by the time we were waste deep and about 50m from the waters edge John Lowery the man in the dry suit had managed to get the Minke whale free by himself.

I was so happy to see the huge whale free, but a little disappointed i was not there sooner and not able to help more.  The whale seemed to have a few cuts from its struggling but it swam away strong and seemed to have no ill effects even after its blood loss.

The Minke whale was estimated to be about 7m but i think it was much more, John Lowery had said “it had a belly full of fish” so i am guessing it got stranded while feeding. Looking back later i did remember seeing a few plumes of water in the bay earlier that day, usually this is gannets diving but i remember it was much bigger and it was most likely the whale breathing.

I got a a few interesting pictures, a short video and an awesome story. I posted some pictures to the local Newcastle County Down facebook page i run and to my suprise within 24 hours the post has been viewd by over 468,000 people!

I have also been contacted by UTV/ITN, Belfast telegraph, Irish Independednt, Mourne Observer and the BBC (who i told they could use my pictures if they pay me the equivilent of the Uk TV licence fee, which they didn’t, their loss. )

]]> 0