The marketing advantage of young people

I was listening Deolinda’s song “Parva que Sou”,  very buzzed nowadays due to the strong lyrics about the lack of opportunities given to the young people, and found myself thinking what a piece of crap….  Why? To start the melody is non-existent, and the so called “strong” lyrics are pathetic.

Is plain pathetic to say young people can’t get good jobs, because they are all already taken, and they can’t start their own business because they have no capital, and the lack of capital trows them to poorly paid jobs, which just creates a perpetual loop. So, this is an unfair world and the poor young guy is always with the lower hand. Right? Wrong.

There are so many advantages to the young people… but in this post i would like to highlight the marketing advantages. One can legitimately ask, if a young entrepreneur has little to no money stock, what is the advantage to the established players with much more cash flow to invest in marketing and advertising? Is pretty simple, they can do it better with much less money. How? Exploring the potential of guerrilla marketing to their own profit. The new technologies, the new communication medias, the new languages. They rule the Internet inside out, the websites, the social networks, the blogs, the forums, the chats, the new mobile medias. They know what is cool, what is uncool. What a great marketing advantage that is.

So, i really don’t know about you, but i sure have my own plans to keep “young” as long as i can, keep up with the upcoming medias and technologies so i can take on the “old” guys who do business the same as they did twenty years ago.

PS – and of course, the song who made me think about this, well… i can’t identify me less with it

FreeBSD USB keyboard stalled in single user mode

Trying to recover a root password in an old FreeBSD box (that has been working flawlessly for many years), after selecting single user boot in Beastie menu the keyboard stop responding…. oh well the USB support in old versions is somewhat buggy… just before i was going into the LiveCD route i found a thread in FreeBSD lists with this info:

1) From Beastie menu, escape to loader prompt.
2) set hint.atkbd.0.flags=”0x1″
3) boot -s

and it did the work. Afterward it was a child’s game to change the root password. All the credits to the freebsd lists.

Linux video and audio encoding and decoding

The last weeks, due to some stars alignment i had to do a lot of work with video files. Convertions of formats/containers, codecs, sound adjustments, the works…. first i tried some GUIs in M$ Windows, spent more time than i wanted in installation, testing, de-installing of messy software, and always the overall final results where nothing short of horrible. Then i remember to try in my Linux box ffmpeg, this is a pure command line utilty (no GUI in the middle, but there are some out there), and everything worked out rather good.

So, for my records, before all these commands get lost in history (man history):

Getting info about a file
ffmpeg -i filename.ext

Extracting video
ffmpeg -i inputfilename.ext -vcodec copy outfilename.ext

Extracting audio
ffmpeg -i inputfilename.ext -acodec copy outfilename.ext

Convert aac audio do mp3 (-ar freq in Hz -ab bitrate in bit/s), ex: convert at 44100Hz, 128Kbits
ffmpeg -i filename.aac -ar 44100 -ab 131072 audio.mp3

Convert aac audio do mp3 with volume adjust, good if sound is too high/low, -vol switch (256=normal), ex: 512 two times louder, 128 half sound
ffmpeg -i filename.aac -ar 44100 -ab 131072 -vol 512 audio.mp3

Convert raw avi to M$ compatible vanilla installation (no codecs) of Windows Media Player (-b switch for bitrate quality), example at 10Mb/s (good quality)
ffmpeg -i filename.avi -vcodec msmpeg4v2 -b 10000000 filename.avi

Convert raw avi to M$ compatible vanilla installation (no codecs) of Windows Media Player with frame rate adjust, example to 24 frames per second
ffmpeg -i filename.avi -vcodec msmpeg4v2 -b 10000000 -r 25 filename.avi

Convert raw avi to M$ wmv at 24 fps with the same quality settings of the original file
ffmpeg -i filename.avi -vcodec wmv1 -sameq -r 25 lfilename.wmv

Convert mp4 to avi, with the same quality settings
ffmpeg -i filename.mp4 -sameq filename.avi

Convert flv to mp4, keeping the same quality. Check if the flv audio and video stream is supported by your device. If it is, no need to re-encode, just change the container to mp4
ffmpeg -i filename.flv -c copy -copyts output.mp4

Some files had some kind of problems, and ffmpeg couldn’t parse them spitting some errors, so i give it a try in mencoder, and the son of a gun worked like a charm.

Extract video from file
mencoder infile.ext -ovc copy -nosound -o outfile.ext

Adjust the sound to lower volume
ffmpeg -i file.flv -acodec copy -vn audio.aac
ffmpeg -i audio.aac -ar 44100 -ab 131072 -vol 128 audio.mp3
ffmpeg -i file.flv -i audio.mp3 -map 0:0 -map 1:0 -vcodec copy -acodec copy file2.flv

This is just a scratch in the surface off ffmpeg and mencoder, and many more formats, options, conversions, codecs are supported, so this post can be updated anytime with new info.

Thank you Open Source for saving the day (yet again)!

Updates:

19/10/2013: i downloaded (sorry, bought on iTunes…) a mkv file with built-in subtitles and Dolby DTS sound. My TV Player didn’t like the audio (not supported) nor the built-in subtitles… time to fix this. Install mkvtoolnix and mkvtoolnix-gui

sudo apt-get install mkvtoolnix
sudo apt-get install mkvtoolnix-gui

Get information about file with mkvinfo

mkvinfo file.mkv

Example output (the relevant part):

| + A track
|  + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
|  + Track UID: 1
|  + Track type: video
|  + Lacing flag: 0
|  + MinCache: 1
|  + Codec ID: V_MPEG4/ISO/AVC
|  + CodecPrivate, length 46 (h.264 profile: High @L4.1)
|  + Default duration: 41.708ms (23.976 frames/fields per second for a video track)
|  + Video track
|   + Pixel width: 1196
|   + Pixel height: 720
|   + Display width: 1196
|   + Display height: 720
| + A track
|  + Track number: 2 (track ID for mkvmerge & mkvextract: 1)
|  + Track UID: 1682142618
|  + Track type: audio
|  + Codec ID: A_DTS
|  + Default duration: 10.667ms (93.750 frames/fields per second for a video track)
|  + Language: jpn
|  + Audio track
|   + Sampling frequency: 48000
|   + Channels: 3
| + A track
|  + Track number: 3 (track ID for mkvmerge & mkvextract: 2)
|  + Track UID: 2244222851
|  + Track type: subtitles
|  + Lacing flag: 0
|  + Codec ID: S_TEXT/UTF8

so, 3 tracks. Track number 1 video in h.264, 2 audio in DTS with 3 channels and track 3 subtitles. So first thing, extract audio and subtitles (note that first track is track 0 and so on for mkvextract):

mkvextract tracks file.mkv 1:audio.dts
mkvextract tracks file.mkv 2:subtitles.srt

And there, all done about the subtitles, tbe .srt outputted works as is, no mores fuss with this. Now, the DTS audio not supported must be converted to another format, AC3 works fine with my TV so i converted DTS to AC3 (i had some errors trying to convert directly so i added an extra step as i converted to DTS to WAV and then to AC3 (the DTS bitrate was a whooping 2304Kbps !!! audio.dts was 1.2Gb…. so i downgraded to a pretty good quality and more sensible 640Kbps).

ffmpeg -i audio.dts audio.wav
ffmpeg -i audio.wav -acodec ac3 -ac 3 -ab 640k audio.ac3

Now, i went in for the muxing with the GUI, just run ‘mmg’ and then in the simple interface simply add the mkv and the audio.ac3, select in the tracks the video and the ac3 audio, unselect all the others tracks, and then “Start muxing”.

30/07/2012: a simple php script to bulk edit mp3 bitrate

<?php

$files = scandir('./');

foreach ($files as $file) {
  if (preg_match('/\.mp3$/', $file)) {
    $output = shell_exec('ffmpeg -i "'.$file.'" -ar 44100 -ab 192k "tmp.mp3"');
    rename("tmp.mp3", $file);
    unlink("tmp.mp3");
  }
}
?>

21/03/2011: since the writing of the post, i have been using more and more VirtualDub, it’s Windows only 🙁 but also Open source. Also a pain in the ass to install all the pug-ins, codecs, filters, etc… but after up and running is that easy to decode/encode in various formats.

Eye protection goggles

I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).
I will always wear my eye protection goggles when doing in hazardous work (even for short time).

So help me God.

European first aid training course

Just finished last week a first aid training course at Portuguese Red Cross. It’s a 12h course with a hands on approach, on subjects like burns, bleedings, choking, victim transportation, getting help, bonds, cpr, and so on. This is a very usefull course, with (in)formation that can make a real difference in some emergency situations in someone’s (can be yourself) life and/or life quality.

The question is: Why in 12 years of mandatory school you actually don’t learn anything about this issue?

You have to learn so many useless stuff – best regards to my History teacher and the Barbarians invasion for example – and this knowledge is kept out of the formal educational system.