PR für Datenwanzen-Ausweis

Da kann man sich doch einmal freuen: Viele Mitbürger haben sich die „eID“-Funktion des nPA gespart.

Sicher kann man sich sinnvolle Dienste und Anwendungen mit einem nPA vorstellen. Der Haken ist nur: wenn das Ding Schwungmasse erhalten hat, ist es bald vorbei mit der Freiwilligkeit. Und dann folgen irgendwann die „Bürger-Netz-Kontrollen“, oder dergleichen. Die aktuellen Vorgänge zur NSA Affäre zeigen doch: es wird gemacht, was gemacht werden kann. Besser also, wenn es nicht gemacht werden kann.

Eine Kommunikationskampagne sollte die Einführung des neuen Personalausweises unterstützen. 80 Prozent der prognostizierten 12 Millionen Nutzer im ersten Jahr sollten nach diesen Vorstellungen die eID-Funktion aktivieren und nutzen. Aktuell will noch nicht einmal ein Drittel der Bürger diese Funktion. Das Leistungsversprechen „Authentisierung jederzeit, online und offline“ und das Qualitätsversprechen „Freiheit, Offenheit und Selbstbestimmung“ sind offenbar nicht beim Rezipienten angekommen.

Quelle: heise online

Raspberry Pi Encoding script

I finally had the time to work on my hardware assisted h264 encoding appliance. Followers of my blog (are there any) know that I got a Leopard Board DM368 (LI-TB-02) to use for my encoding project, but due to limitations of the hardware (the encoder only encodes material that is divisable by 32pixels width) I could not recode my recorded tv shows – german public tv stations air their shows in 720×576 PAL-DVD dimensions.

I also own a raspberry pi ARM computer which has a hardware assisted encoding capability. Using „raspbian“ (an arm „hardfloat“ linux distribution based on debian), mediainfo (to extract the number of streams within a recording) and a lua script, I start a GStreamer to recode the transport stream and encapsulate the resulting h264 (video) and aac (audio) materialn in a matroska container.

I’ve chosen matroska because the format seems to deal well with input (transport stream) implications. The audio stream of a mpeg transport stream is not always (or, to be more precise, almost always) not in time synchronization with the video stream (to make matters worse, the timing between the audio and video stream can shift with time). MPEG-4 containers require (as far as I understand) the streams to be in sync, which is problematic with most stream-based recoding.

Playback of the resulting mkv seems to be shaky on my laptop with vlc – playback with Raspbmc (a raspberry pi based XBMC distribution) is perfectly fine.

Helper function for luaxpath:
/mnt/media/src/recode/split.lua:

function split(str, pat)
  local t = {} -- NOTE: use {n = 0} in Lua-5.0
  local fpat = "(.-)" .. pat
  local last_end = 1
  local s, e, cap = str:find(fpat, 1)
  while s do
    if s ~= 1 or cap ~= "" then
      table.insert(t,cap)
    end
    last_end = e+1
    s, e, cap = str:find(fpat, last_end)
  end
  if last_end <= #str then
    cap = str:sub(last_end)
    table.insert(t, cap)
  end
  return t
end

Extracting the transport stream information:
/mnt/media/src/recode/mediainfo.lua:

package.path = '/mnt/media/src/recode/?.lua;' .. package.path

require "xpath" 
require "lxp.lom"
require "split"

function mediainfo(filename) 
  local ret = {}
  local path = string.match(filename, "(.-)([^\\/]-%.?([^%.\\/]*))$")
  os.execute("mediainfo --Output=XML " .. filename .. " > " .. filename .. ".info.xml")
  local xmlfile = assert(io.open(filename .. ".info.xml"), "XML Info file could not be openend")
  local xmlblob = xmlfile:read("*all")
  xmlblob = string.gsub(xmlblob, "\n", "")
  local xmltab  = lxp.lom.parse(xmlblob)
  ret["fileformat"] = xpath.selectNodes(xmltab, "//Format")[1][1]
  ret["audio"]      = xpath.selectNodes(xmltab, '/Mediainfo/File/track[@type="Audio"]')
  os.remove(filename .. ".info.xml")
  return ret, xmltab
end

The script calling gstreamer:
/mnt/media/src/recode/gstrecode.lua:

#!/usr/bin/env lua

package.path = '/mnt/media/src/recode/?.lua;' .. package.path

require "mediainfo"

local sourcefile = string.gsub(arg[1], "^\./", "")
local destfile   = string.gsub(arg[2], "^\./", "")

print("Source:      " .. sourcefile)
print("Destination: " .. destfile)

local lockPrevious = io.open(sourcefile .. ".lck", "r")
if lockPrevious ~= nil then
  print("Already transcoding or stale lockfile found")
  os.exit()
end

local lock = io.open(sourcefile .. ".lck", "w")
lock:write("LOCKED")
lock:flush()
lock:close()

local info = mediainfo(sourcefile)

local command = ""

command = command .. "gst-launch-1.0 filesrc location=" .. sourcefile .. " ! progressreport ! "
if info["fileformat"] == "MPEG-TS" then
  command = command .. "tsparse ! "
end
command = command .. " decodebin name=demux "
for i = 1, table.getn(info["audio"]) do
  command = command .. "demux. ! queue ! audioconvert ! voaacenc bitrate=128000 ! queue ! mux. "
end
command = command .. 'demux. ! queue ! '
if os.getenv("HOME") == "/home/pi" then
  command = command .. 'omxh264enc control-rate=1 target-bitrate=1250000 ! '
else
  command = command .. 'x264enc bitrate=1250 ! '
end

command = command .. '"video/x-h264,profile=high" ! queue ! h264parse ! mux. '
command = command .. "matroskamux name=mux ! filesink location=" .. destfile

print("Command:     " .. command)
local retcode = os.execute(command)

if retcode == 0 then
  os.remove(sourcefile .. ".lck")
else
  os.remove(destfile)
  local failed = io.open(sourcefile .. ".failedencode", "w")
  failed:write("EPIC FAIL")
  failed:close()
end

Call: /mnt/media/src/recode/gstrecode.lua source.ts destination.mkv

I use the same script for encoding on my x86 machines and the pi – that’s why I check for the home directory of the calling user. If you want to use the script, you might want to change the paths and this check. The script requires luaexpat to be installed.

A problem still occurs, if the aspect-ratio within the transport stream suddenly changes (i.e., a 16:9 show preceded by a 4:3 show) – the encoding process just stalls.

Bye bye Wikimedia

Ziel von uns Gründungsmitgliedern der Wikimedia Deutschland war die Förderung freien Wissens, mit besonderem Focus auf die Enzyklopädie Wikipedia. Unser Ziel war es keinesfalls, Pseudowissenschaften wie die sogenannten Gender-Studies mit fünfstelligen Beträgen zu finanzieren, um Vorschläge zu erarbeiten wie innerhalb der Wikipedia-Community Probleme gelöst werden sollten, die keine sind.

Ulrich Fuchs zu seinem Austritt aus der Wikimedia e.V.
Wenn das nächste Mal Jimmy Wales auf Wikipedia zu Spenden aufruft, sollte man das im Hinterkopf behalten. Förderung der Wikipedia – o.k.. Aber den „Gender-kram“ möchte ich zumindest nicht fördern.

Exportiere, exportiere…

Heiner Flassbeck zu dem Umfeld der Koalitionsverhandlungen:

Dieses Bild müsste in den Koalitionsverhandlungen hin- und hergewendet werden, bis die Politiker verstanden haben, dass es einem Land nicht gut geht, das erst seine Löhne im Vergleich zu seinen Handelspartnern senkt, um diese nieder zu konkurrieren, und dann den gleichen Handelspartnern alle seine Ersparnisse anvertraut, weil die sonst seine Güter gar nicht kaufen können. Wenn das gleiche Land dann auch noch darüber klagt, dass es seine Nachbarn unterstützen muss, weil die nicht mehr automatisch Kredite am Kapitalmarkt zu günstigen Zinsen bekommen, steht die Welt Kopf. Mit einer Kopf stehenden Welt kann man aber kein einziges Problem lösen.

Nachdenkseiten

Besserwissersoftware

Wenn es in letzter Zeit eines gibt, dass wirklich an meinem Gesundheitszustand durch unangemessene Erhöhung der Stresshormone knabbert, dann ist das Besserwissersoftware.

Das dumme daran ist, dass der Trend stark zu Besserwissersoftware geht. Was ist denn Besserwissersoftware? Nun ja, Programme oder Betriebssystemfunktionen, die besser wissen, was ich wollen will als ich. Windows Vista, Windows 8, iTunes, Oracle VirtualBox, Microsoft Office 2007, 2010 und 2013 sind alles Beispiele für Besserwissersoftware, mal mehr, mal weniger. Um es noch weiter zu verdeutlichen, spreche ich mal ein paar Funktionen dieser Software an.

Windows Vista zum Beispiel priorisiert Programme, die Medien abspielen höher, was vor dem ersten (oder zweiten?) Service Pack dazu führte, dass das Programm keine Daten mehr bekam, weil das Abspielen höher priorisiert war als das Lesen neuer Daten (z.B. aus dem Netz). Interessanterweise hatte ich nie ein Problem damit, dass meine Medienprogramme zu niedrig priorisiert waren – Vista wußte es trotzdem besser.

VirtualBox hat eine eigene Buchhaltung, welches Diskimage an welchem Ort liegt – eine vbox-Datei kann zwar angeben, wo sie meint, dass die Dateien liegen sollen, aber falls VirtualBox diese Datei schon woanders liegen hat, dann wird diese bevorzugt genommen (bzw. man kann die andere nicht hinzufügen). Ich kopiere öfter virtuelle Maschinen zwischen Rechnern hin- und her. Dieses Verhalten kommt mir dabei öfters in die Quere, so dass ich letztendlich jedes Mal die VirtualBox-Konfiguration lösche und neu erstelle. Besserwissersoftware!

GNOME 3.x hat für vieles keine Einstellungsmöglichkeiten mehr, weil User Interface Designer sagen: zuviele Einstellungen machen Stress. Doll, keine Einstellungen machen mehr Stress! So wacht z.B. mein Netbook nicht aus dem Standby auf – ich muss Standby also abstellen. Dafür muss man sich ein „Tweak-Tool“ (sprich: „Supergeheimtippprogramm“) installieren. Am Ende versucht man, so viele Optionen und Funktionen aus dem Sichtbereich wegzuoptimieren, dass man für so simple Sachen wie „ein Programm öffnen“ (falls man die Maus benutzt) a) in die ober linke Ecke fahren, b) in eine Schaltfläche unten rechts klicken, c) auf der rechten Seite scrollen, d) dann in einer Textliste klicken, e) durch einer Liste in der Mitte scrollen und f) final klicken muss. Viel einfacher als (in der Vergangenheit) a) oben links klicken, b) Listeneintrag klicken und c) Programm anklicken.

Evolution (der Mailclient von GNOME) hat auch noch kaum Einstellungen. Ich wollte gerade mal den Timeout einstellen, nach dem eine Mail als gelesen gilt; ich will nicht jede Mail, die ich aus Versehen anklicke oder durch die ich durchklicke als Gelesen markieren. Es gibt natürlich keine Option für. Stattdessen kann ich mich durch sowas wie eine Windows-Registry klicken und wenn ich Glück habe, finde ich eine entsprechende Einstellung.

Damit ist hoffentlich klar geworden, was ich mit Besserwissersoftware meine: man kann versuchen, was man will, die Software schließt entweder Anwenderwünsche von vorne herein aus oder überschreibt sie mit eigenen, aus ihrer Sicht besser passenden Werten. Und das finde ich offen gesprochen zum Kotzen!

gstreamer pipelines for transcoding VDR recordings

To recode my recordings on the raspberry pi I invoke:
gst-launch-1.0 filesrc location=00001.ts ! decodebin name=demux demux. ! queue ! audioconvert ! voaacenc bitrate=192000 ! mux. matroskamux name=mux ! filesink location=00001.mkv demux. ! queue ! progressreport ! videoconvert ! deinterlace ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.

Unfortunately, doing demuxing/ remuxing at the same time on the DM368 Leopard Board doesn’t work yet, so here are the two pipelines I use:
gst-launch-0.10 filesrc location=00001.ts ! mpegtsdemux name=demux demux. ! progressreport ! mpegvideoparse ! TIViddec2 codecName=mpeg2dec engineName=codecServer framerate=25/1 ! deinterlace mode=1 method=1 ! TIVidenc1 framerate=25/1 codecName=h264enc engineName=codecServer ! "video/x-h264,profile=high,pixel-aspect-ratio=(fraction)16/11" ! h264parse ! filesink location=00001.264

gst-launch-0.10 filesrc location=00001.ts ! mpegtsdemux name=demux demux. ! mad ! audioconvert ! TIAudenc1 codecName=aaclcenc engineName=codecServer ! filesink location=00001.aac

Debian on my DM368

After a long summer, I decided to work on my „transcoding“ project again. Last time I did that, I had created a working linux system, that was somewhat messy and not easily recreated. I updated to debian by using the debian armel snapshot: first I created a bootable SD card using the Texas Instruments DVSDK, then I replaced the root partition by debian armel. I had to create the /dev/console device node – and install the right kernel and modules from dvsdk (I changed the kernel to have CIFS and swap support too in that process).

Debian Logo

I still cannot transcode video files that have a width that’s not dividable by 32. I need to write a custom DMAI application – or I just use my raspberry pi to encode h264 using OpenMAX.