The Road to Elysium

March 17, 2010

Embedding subtitles srt into avi files with mencoder

Filed under: Snippets — jorge @ 09:59

Easier than you might think:

$ mencoder -sub movie_subtitle.srt -ovc xvid -xvidencopts bitrate=-700000 -oac copy -o new.movie.name.avi movie.avi

November 26, 2009

Removing your Master Boot Record (MBR)

Filed under: Snippets — jorge @ 09:42

Removing MBR (including the partition table):

# dd if=/dev/null of=/dev/sdX bs=512 count=1

Removing MBR (excluding the partition table):

# dd if=/dev/null of=/dev/sdX bs=446 count=1

sdX is the device you want to remove the MBR of (like a USB-stick).

August 31, 2009

Generate a htpasswd password without installing Apache

Filed under: Snippets — jorge @ 16:23

A oneliner with Perl does the trick:

$ perl -le 'print crypt("password", "salt")'

Your htpasswd-file should then look like so:

UserName:EncryptedPassword:YourComment

August 13, 2009

How to join multiple .avi or .mpg files – part two

Filed under: Snippets — jorge @ 09:41

25th of May 2008 I wrote a post about how you could join multiple files that looked something like movie.avi.001, movie.avi.002 and so on. I found a new tool that does the job a bit easier, lxsplit. The syntax of lxsplit is like so:

[jorge@ashitaka ~]$ lxsplit 
LXSplit v0.2.4 by Richard Stellingwerff, O. Sezer.
Home page: http://lxsplit.sourceforge.net/
 
Usage: lxsplit [OPTION] [FILE] [SPLITSIZE]
 
Available options:
 -j : join the files beginning with the given name
 -s : split the given file.  requires a valid size
Splitsize examples: 15M, 100m, 5000k, 30000000b
 
Examples:
	lxsplit -s hugefile.bin 15M
	lxsplit -j hugefile.bin.001

So to join all our files, we execute:

$ lxsplit -j movie.avi.001

And it will join all files named movie.avi.00{1,2,3} and so on. :)

July 24, 2009

Converting an avi to the Nokia E71 size

Filed under: Snippets — jorge @ 08:09

This is a oneliner to convert an avi-file to the correct dimensions of a Nokia E71. The screen is small, but sure beats to buy an iTouch if your cell already can play movies for you. :)

$ ffmpeg -y -i input.avi -acodec libfaac -ab 72k -s 320x176 -aspect 16:9 -vcodec libx264 -b 300k -qcomp 0.6 -r 25 -qmin 16 -qmax 51 -qdiff 4 -flags +loop -cmp +chroma -subq 7 -refs 6 -g 250 -keyint_min 25 -rc_eq 'blurCplx^(1-qComp)' -sc_threshold 40 -me_range 12 -i_qfactor 0.71 -directpred 3 output.mp4
Older Posts »

Powered by WordPress