Monday, February 3, 2014

Blog visitor analysis and new Universal analytics from Google.

I was going through my analytic stats from this blog and thought it might be interesting and fun to make some pie charts of the 30,735 visitors I've had since signing up for analytics. Yea, I know I'm a bit weird, deal with it ;)

First I graphed the Operating system visitors used:


Next was web browser:

Then resolution:

Colour depth:

And finally flash player version:



After this I planned to check out demographics but then I discovered the new Universal Analytics system and Google Tag Manager (still not really sure what that one's for) and spent the next few hours setting them up. Everything seems to work OK so far except for the fact that I cannot upgrade my classic analytics (yet?) so I have not been able to import old data.

At least this gives a good demo of Google docs/drive pie chart generation.


Sunday, February 2, 2014

How to repeat a single frame and combine with an audio stream for upload to YouTube with ffmpeg

Yea it's 3am... but..

I just made a video for a local snow storm, it took me maybe 10-15 attempts to get a successful ffmpeg command string that would take a single jpeg frame and a separate audio stream and combine the two in a format that YouTube would accept as a video. This would be particularly useful for anyone trying to archive or share music on YouTube while just using an album cover or a single picture when you don't have a video to go with it:

In this case I had tried to record a video with my cellphone that crashed and corrupted the video requiring me to use the backup sound recorder inside windows 7. This left me with a wma2 audio file and no video stream, and of course YouTube doesn't want people to just upload audio so I had to figure a way to get around this.

C:\>ffmpeg.exe -loop 1 -r 2 -f image2 -i c:\001.jpg  -i rw1.wma -c:v libx264 -preset medium -tune stillimage -shortest -crf 18 -ab 192k  -pix_fmt yuv420p  -s 1920x1080 output.mkv


-preset medium, -crf 18 and -pix_fmt yuv420p are technically optional however if you don't know what these mean you should leave them or read up on exactly what they do.



Here is a sample video I created using this method: