Name: Benoit Nadeau
Member since: 2002-04-03 17:23:09
Last Login: 2014-04-22 17:48:00



I am Benoit Nadeau, jr. eng. in Software Engineering,
living and working in Montreal, Canada.


Recent blog entries by benad

Watching YouTube and Twitch with MPV

My biggest annoyance with my Ubuntu 16.04 Linux laptop is that watching a video in a web browser takes way too much CPU. Maybe it’s because I use a high-DPI display, maybe it’s the version of Unity that I’m using, I can’t tell. I’ve tried tweaking obscure Google Chrome options to enable hardware acceleration and installed extensions to force YouTube to use H.264, with little to no difference. I’ve also tried using other web browsers like the latest Firefox.

All the while, the MPV video player, a descendent of MPlayer, played any video I’ve thrown at it will little CPU usage and with full hardware acceleration. What if I could stream at least YouTube and Twitch directly to it?


For Twitch, there is a command-line Python 3 tool called Streamlink that can lauch MPV for many video streaming web sites, including Twitch.

  $ sudo -H pip install streamlink
$ streamlink --player mpv best

For a nicer GUI experience to find and view Twitch streams, you can install Streamlink Twitch GUI. It also makes it easy to launch both the video and the chat room of a stream, and get notifications when a channel you follow goes live. Make sure to select MPV in the settings of the GUI if you prefer it over VLC (like I do).


For YouTube, I found the mps-youtube tool. It is designed to play YouTube music video playlists, but you can enable video display and play individual video pages.

In my tests, version 0.2.7 worked well for me, though later versions had issues.

  $ sudo -H pip install youtube-dl mps-youtube==0.2.7
$ mpsyt
> set show_video true
> exit
$ mpsyt playurl

Syndicated 2018-05-08 23:47:22 from Benad's Blog

Those Games About the Creed of Assassins

Roughly once a year, Ubisoft sells the “Animus Pack”, a digital version of all the Assassin’s Creed games for PC (except the latest AC Origins game), including almost all DLCs and season passes included, all for a reasonable price. So I thought, why not try out that assassin game thing made in my hometown?

The Assassin’s Creed games felt like a microcosm of the evolution of “AAA games”. Having played all those 13 games released in the span of about 9 years in a bit more than a year, it felt like experiencing the entire video game industry’s evolution at ten times the speed.

But first, back to what the games are actually about. The first game was quite experimental and innovative. The story happens in a fictional version of the current time. Your character has been kidnaped by some scientists that force you to interact with a bed-like device (the “Animus” thing) that lets you relive a simulation of your ancestor’s past that was encoded in your DNA. The simulation then is about an assassin living in the Middle East during the 3rd crusades, in a battle between the shadowy assassins versus the templars. Conspiraties abound about how both factions secretly influenced pivotal events in our history (well, the game’s fictional history).

The game really emphasizes the “game within a game”, with two levels of game menus, one within simulation, and one outside the Animus. The simulation uses terms like “synchronization” to mean completing a level, and “desynchronized” instead of “game over”. The controls are unique, with each button corresponding to body parts: top button for head (look), left for closed hand (punch), right for open hand (push and interact), bottom for feet (walk slow), plus the right shoulder button as a “high stance” modifier (“eagle” vision, weapon, running, jump, etc.). The parcour-like platforming is quite difficult, especially combined with the unique controls, but doing so successfully is very satisfying. The assassinations proper involves lots of planning, and escaping thereafter with the alarm bells ringing is exhilarating.

The detailed environment is immersive, with lots of cultural and historical details, combined with just enough fiction to not be too offensive to any of the cultures involved. On one hand this level of detail seems unnecessary to the gameplay, on the other hand it is so well crafted that it cannot be ignored. The historical back and forth with the inclusion of various fictional conspiracy theories was brilliantly written, and the abrupt ending of the first game that continues immediately in the second was perfectly executed.

With the success of the first game, Ubisoft got ambitious. The sequel AC II is in all aspects better that the first game, and many consider it a classic video game. From there though, the pace started to get a bit hectic. Once game would be released per year, often with another studio building the “minor” sequel (AC Revelations, AC Rogue, AC Chronicles, AC Syndicate, let alone mobile games) while the main Montréal studio would work on the following “major” sequel (AC Brotherhood, AC III, AC IV, AC Unity). The minor instances would obviously remain close to the previous game’s engine, with only a few gimmicks, which the major instances would have heavy engine rewrites, bringing in new innovations and lots, lots of bugs.

Starting with AC III, the game’s design quickly aimed for a more casual audience, with a simplification of the game controls and making the platforming more “automated”, at the cost of less and less player agency, meaning those cool parcour jumps are pretty much automated. The “current day” aspect of the story catches up with the 2012-inspired consipiracies with AC III, and goes through a story shift where not only nearly all conspiracies are revealed, but the current day story became quickly irrelevant and abandoned in the rest of the series. Compared to the more open exploration of the previous games, AC III focuses so much on its (rather subpar and pretentious) story that it ends up feeling like an endless sequence of linear missions and condescending tutorials.

AC II introduced DLCs, AC III introduced the “season pass” with a whole side story sequence, AC Unity introduced co-op and dubious online connectivity requirements, plus in-game currency and micro transactions. All those extra missions and season pass stories are generally outsourced, of lower quality than the main game. Each game had more and more “side things”, from simply collecting items you find on the map, to strategy games with a real-time clock (to be used with the now unavailable iOS apps), to the out-of-place boat missions shoved in AC III, to the absolutely horrible tower defence game of AC Revelations. Getting 100% completion (“100% synchronization”) in those games is a gigantic waste of time. By AC Unity and AC Syndicate, game bugs and other modern gaming crap is now pretty much the norm. There are still quite of lot of fun elements, but the annoying parts that were charming due to a lack of experience in the early games were replaced with corporate greedy crap in the later games.

And yet, the art direction remained absolutely spectacular, unmatched by any video game I’ve ever played. The environments are beautiful, the music exquisite, with great homage and attention to the historical context. The virtual historical tourism of the Assassin’s Creed games almost cancels out all the gameplay and technical issues. And in the case of AC II and AC IV, the games are actually quite fun too, hence why those 2 games are so highly praised. For the other games, unless you really enjoy walking around those virtual historical towns and experiencing the locale’s population, sounds and music, they are not worth the effort.

So, yeah, play AC, AC II and AC IV (and maybe AC Syndicate), forget about all those DLCs and season passes (even if you get them for free), and read online the missing story bits from AC Brotherhood, AC Revelations and AC III. Oh, and skip the movie.

Syndicated 2018-03-30 22:48:06 from Benad's Blog

Raspberry Pi as a DVR

As I mentioned in a previous post, I started using my Raspberry Pi as my “always on” home server. This allowed my to place my other devices into either standby mode or shut down, and power them on using the Pi only when needed.

It just so happens that one of the devices was my Plex media server. As I already have an Antenna and a TV tuner (the HDHomeRun Extend), in addition to the “Plex Pass”, I wanted to use my Plex server to record Over The Air (OTA) TV shows, when I ran into the problem that my server was in standby most of the time and would miss its recording schedule. Sure, this is a seemingly important missing feature of the Plex DVR, but I guess I could write some scheduled script on the Pi to wake up the Plex server just before recording happens. Or what if I could just run a Plex server on the Pi just to record TV shows?

So I connected one of my spare portable USB drive to the Pi, installed a Pi version of Plex following the instructions on the dev2day site, and it worked! Sure, the primary limitation of the Pi compared to a PC, and why I won’t move my main Plex server’s content to the Pi, is its very limited CPU, to the point where all form of transcoding should be avoided. For OTA recordings, the format is typically MPEG-2 or MP4 for the video, and typically AC3 for the audio. On most devices there is a built-in AC3 decoder, including the Apple TV 4th Generation, the LG TV app and the iPad Air 2, so no transcoding was needed. On my iPhone SE the AC3 decoder didn’t work (I even tested with the VLC app), and the transcoder on the Pi was just too slow for a smooth playback. And, of course, playing back the recording from the Pi itself on HDMI is far too slow.

If you combine an antenna, the HDHomeRun Extend, maybe some network switch (depending on setup and how many spare ports you have on your router), the Rasperry Pi, a low-power portable USB drive, the Plex Pass and finally an Apple TV, you have a complete and quite low-power OTA TV DVR solution and “cutting the cord” solution. Sure, it could be cheaper if you replace the Apple TV with something else (Does the Roku have AC3 decoding? Or maybe use your “Smart TV” Plex app), but for sure the overall experience is much better than whatever crap you get with your cable provider’s DVR.

Syndicated 2018-01-09 21:59:18 from Benad's Blog

Batteries and Planned Obsolescence

There has been “mainstream news” recently about how Apple slows down phones using older batteries. I wondered how companies building electronics that have non-user-serviceable batteries should handle this, until I came over an example where a company is not only upfront about it, but integrate it into their marketing and business.

The Tile is a small Bluetooth device that would attach to some valuable to make it easier to find if it gets lost. For its use of a battery, it looks like the worst possible scenario: Their batteries cannot be recharged or replaced at all, and last about a year. Put another way, it will be automatically obsolete within a year.

At minimum, their product sheet are clear about that one-year life span, and almost try to sell it as something technically impressive (it somewhat is). In addition, near the end of that one-year period, they offer a recycling and replacement program called reTile that gives a yearly (but unspecified) rebate to replace your existing devices with new ones.

Put another way, they are quite upfront about the obsolescence of their electronic devices, and customer retention is done through yearly rebates. This is the complete opposite of what Apple did: Align both customer expectation with device repairs or replacements programs. Could the batteries be bigger? Surely. Could they be easier to replace? Surely. But if for any reason you don’t do so, at least be upfront to your customers about it. Doing so is far better than losing customer trust.

Syndicated 2017-12-29 15:59:00 from Benad's Blog

Raspberry Pi: Your Home Linux Server

Looking at the Raspberry Pi web site, you’d think that this small Linux-based computer is only useful for robotics and STEM activities for kids. And yet, for the past few months I’ve been using it as my home Linux server.

I’ve been looking for a long time for a small “embedded” server I could use as a hub for my home appliances, and something that stays on so that I can “phone home” remotely. Sure, I could recycle an old PC or laptop, but that would be too noisy or take too much electricity. Even the small Intel “compute sticks” have small fans, and it’s unclear if they can support Linux at all.

The Pi is not only cheap (about $40), but runs Linux, is completely fanless and takes little electricity. In my own tests, it takes between 240 mA (HDMI off) and 270 mA (HDMI on) on a USB 2 5.1V connection, effectively making it use less power than a sleeping Mac mini (1.22 W vs 1.25 W as per its environmental report). As a result, I leave all my devices in standby or sleep mode, and use the Pi to remotely power on devices using WoL packets.

The Pi runs off a micro SD card, making it easy to swap it out with another Linux system or backup. It supports many Linux distributions, and its main supported one, Raspbian, is based on the latest Debian 9 “stretch”. It comes built-in with Python 3 and gcc, so it is easy to install Python modules from Debian itself, or compile them using pip3. Running a small Python web service on it has been a breeze.

If you’re unfamilliar with Linux, Python or programming in general, don’t worry, the Pi was tailored for schools. It has a full graphical desktop, and several tools to learn programming like Scratch, thonny, and various STEM-related tools.

Sure, its 1 GB of RAM makes browsing the web with it slow and limited, while its shared USB 2 bandwidth makes it slow as a large file server or media center, but otherwise it can do a lot, for very cheap. If you want to learn about programming or web server development on Linux, and use that to do cool things in your house, with very little risk, the Raspbian Pi is for you.

Syndicated 2017-11-07 01:02:16 from Benad's Blog

137 older entries...


benad certified others as follows:

  • benad certified benad as Journeyer
  • benad certified llasram as Journeyer
  • benad certified shlomif as Journeyer

Others have certified benad as follows:

  • benad certified benad as Journeyer
  • llasram certified benad as Journeyer
  • pasky certified benad as Apprentice
  • badvogato certified benad as Apprentice
  • sye certified benad as Journeyer

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

Share this page