HTML5 YouTube

August 4, 2013

As you could already read in the past, I’ve been experimenting with Flash Player and YouTube for some time now. The conclusion is: I really don’t like Adobe Flash Player, but i do like to watch my YouTube videos. It turns out YouTube offers HTML5 video’s through their opt-in html5 test program, but not even half of the videos i want to watch are available through that channel. This results in the “Install Flash Player” message almost every time i want to watch a YouTube video.

But then i made a strange discovery: when watching embedded videos, most of them did seem to play in the html5 player! If i then tried to watch them on YouTube.com, they tried to get me to install Flash Player again. Seems like YouTube has a deal with Adobe 🙂 Anyway, i made a GreaseMonkey script to replace the YouTube.com videos with the embed, so that you can always watch them in the html5 player. As a bonus, you get non-autostart for your movies, and no more advertisement movies before you can watch the movie you picked!

Download the GreaseMonkey script here

Good luck!
Toon

Almost every Mac OSX user knows how to make screenshots. It’s a built-in feature of OSX.

For a complete screenshot:
cmd + shift + 3

To grab a part of the screen:
cmd + shift + 4 and then select which part you want to grab.

To grab a single window:
cmd + shift + 4 and then press space. Now you can select the window you want to grab.

These default key combo’s do not grab your mouse pointer. If you want to grab the mouse pointer, you can make screenshots with the (also default on OSX, but hidden in utilities) ‘Grab’ or ‘Schermafbeelding’ (in dutch) appliciation. You can find it using spotlight or in /Appliciations/Utilities/. Use the Preferences dialog to select the pointer and other options.

Last but not least, for people who really want to have more options, regarding filenames, file formats, the annoying camera/photo sound, … of their screenshots: there’s a solution for you too!
The heart of the ‘Grab’ application and the key combos is a command line tool that’s also installed by default on Mac OSX. It’s called ‘screencapture’ and you can read more about it using the man screencapture command in your Terminal. Here’s an example:

screencapture -Cx -t jpg -T 10 Desktop/Test.jpg
-C: Capture the mouse cursor too (default is without mouse cursor)
-x: Don’t play the camera sound
-t jpg: Choose JPG file format instead of the default PNG
-T 10: Set timeout for 10 seconds
filename: Set the path and filename to write the screenshot to.

That’s it! 🙂
Toon

I’m a huge fan of ffmpeg, as you know from my previous posts about it. Before this day, i always used one of my linux boxes or virtual machines to use ffmpeg. Not anymore! I found a way to get ffmpeg on your mac very easily.

1. Download the FFMPEGX package from here.

2. Mount the disk image (.dmg file).

3. Right Click The FFMPEGX app in the dmg file, and click ‘Show Contents’.

4. Navigate to 'Contents' > 'Resources'.

5. Copy the ‘ffmpeg’ program, paste it into your Applications folder.

6. Boom! Ready to go! Try typing /Applications/ffmpeg in your terminal. For other commands, check my previous posts about ffmpeg.

Attention: the ‘libmp3lame‘ encoder does not exist in this particular OSX build, use ‘mp3‘ instead.

PS: on iFFmpeg’s site, they link to some other websites where you can get more recent builds of FFmpeg. This is highly suggested, because the package bundeled with ffmpegx is old and doesn’t have WAV, H264 and a hole lot of other codecs, but the newer packages have.
PPS: iffmpeg’s site seems to be down once every so often, so i’ll put the link here: ffmpeg binaries

That’s it 🙂 Happy Encoding!
Regards,
Toon

Not so long ago, i updated one of my previous posts on ffmpeg with a line on how to record your favourite internet stream to disk with ffmpeg.

Actually that line doesn’t really work well if you want to record a show that’s on the radio every week, on a given day and a given time. People familiar with cron, the unix schedule program, will know you can just give it some coordinates, and it will run your comments at certain intervals. So i tried feeding that particular command to cron, but cron always failed to record my show, because ffmpeg generates way too much output. I found a workaround for that too, by redirecting all output to /dev/null.

How to do it?
(for Mac OSX or any GNU/Linux distro with cron and ffmpeg installed)
1. Determine the ffmpeg command you wish to schedule. Maybe my other posts about ffmpeg can help you.
e.g.: ffmpeg -i http://mp3.streampower.be/stubru-high.mp3 -f mp3 -acodec libmp3lame -ab 128k -ar 44100 -t 02:00:00 /home/toon/Desktop/stubru.mp3

2. Open a terminal window and type this to open your crontab file in a easy editor:
EDITOR=nano crontab -e

3. Determine the 5 crontab schedule numbers to tell cron when to execute your command (1: minute, 2: hour, 3: day of the month, 4: month, 5: day of the week with 0 for sunday). You can use wildcards (*) if you want any digit to be okay, lists (,), or ranges (-). For more info, check this reference.
I want to record every sunday at 19:00h, so for me it’s
0 19 * * 0

4. Insert those in the editor, then insert your command (devide everything with spaces).
When that is done, we still need to add the magical string to make crontab and ffmpeg work together. So type another space, and add this to the end of the crontab line: > /dev/null 2>&1. For me the result looks like this:
0 19 * * 0 ffmpeg -i http://mp3.streampower.be/stubru-high.mp3 -f mp3 -acodec libmp3lame -ab 128k -ar 44100 -t 02:00:00 /home/toon/Desktop/stubru.mp3 > /dev/null 2>&1

5. Press Ctrl+O and Ctrl+X to save and quit the Nano editor.

6. Enjoy Your Scheduled Recordings! 🙂

Today i noticed that the Apple Trailers page doesn’t let you play their videos on a GNU/Linux system by default. GStreamer couldn’t open the links to the .mov files that i found in the source code of the webpage, nor could VLC Player. Seems that Apple checks for the QuickTime User Agent string.

This means, unless GStreamer Plugin can fake that User Agent, we will have to go for a less user-friendly workaround. I downloaded the trailer i wanted to see using Wget with the -U flag to change the User Agent.

Go to the apple trailer you want to download, and copy the link to the .mov file by right clicking on the (failing) Gstreamer plugin on that page and chosing ‘copy’. Alternatively you can just go browse the source and find the .mov file there.

Now open up a terminal and type this:
wget -U QuickTime/7.6.6 http://trailers.apple.com/the-link-to-your-trailer-goes-here.mov
now you can play it using VLC Player, or your favorite video player (if it supports .mov files)

That’s it!
you could also automate the process by using a greasemonkey script or a bash script as you please…
EDIT: hack, i made one for you! It’s a php script that downloads the trailer to your home/Downloads folder.
1. download the script, rename it ‘TrailerDownloader.php’ and put it in your home folder.
2. Go to the apple trailers page and choose a trailer you want to watch (click a movie poster). Then copy the url of the page.
3. Open up a terminal (make sure you got php5, php-curl, and php-cli installed) and type
php TrailerDownloader.php http://trailers.apple.com/the-url-of-the-trailer-page-goes-here and press enter.
4. You’ll be presented with all possible trailer downloads for that movie, pick a number. Then hit the up arrow on your keyboard, and add a space and the trailer number to the end of the command. like this:
php TrailerDownloader.php http://trailers.apple.com/the-url-of-the-trailer-page-goes-here 3
5. Hit enter and wait. The trailer will be downloaded to your Downloads folder.

regards
Toon

I was looking for a good, open source, and easy to use alternative for Finale and Sibelius that i could use on both my Mac and Ubuntu installations to do my music notations.
At first i was stuck with the not-so-comprehensive Lilypond music notation software. I thought “there must be a better alternative, where i can use WYSIWYG editing mode” and yes, that existed in Musescore.
There are packages available for Mac OSX, Linux and Windows and source.
The program is very intuitive to use, if you ever used finale or sibelius before. All functions you need are there. Also there are numerous export formats supported, like lilypond, musicXML, pdf, png and a lot of others.

strongly recommended!
http://musescore.org

Toon