Increasing volume on a video

September 11th, 2019

I was asked to improve the volume of a home video (to be merged with others into a congratulatory video). Thanks to the magic of the internet, I found out how to do so using ffmpeg!

Step 1: extract the sound into a .wav file, with increased volume.
(source on how to do this)
Default sound level for ffmpeg is 256. Increase that (e.g. to 2048) to get more sound.
Example for a video file called input.mp4:

ffmpeg -i input.mp4 -vn -vol 2048 audio.wav

Step 2: merge the original video with the new sound.
(source on how to do this)
You want to merge the two, and you’ll have to select which video and which audio stream should end up in the output file. Without further ado:

ffmpeg -i input.mp4 -i audio.wav \
-c:v copy -c:a aac -strict experimental \
-map 0:v:0 -map 1:a:0 output.mp4

Tadaa! output.mp4 now holds the combined video+audio.

Bluetooth sound under Ubuntu

March 6th, 2019

Interestingly enough, if you connect a Bluetooth speaker or headset to your Ubuntu computer, you may experience rather… crap sound. Turns out that there is actually an option under “Sound settings” (16.04) that is called “Mode”. For my current test with a JBL Charge 2, it has two options:

  • Headset Head Unit (HSP/HFP)
  • High Fidelity Playback (A2DP Sink)

The headset head unit was selected by default, and of course, you want hifi playback. *sigh*.

Hat tip to https://forums.linuxmint.com/viewtopic.php?t=40099.

Screen capture on Ubuntu 16.04

December 18th, 2018

I needed to make a short video of my screen. Turns out that there is a way to do this that is probably already on your system: using ffmpeg!
The full command:

ffmpeg -f alsa -i pulse -f x11grab -r 15 -s 1920x1080 -i :0.0+0,0 -vcodec mpeg4 -acodec libmp3lame -ar 48000 -qscale 0 OUTPUTFILE.avi

This works well enough for a quick screengrab. Of course, it also grabs audio, which I didn’t need, but okay.

Wunderground weather calendar links for the Netherlands

May 20th, 2018

In the new Google Calendar, weather is no longer shown. That’s a pity!

Thankfully, there is something of a workaround, suggested here and further expanded upon for locations outside the USA here.

Synopsis: you can get a calendar file from Wunderground! Excellent! Here’s how it works:
you download https://ical.wunderground.com/auto/ical/global/stations/NUMBER and you get the weather forecast for the weather station with number NUMBER.
All you need to do is somehow find the station number of a station near you. That was probably part of the URL, but when I looked for stations near me, it didn’t seem that way.

However, I lucked out, in that one of the three links by Chris Short actually pointed to the Netherlands! So, I did what anyone with access to wget and shell scripting could do: I just bruteforced. Interestingly enough, they’re mostly along the coast. Without further ado, I proudly present the list of station numbers in the Netherlands:

06200: Delft
06208:Ternaard
06210:Leiden
06225:Velsen-Zuid
06229:Den Burg
06235:De Kooy
06240:Amsterdam
06242:Vlieland Island
06244:Hoorn
06247:Haarlem
06248:Volendam
06249:Alkmaar
06250:Baaiduinen
06251:Seerijp
06257:Beverwijk
06258:Enkhuizen
06260:Utrecht
06265:Hilversum
06267:Workum
06268:Lelystad
06269:Biddinghuizen
06270:Leeuwarden
06273:Emmeloord
06277:Augustinusga
06278:Boskamp
06280:Assen
06310:Vlissingen
06312:Ouddorp
06315:Yerseke
06316:Veere
06320:Oude Nieuwland
06323:Goes
06324:Dirksland
06330:Hoek Van Holland
06331:Halsteren
06343:Rotterdam
06344:Dordrecht
06348:Gouda
06356:Aalburg
06370:Eindhoven

Printing new OU style

October 23rd, 2017

OU logoThis is a followup of my previous post on printing at the OU, due to new printers being installed.

The new process is somewhat easier:

  • Add new printer
  • Choose LPD and give as name the print queue IP address
  • Choose to install a driver from file, and download the Konica Minolta driver for the C368 (which covers a whole range of Konica printers)
  • Set the options according to the documentation for Macs
  • Finally / most importantly, make sure to submit print jobs under your acronym.
    • for command-line programs: set up an environment variable CUPS_USER. Set it to be your acronym, i.e. export CUPS_USER=acro.
    • for generic purposes: lpoptions -dPRINTER -o requesting-user-name=ACRONYM
  • Now you’re ready to print!

SSH dsa keys deprecated on Ubuntu 16.04

July 4th, 2017

SSH logoSince I’ve upgraded to Ubuntu 16.04, SSH also was upgraded. In the version shipped with Ubuntu, ssh-dsa keys are deprecated. This means that if you perform a reinstall and transfer your old files (and old .ssh directory), you may actually have keys that the server will accept, but your local client won’t.

*sigh*.

Generate some new keys. Use rsa for a well-supported / broadly-accepted key format, use ecdsa or ec… for the shiny new thing where current consensus thinks it’s pretty secure.

Installing Ubuntu 16.04

June 28th, 2017

Ubuntu logoRecently, I had my trusty Z930 upgraded to a shiny new 500GB disk (instead of the 128GB disk it used to have, divided over 2 OSes…).
Of course, the disk was completely empty. Plug in an Ubuntu 16.04 live USB stick, click install, and everything’s fine? Nope…. start_image() returned not found plus a bunch of EFI startup files that weren’t, apparently, found.

There was a problem with EFI. And there are tons of solutions out there. The following quoted solution ended up working for me (found at https://askubuntu.com/questions/597052/can-not-boot-anymore-after-a-boot-repair). Begin quote:

  • Boot the system from live USB stick and mount the harddisk, e.g.
    sudo mount /dev/sda1 /mnt
  • After checking the content of my directory with the ls command, I found out that /EFI/Boot was already there. So I made a backup of bootx64.efi by typing
    sudo mv /mnt/EFI/Boot/bootx64.efi /mnt/EFI/Boot/bootx64.efi.backup
  • Then I copied all the content of the /mnt/EFI/ubuntu into /mnt/EFI/Boot with the following command line:
    sudo cp /mnt/EFI/ubuntu/* /mnt/EFI/Boot
  • Finally, I renamed the file grubx64.efi to bootx64.efi by typing
    sudo mv /mnt/EFI/Boot/grubx64.efi /mnt/EFI/Boot/bootx64.efi

Lessons learned: if fighting with the boot process, make sure to have an extra computer to google solutions. It’s unbelievably frustrating if every attempt to fix the problem means you lose all the info you’ve gathered so far and have to find everything afresh.

Displaylink driver hogging CPU

June 28th, 2017

OU logoDisplayLink logo
As mentioned before, DisplayLink works over USB3.0 connection. Hooray!

Except that the current driver is hogging unfortunate amounts of CPU. ~2% when nothing’s happening, but up to 80% when switching windows. I noticed it because of harsh lag. I mean, my computer isn’t the newest on the block, but it still should be pretty awesome. Typing in an online form should be trivial, not something that causes delays…. but it wasn’t.

Getting frustrated with the lag, I’ve uninstalled the driver for now. Life immediately sped up.

How to fix a Unity crash

February 23rd, 2017

Ubuntu logoDue to some nefarious use of my computer by me myself and I (unplugging a monitor and closing the lid in some order), something weird happened with the display. All the window decoration was gone. No keyboard shortcuts, no menubar, not top bar, nothing.

Menu and top bar and window decoration are handled by Unity. And indeed, this turned out to be a Unity problem. The solution was to re-enable Unity and then re-enable the “desktop wall”.
Steps:

  1. Open a terminal, e.g. by opening a folder, surfing to /usr/bin and double-clicking gnome-terminal
  2. enter ccsm to start the CompizConfig-Settings-Manager
  3. Search for “unity plugin” and enable it.
    A few warnings pop up, agree to them all

After a bit of processing, you should now have a menu bar, a top bar, and decoration on windows (such as close buttons).
Ctrl+Alt+Arrow might not work yet. To enable it:

  1. Still in ccsm: search for “desktop wall” and enable it.

With help from:

Thunderbird+Lightning not processing ICS attachments

July 11th, 2016

Thunderbird logoIn some cases, Thunderbird+Lightning plugin (calendar plugin) do not process an email with an attached ICS file as a calendar event. Bug report. Yet another years-old bug not being handled :s.

Anyway, workaround: open the Today Pane (F11) and drag&drop the ICS file on there. Interface isn’t brilliant, but it works for now.