WEBlog -- Wouter's Eclectic Blog

Tue, 05 Feb 2013

Transcoding videos

Since some people asked for it, and since it's (unfortunately) fairly nontrivial, here is the script that I'm using currently to transcode a .dv file into webm:

#!/bin/bash

set -e

newfile=$(basename $1 .dv).webm
wavfile=$(basename $1 .dv).wav
normalfile=$(basename $1 .dv)-normal.wav
normalfile=$(readlink -f $normalfile)
oldfile=$(readlink -f $1)

echo "Audio split"
gst-launch-0.10 uridecodebin uri=file://$oldfile ! progressreport ! audioconvert ! audiorate ! wavenc ! filesink location=$wavfile
echo "Audio normalize"
sox --norm $wavfile $normalfile
echo "Pass 1"
gst-launch-0.10 webmmux name=mux ! fakesink \
  uridecodebin uri=file://$oldfile name=demux \
  demux. ! ffmpegcolorspace ! deinterlace ! vp8enc multipass-cache-file=/tmp/vp8-multipass multipass-mode=1 threads=2 ! queue ! mux.video_0 \
  demux. ! progressreport ! audioconvert ! audiorate ! vorbisenc ! queue ! mux.audio_0
echo "Pass 2"
gst-launch-0.10 webmmux name=mux ! filesink location=$newfile \
  uridecodebin uri=file://$oldfile name=video \
  uridecodebin uri=file://$normalfile name=audio \
  video. ! ffmpegcolorspace ! deinterlace ! vp8enc multipass-cache-file=/tmp/vp8-multipass multipass-mode=2 threads=2 ! queue ! mux.video_0 \
  audio. ! progressreport ! audioconvert ! audiorate ! vorbisenc ! queue ! mux.audio_0

rm $wavfile $normalfile

It's fairly non-optimal, because many of these command-line A/V tools are either fairly badly documented, or have a horrific interface, or something similar.

avconv is supposed to be able to do audio normalisation, but I haven't been able to figure out exactly how it's done. The options that are specified in the manpage seemingly have no effect.

gstreamer has a 'ReplayGain' plugin which can do audio normalisation. Audio normalisation requires two passes; I could in theory just add the element in the gstreamer first-pass pipeline, add a '-t' to the gst-launch-0.10 invocation, and parse out the required gain value that I can then add to the second-pass pipeline. However, the elements that I can then pass that gain value to either have a different range for the gain (rgvolume's fallback-gain parameter) or expect a completely different unit of values with no obvious way to translate between the two (the 'volume' element's 'volume' parameter expects a multiplier, the replaygain plugin produces a dB value; a simple conversion seems wrong as it produces a value way out of range). The 'volume' element reportedly has an interface that takes a dB value, except you can't reach it from gst-launch-0.10. Bummer.

So instead we split out the audio, do normalisation in sox, and mux that back in during the second pass of the video transcoding. Sox is good. Sox is easy. If all A/V command-line tools were like sox, I would be smiling now.

What's missing from the above script is how to throw away the start or end of a file in case there's several minutes of uninterestingness there. This is easiest (in my experience) with avconv's -t and -ss options. I suspect gstreamer is capable of doing that, too; but I haven't figured out how, and this works.

You may want to play with some of options of the vp8enc element. For instance, the threads= value can be increased (or decreased) depending on how many cores your transcoding machine has. You could probably also add a "target-bitrate" value if you find the quality is too low or the system uses too much diskspace. VP8 has several more options; the documentation lists them all.

If you've done video recordings for a devroom at FOSDEM outside of the FOSDEM video team, note that FOSDEM is more than willing to host the videos. To do so, the easiest way is if the videos are online somewhere (this does not have to be a public system) that we can wget or scp them from; if you've done that, contact me with the location to the files and we'll put them on the FOSDEM video server.

Wed, 28 Jan 2009

FOSDEM and Novell

Sigh.

I'm not part of the FOSDEM organisation team, and this is by choice. I know that I wouldn't find the time to help organize a conference of the scale of FOSDEM, since I'm rather liable to forget to do important things at times.

Having said that, I happen to run a company together with Philip Paeps, who is now one of the main FOSDEM organizers; apart from that, I've also managed the Debian presence there for the past few years (lost count how many exactly), and arranged the key signing party for a few years—with Joost Van Baal taking over for me starting this year. As such, I'd like to believe that although I'm not exactly in to all their secrets, I do have a front-row seat when it comes to how things are going there.

FOSDEM is the "Free and Open Source Developers' European Meeting". It has been that since 2001, and will always remain so. Yes, originally it was called "OSDEM", because frankly, the organisation of the original OSDEM was done by a group of people who like Open Source, without necessarily subscribing to the Free Software ideals. The core group of the organisation is a rather diverse group; for instance, Philip has been known to be rather... negative... about Ubuntu, while Mark (one of the press contacts) has done some activism and translation work for Ubuntu.

The change of name from OSDEM to FOSDEM was done not because the organisation's ideas about software were changed overnight by a mail from Richard Stallman or anyone else from the FSF; but rather, because they were open-minded enough to understand that having a name which only says 'Open Source' would be excluding a considerable part of the community that encompasses both Free and Open Source people. This is why the name wasn't changed in FSDEM; it is FOSDEM.

I'm quite sure that the fact that FOSDEM is so open-minded about many of the controversial issues that have separated our community over the years—not just Open Source vs Free Software, but so many other things as well—is one of the main reasons why FOSDEM is so popular today: because everyone, and I truly mean everyone, will find something that he or she likes.

That is why I'm so saddened that some people seem to find it necessary to not only whine, but also boycott a conference, because they believe that FOSDEM should not take money from a big Free Software/Open Source contributor, just because they also happen to be a company, and as such make business deals with Microsoft. Note that I'm not either defending or condemning Novell's attitude here; but it is a fact that not everyone in the larger Free and Open Source community feels the same way about the whole Novell/Microsoft deal (else there wouldn't be an openSUSE anymore), and as such they still deserve a place on FOSDEM.

Over the history of the organisation of FOSDEM, it's always been a place where everyone could get their opinion out; whether it be the opinion that "Free Software Must Rule The World", or that "It's All About The Way You Do Things"; as long as your opinion is shared by a large enough number of people in the larger FLOSS community, it is welcome.

I feel that blocking one organization from sponsoring the event, just because they have made some deals which a significant group of people, one which nevertheless does not encompass the whole of the FLOSS community, disapprove of, would set a dangerous precendent that might jeopardize the very core of what makes FOSDEM so great: its impartiality.

Thank god that didn't happen.

Thu, 28 Feb 2008

Beid screencast

My FOSDEM talk didn't go entirely as planned. I tried to run a demo of the beid packages, but unfortunately they decided to play up again. This isn't the first time; they sometimes have this. It has something to do with OpenSC or OpenCT, I believe, but it's hard to figure out what, exactly. When I got back at the office with the machine that failed to work properly, and tried again, it did work. Heisenbugs suck. Pun intended.

Anyway, since things work now, I prepared a screencast showing off what I wanted to show during the talk; it takes about 8 minutes. I was going to edit the talk to hide the spammer who was DoS'ing my mailserver just as I was trying to send an email out, and perhaps to hide away the long waits at times; but I didn't find an easy way to do so, and I got tired looking. If you're interested, have a look.

Also, the screencast doesn't include any sound. This is because I couldn't find any piece of equipment on which istanbul would produce correct imagery (it appears to be buggy on powerpc), where the hardware was fast enough to capture and encode both a video at 1024x768 resolution and sound from the sound card (ruling out "anything", the machine on which I tried to do the presentation at FOSDEM), and on which the microphone would actually work (ruling out the amd64 box that was standing nearby). Since I could at least create a correct movie on the last machine, I just forgot about the sound. Instead, I tried to make the screencast show what was going on, by pointing at important tidbits with my mouse pointer.

Which kindof worked, but was not ideal. Oh well.

Sun, 24 Feb 2008

Talk done

I held a talk this morning about the Belgian electronic ID card in Debian (and derivates, like Ubuntu). Things were a bit tight there for a moment, because I overslept; but eventually, we did make it in time.

The talk didn't go perfect. Because I overslept, I didn't have enough time to test; because I didn't test enough, I found out that the smartcard didn't work on the demo machine. Darn; it's pretty silly to hold a talk about how easy it is to use the electronic ID card on Debian, only to find out that I, myself, am unable to use it. Grmbl.

Anyway, the talk worked out okay. Despite the early hour, a decent amount of people showed up—including Fabian Arrotin, who held a talk about a similar topic in the CentOS room last year.

Now for breakfast. Really.

Wed, 20 Feb 2008

FOSDEM keysigning party: list created

This morning, right before leaving for work and somewhat in a hurry, I created the list of keys for the FOSDEM '08 GPG key signing party. You'll find it at the keysigning website.

Unfortunately, I fucked up a bit in that I forgot to check my mailbox. Apparently the key server was down for most of tuesday, and I didn't notice. Some people tried to send their keys, but couldn't. Also, the mail wasn't double-checked carefully enough.

Grmbl. Next time, I'll try not to forget to do such things when I actually planned them—in the evening.

Anyway; if your key has been received in time by the keyserver, you should have received an email this morning, and you should be in the list that I linked to, above. If you weren't then all is not lost; if you really want to participate, print out key fingerprint slips, and bring them to the party. This is not as efficient, and some people may choose not to accept such fingerprint slips, but at least you'll be able to get some signatures. If you didn't make it because the key server was down last night, I apologise (but then again, waiting for the last moment to participate isn't very smart...).

Please also note that we only have two hours, and the list contains 202 people. As such, it may be the case that we won't be able to finish the entire key signing party; it may be the case that we'll have to cut it short. In any case, you will be able to sign a significant amount of keys, and a significant amount of people will be able to sign yours, so that should be good enough -- and you can do the rest next year, or so...

Mon, 04 Feb 2008

FOSDEM schedule

There had to be a few minor updates to the schedule after the mail I sent last week, so that's now been done. We're "only" three days after the deadline...

I hate it when people miss my request to tell them when they can and cannot talk. Next year, I think I'll shout three times or so.

Anyway, if you want to see the final schedule, please read my most recent mail to -events-eu. Yes, I still need to followup on my last week's mail, too, but hey—I'm busy for now. Soon, I promise.

Mon, 28 Jan 2008

FOSDEM schedule for the Debian Devroom

I spent a good few hours today on creating a preliminary schedule for the Debian Developer's room at FOSDEM 2008. Just as I had finished it and sent it to the speakers to get their feedback before declaring it final, I received a reminder from the FOSDEM organizers that the schedule is due by the end of this week. My timing is impeccable :-)

Having said that, the schedule is full. If you wanted to do a talk at FOSDEM, you're probably too late by now. Try again next year.

Time to start focusing on the booth now, I guess...

Tue, 27 Nov 2007

FOSDEM Keysigning

I just finished setting up stuff for the FOSDEM 2008 GPG/PGP key signing party. If you have a GPG or PGP key that you want to get signed, go read the instructions.

Mon, 19 Feb 2007

FOSDEM booth: more volunteers needed

Yesterday, I sent out an email to the debian-events-eu mailinglist, to ask for more volunteers for the FOSDEM booth next weekend. The situation is a little less desperate now than it was yesterday, but I would still need about 5 extra people who would want to put in one our at the booth.

Manning the booth at FOSDEM is not hard; you need to know a bit about Debian to be able to answer questions (which means that you don't even have to be a Debian Developer), and be sure to be at the booth for your designated hour. I fully expect you not to be there all alone, but you will have final responsibility for the stuff that's at the booth during your hour, and you are not to leave it, just in case everyone else does at some point, because of a rather interesting talk, or the keysigning, or some such.

If there are interesting things which you definately don't want to miss, then just let me know the hours that would work for you; I'll consider them then when I put you on the schedule.

Tue, 16 Jan 2007

FOSDEM key signing party

I was appointed by the FOSDEM orga team to be the "volunteer" to organize the FOSDEM key signing party again this year, because "I did it so well last time". Hah.

In other news, I still have keys to sign from the DebConf5 and FOSDEM 2006 key signing parties. As a result, I had resolved not to participate in any key signings anymore until I caught up my backlog. Yes, I know about caff, and yes, I'm using it, but I still have a lot to do.

So now I'm in the strange position of having to organize a key signing party that I'm not going to attend (at least not until the end).

Or perhaps I might do so after all... otherwise it's going to be very boring. I'll see.

For those who care, the announcement has been out since yesterday (Sunday) and can be read on the FOSDEM website, complete with instructions. In the day and a half that this was true at the time of this writing, 15 people already submitted keys. That's quick.