Remuxing the Kube Fosdem video

Christian Mollekopf did a great presentation about the Kube mail program back in early February 2017 at the Fosdem conference in Brussels. Unfortunately the audio was seriously flawed and really hard for me to listen to. The stereo audio track had the voice on the left hand side with annoying room noise on the right hand side so I set about trying to convert the audio to mono.

Remuxing is a lossless process that simply takes the video and audio streams from one container (like mp4, mkv, avi, mov etc) and puts them into a new container. Not quite true in this case as I extracted the audio, remixed it to mono, and put it back into the same mp4 container. This post is how I went about doing this so I have a procedural reference for the future. Make sure you have these packages on board…

apt install youtube-dl ffmpeg mediainfo audacity # or any audio editor

The original video is here where you can hear the voice on the left hand side…

At first, after downloading the complete video above, I tried using Handbrake to create a mono audio track but after 3 or 4 attempts it just would not do it so this is how I managed to rescue the voice track. First, let’s check out the audio and video components…

~ youtube-dl -F
[youtube] FJW06CZJyUY: Downloading webpage
[youtube] FJW06CZJyUY: Downloading video info webpage
[youtube] FJW06CZJyUY: Extracting video information
[youtube] FJW06CZJyUY: Downloading MPD manifest
[youtube] FJW06CZJyUY: Downloading MPD manifest
[info] Available formats for FJW06CZJyUY:
format code extension resolution note
139 m4a audio only DASH audio 57k , m4a_dash container, mp4a.40.5@ 48k (22050Hz)
140 m4a audio only DASH audio 136k , m4a_dash container, mp4a.40.2@128k (44100Hz)
134 mp4 640x360 DASH video 83k , avc1.4d401e, 25fps, video only
160 mp4 256x144 DASH video 108k , avc1.4d400b, 25fps, video only
133 mp4 426x240 DASH video 242k , avc1.4d400c, 25fps, video only
136 mp4 1280x720 DASH video 302k , avc1.4d401f, 25fps, video only
135 mp4 854x480 DASH video 1155k , avc1.4d4014, 25fps, video only
17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2
43 webm 640x360 medium , vp8.0, vorbis@128k
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k
22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@192k (best)

We want the best quality video and audio parts so…

# get the best audio stream and check it
youtube-dl -f140
mv "FOSDEM 2017 - Kube.mp4-FJW06CZJyUY.m4a" kube.m4a
mediainfo kube.m4a

# get the best video stream and check it
youtube-dl -f136
mv "FOSDEM 2017 - Kube.mp4-FJW06CZJyUY.mp4" kube.mp4
mediainfo kube.mp4

Next I used Audacity to…

  • split the stereo audio track into 2 mono tracks
  • delete the (lower) right hand side room-noise track
  • select all and copy the remaining single track
  • create a new stereo track
  • paste into both sides of the stereo track
  • delete the original remaining single track
  • export the new stereo track to kube.wav

I hate using Audacity on a HiDPI screen (so I won’t honor it with screenshots) but it was a short procedure that could be fairly easily done with any audio editor. Next I used ffmpeg to “mux” the two streams back together…

ffmpeg -i kube.mp4 -i kube.wav -c:v copy -c:a aac -strict experimental 2017_Fosdem_Kube.mp4

And the result is below. I’m pretty sure you will agree it’s much easier to listen to than the original on Youtube…

Leave a Reply