Development log

Code, tricks, quick technical ideas, recipes, progress reports, bash, ffmpeg and more…

avconv: replace audio

How to easily replace (faulty/wrong) audio in an video file without re-encoding the whole video? Using “copy” codec for video and -map option to use new audio:

questions and notes (interface fractures research 13/10/07)

At the moment I’m quite inspired by an article in The Wire about Matana Roberts (not a jazz musician, but an experimentalist). Her focus on the past of black slavery and reflection on the present (immigration, LGBT, and more) make me think about my own position and desire to reflect my own past, the past of this country. Slovenians, huh. I’m thinking of slovenian folklore, perhaps a slavic, pagan one on one hand, and about the partisan-communist/belogardist-collaborators issues and conflicts on the other. What kind of people are we Slovenians? Cankar talked about servants, fieldhands, toadies… Cankar is a dark departure point. Slightly halucinogenic. I’m asking myself questions about what are my/our roots which define the most problematic issues in the present? And of course, is there a way to express them, or at least this retrospection and questioning – in a contemporary audio-visual way?

Perhaps I don’t want to be so specific in historic way. Perhaps it would be interesting to think about all those different historic roots, but then move onto a slightly more general feelings, like hate, fascism, xenophobia, … and it seems important to stay honest, to keep a strong connection to what I really stand behind.

I would be looking at:

  • history of slovenia (80s?)
  • histories of art/avant-gardes (Zabel, Šuvaković)
  • theories of fascism, anarchism, critical-culture,
  • philosophy of noise (Voegelin)
  • audio-visual languages (incl. M. Chion), Tscherkassky

I imagine producing textual fragments, visual fragments, 3d structures, sonic fragments – a lot of noise, a lot of bass.

I’m thinking of how different today time is, the precarity, the capitalist exploitation (of workers, of consumers). Is this a new form of fascism? No. Since there is no totalitarian state.(?).

Let’s hold that we are living in informational capitalism. Is it possible to use certain political-artistic strategies from the alternative movements of the 80s in order to reveal the paradoxes of informational capitalism? Jodi Dean.

same old same old: codecs!! (avconv and AAC)

Today I encountered problems with encoding video/audio material due to same old problematic, which so many people seem to not notice but seems that it is oh so important. At least to content creators.

In short, here’s the thing: avconv, the flagship encoder/decoder for most of a/v content (it’s a fork of more famous ffmpeg), now cannot in a simple way encode AAC audio (this is the most common format for h264 mp4 video – or so it seems). In order to have avconv with libfaac encoder (which creates AAC audio) compiling is necessary – without an option to create a deb (if you are on Ubuntu or Debian). That’s quite inconvenient. However, there is an experimental work-around: instead of -acodec libfaac, use ffmpeg/avconv’s own experimental encoder by using -acodec aac -strict experimental.

So here’s the full commandline:

avconv -i INPUTFILE.EXT -s 480x320 -r 25 -b 1000k -bt 1600k -vcodec libx264 -pre:v medium -acodec aac -strict experimental -ac 2 -ar 48000 -ab 128k OUTPUTFILE.mp4

Above was made in order to transcode any video to a format suitable for Waterwheel online platform.

force download in php

People often don’t know how to save a file from a link. You send them a link and it seems just impossible to them to be able to right-click on it and choose “Save link as”. Especially on macs, where the concept of right-click didn’t really exist (and is still unknown to many – it seems). So, how do you help somebody who needs to download a big video file from your server bit it keeps openning in browser in some quicktime player or something. You force the browser to download. Create a PHP file that will send correct headers to browser:

Just take care there are no spaces outside of php tags.

slovenian keyboard layout

While setting up new installation on my laptop (ending up with AVLinux, based on Debian Squeeze and Awesome window manager), there are million little things that don’t work exactly how I want and spend too many hours on fine-tuning it. In fact, one of the things didn’t really manage to setup in the last incarnation of running OS (Ubuntu, Gnome 2) was keyboard layout. So now I managed to do it propertly – the Right Way – by editing some conf files.

So, the basic system to keyboard layouts nowadays is XKB. Layouts that XKB loads are in /usr/share/X11/xkb/symbols. I modified a slovenian layout and added a variant. At the end of /usr/share/X11/xkb/symbols/si I added:

This will give me a layout I can load with setxkbmap si usprog. The basic idea of this layout is that it is a full basic “us” layout with additional ways for three slovenian letters č, š and ž, and “serbo/croat” ć and đ. They are accessible using AltGr (right Alt) key and keys c, s, z, ‘ and d. Simple as that. AltGr + 5 provides an additional Euro currency sign.

The next step would be to create this configuration in a local (under ~/ home) location. A -config option to setxkbmap command should be the way to go, i guess.