Creating a MPEG2 file with mencoder

Note to self: This is a reminder and follow up on the previous post of how I managed to reencode an AVC1/AC3 video in a Matroska container to a DVD-ready MPEG2 file with the original AC3 sound in a MPEG container (VOB), just like DVD authoring tools like their files (no sign of players supporting h.264 where I live yet, else…).

mencoder the_darned_movie.mkv -sub subtitles_spa.srt -utf8 -subfont-text-scale 3.3 -subpos 96 -oac copy -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=5000:mbd=2:trell=yes:gmc=yes:aspect=1.83/1:vpass=1 -of mpeg -mpegopts format=dvd:muxrate=24000:tsaf=yes:interleaving2=yes:vframerate=25 -noskip -o /dev/null

and then the actual encoding (make sure to copy the log file from the first pass somewhere safe just in case):

mencoder the_darned_movie.mkv -sub subtitles_spa.srt -utf8 -subfont-text-scale 3.3 -subpos 96 -oac copy -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=5000:mbd=2:trell=yes:gmc=yes:aspect=1.83/1:vpass=2 -of mpeg -mpegopts format=dvd:muxrate=24000:tsaf=yes:interleaving2=yes:vframerate=25 -noskip -o the_darned_movie.mpg

I made a couple of fix ups, such as converting the srt file to UTF-8, with gaupol. As well, lavf output doesn’t support VOB output as it was my first idea and to make things worse, it is broken as per program output (MPlayer SVN-r31918 a.k.a MPlayer 1.0.rc4). But, the MPEG muxer supports VOB, yay!

Advertisements

Creating a MPEG4 with subtitles using mencoder

Note to self: This is a reminder of how I managed to reencode an AVC1/AC3 video in a Matroska container to a low-profile MPEG-4 (aka “XViD” or “DivX”) video with the original AC3 sound in an AVI container, just like modern video players like their files (no sign of players supporting h.264 where I live yet).

mencoder the_darned_movie.mkv -sub subtitles.srt -utf8 -subfont-text-scale 3.3 -subpos 96 -aspect 2 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell=yes:v4mv=yes:aspect=16/9:vbitrate=1200:vpass=1 -o /dev/null

and then the actual encoding (make sure to copy the log file from the first pass somewhere safe just in case):

mencoder the_darned_movie.mkv -sub subtitles.srt -utf8 -subfont-text-scale 3.3 -subpos 96 -aspect 2 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell=yes:v4mv=yes:vbitrate=1200:aspect=16/9:vpass=2 -o the_darned_movie.avi

I made a couple of fix ups, such as converting the srt file to UTF-8, with gaupol.

Hacking Debian’s Desktop Default

Changing the desktop default after installing Debian without giving it a second thought is a pain if one is not very familiar with debconf (a.k.a., the spawn from hell, second only to Solaris’ SMF oh, how I loath thee —until I get close to some iron with AIX inside anyways.) You love The Debian Way(tm), and you strive to always use it despite all odds. And what odds! There is no easy and obvious way to change the default desktop in a Debian system[1], just the following:

echo "tasksel tasksel/desktop string xfce" | debconf-set-selections

[1] Yes, I’m bitching too much, but how do you expect a luser to do this without suffering a heart attack? Wait I use Debian, not Ubuntu. Thank you $DEITY!

Installing and dual-booting Debian GNU/kFreeBSD

Now that Debian GNU/kFreeBSD is an official part of Debian, it is time to play around with the new toy. But in order to do such feat there are several issues that have to be resolved on the path to success. Assuming you use Debian GNU/Linux with GRUB2 (as seen in testing and unstable these days) and have a spare partition or two you can try it out on live hardware instead of an emulator.

Installing Debian GNU/kFreeBSD

  1. Use the Debian-Installer (D-I) monolithic images available at http://d-i.debian.org/daily-images/, and make a network install.
  2. The installer image uses GRUB2 instead of syslinux (for obvious reasons), thus you cannot set debconf priority before booting into D-I.
  3. Because Debian GNU/kFreeBSD is broken in testing as of this writing, you’ll need necessarily to set debconf priority to medium in D-I in order to install unstable a.k.a. Sid.
  4. Setting debconf priority is easy. The first installer prompt will ask for the language you want to use for installation. Don’t select a language, instead tab to the “Go Back” button, exit to D-I’s main menu, set debconf priority to medium and start again from the top.
  5. When selecting a mirror, select unstable as the distribution to install.
  6. When partitioning, you may create or use an already existing primary or logical partition, but the FreeBSD kernel will be happier if you use a primary partition.
  7. Do not, I repeat, do not install software. Skip this step. Aptitude is foobar today and perhaps for sometime yet. Read the report to learn how a bug report is written. Use apt-get by hand instead.
  8. Finish the install without installing GRUB2, The package in Sid is somewhat broken (or bug fixed, whichever you choose to believe) and refuses to install on UFS filesystems and will insist on installing on the MBR. Skip it. We will be using the GUB2 installed in the MBR by our Debian GNU/Linux install.

Dual booting Debian GNU/kFreeBSD

This is where all the advice on creating a boot entry for GRUB2 out there in the intarwebs is wrong. Why? Because kFreeBSD has been repackaged to match the packaging of Linux. So in order to boot Debian GNU/kFreeBSD from our main GRUB2 install, we need to add the following to /etc/grub.d/40_custom:

menuentry "Debian GNU/kFreeBSD" {
    insmod ufs2
    set root=(hd0,3)
    kfreebsd /boot/kfreebsd-8-0-1-686.gz
    #kfreebsd_module_elf /lib/modules/8.0-1-686/acpi.ko #not necessary, statically linked
    set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s3
    set kFreeBSD.vfs.root.mountfrom.options=rw

}

And run update-grub. Obviously that’s the set up in my box and it won’t work as is in yours. If you can’t find that information on your own, oh well.