StokeBloke.com

Archive for the ‘Linux’ Category

AVI to FLV with ffmpeg

Monday, June 9th, 2008

I used to have all my videos on my website as divx or xvid encoded AVI. This is a pain as you have to download the files to play them.

I found FlowPlayer and it works really well. I used to use flvtool to encode videos as flv files but it is not part of gentoo and I had to keep manually downloading and building it all the time to get the updates.

I recently found this article which shows how to use ffmpeg to encode videos as flv files.

ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x256 video.flv

I then use the flv with FlowPlayer like this

<object type="application/x-shockwave-flash"
    data="/include/FlowPlayer.swf"
    width="320"
    height="284"
    id="FlowPlayer1">
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="movie" value="/include/FlowPlayer.swf" />
  <param name="quality" value="high" />
  <param name="scale" value="noScale" />
  <param name="wmode" value="transparent" />
  <param name="allowNetworking" value="all" />

  <param name="flashvars" value="config={
		autoPlay: false,
		loop: false,
		initialScale: 'scale',
		showLoopButton: false,
		showPlayListButtons: false,
		playList: [
			{ url: '/media/tux_07.flv' }
		]
		}" />
</object>

See Hintertux 2007 for an example.

Hintertux Video Processing

Saturday, June 7th, 2008

Well, this is crazy. We are back from Hintertux and now its time to start processing the video. My new Helmet cam means that I have loads of footage. 57Gb of raw dv files.

I have started watching the clips and chopping them up into little clips in Cinelerra. Its really a very good application. In my opinion its better than most. The motion tracking and stabilisation is really good.

download hard boiled online download bug s life a movie I did have one problem and it didn’t really like using the XVID AVI files which my helmet camera made so I converted all the files to raw DV files. I used ffmpeg to do this.

fairytale a true story dvdffmpeg -i video.avi -target pal-dv video.dv

I’ve been processing for days already and I still haven’t processed half of the footage.

Cannot install firefox plugins

Friday, May 2nd, 2008

Well I thought I was going crazy.

Today I installed foxmarks on my Windows OS, hours later I tried to install it under linux and it kept failing.

I was really losing my patients. I could not figure out why it wasnt working. I disabled all other plugins, closed all other tabs, everything I could think of.

revolutionary road onlineFinally after searching for too long I found this post on the ubuntuforums.

It shows lots of other people were having the same problem.

The solution is to add

64.50.236.214   releases.mozilla.org

to you /etc/hosts file.

It appears that mozilla are having some issues with either the DNS entry or the servers behind releases.mozilla.org

I just know that this change will cause problems in the future though.

bootchart on gentoo

Wednesday, April 23rd, 2008

Well after reading an article on OpenRC at Roys webs, I decided to take a look at my current system. I started by emerging bootchart.

Firstly I needed to unmask bootchart

echo "app-benchmarks/bootchart" >> /etc/portage/package.keywords

I then enabled the java use flag so I get the java code to generate png files

echo "app-benchmarks/bootchart java" >> /etc/portage/package.use

then I emerged it

emerge -av bootchart

I had to add init=/sbin/bootchartd to the end of the /etc/grub/grub.conf kernel line like this

kernel /boot/kernel-2.6.23-tuxonice-r11 root=/dev/sda3 init=/sbin/bootchartd

Then I editted the /etc/conf.d/rc and changed

RC_USE_BOOTCHART="no"

to

RC_USE_BOOTCHART="yes"

I enabled the auto chart creation by editing /etc/bootchartd.conf and changing

AUTO_RENDER="no"

to

AUTO_RENDER="yes"

This is what I got the first time.

Virtually all of my boot time is spent checking the internal tree of the 2 300Gb disks. One disk took around 17 seconds to check and the second one too around 15 seconds (its slightly smaller). Both are reiserfs. Both disks were unmounted cleanly and the fsck knew they were clean file systems, but the tree check still takes some time.

Do I really want it to not check the file system when it boot? That is the question…..

Heres the bootchart with the check disk disabled

I just changes the /etc/fstab entry from

/dev/sda3		/		reiserfs	noatime		0 1

to

/dev/sda3		/		reiserfs	noatime		0 0

I didnt enable the Process Accounting part so some short-lived process may not appear in the bootchart images. Ill try this next and see if I anything interesting.

Alsa Surround Sound with only stereo speakers

Tuesday, April 8th, 2008

I use Gentoo linux for my home desktop and I have had a problem with the alsa sound settings since I moved from my old PC to my new 64bit PC.

The problem was that I only had stereo speakers connected to the front channel and I had to keep opening alsamixer to set the volumes for this channnel.

If I changed the volume in any applications it only updated the PCM channel, which didn’t affect the front channel and didn’t affect the speakers connected to it.

I finally decided to fix this today.

After a little searching I found this HOWTO Surround Sound document, via the gentoo forums, on the gentoo wiki.

After reading it and giving a few failed tries, I used the following for my .asoundrc settings.

# cat ~/.asoundrc
pcm.!dmix {
        type plug
        slave {
                pcm surround51
                channels 6
        }
}
pcm.!default {
        type plug
        slave.pcm "dmix"
        slave.channels 6
        route_policy duplicate
}

I then rebooted. In Alsamixer I set the front channel at 100, and pcm at 50. I then fired up mplayer, when I changed the volume the pcm channel was affected and it did affect my stereo speakers plugged into the front channel.

Additional info

# lspci | grep Audio
00:0f.1 Audio device: nVidia Corporation MCP55 High Definition Audio (rev a2)
# cat /proc/asound/card0/id 
NVidia
# cat /proc/asound/card0/codec#0 | grep Codec
Codec: Realtek ALC885