<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>The Ignition Project: Category Linux</title>
    <link>http://www.ignition-project.com/articles/category/linux</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Open Source Collaboration Solutions</description>
    <item>
      <title>Spotify on Linux: Easy Edition</title>
      <description>&lt;p&gt;Here&amp;#8217;s a script I just wrote that installs Spotify on Linux with Wine. Works great with Wine 1.3.24 on Gentoo Linux x86_64 with PulseAudio (which works great and isn&amp;#8217;t choppy or anything).&lt;/p&gt;

&lt;p&gt;P.S. In the Spotify installer, don&amp;#8217;t tell it to start when done.&lt;/p&gt;

&lt;pre&gt;
#!/bin/sh

# Download spotify and winetricks
wget http://download.spotify.com/Spotify%20Installer.exe -O /tmp/spotify.exe
wget http://winetricks.org/winetricks -O /tmp/winetricks
chmod +x /tmp/winetricks

# Configure $WINEPREFIX
export WINEPREFIX="$HOME/.wine-spotify"
wineboot

# Set some various registry keys (Spotify recommends you use 44100/Emulation)
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\Drivers /v Audio /t REG_SZ /d pulse /f
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DirectSound /v DefaultSampleRate /t REG_SZ /d 44100 /f
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DirectSound /v HardwareAcceleration /t REG_SZ /d Emulation /f

# Install some required packages (IE6 may provide WinInet, if so then it's safe to remove that)
/tmp/winetricks wininet ie6 corefonts tahoma winhttp wmp10 secur32

# Copy the WMP10 MP3 decoder on top of Wine's, tell Wine to use it instead.
cp -fv $WINEPREFIX/drive_c/windows/system32/l3codecp.acm $WINEPREFIX/drive_c/windows/system32/winemp3.acm
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides /v winemp3.acm /t REG_SZ /d native,builtin /f

# Install Spotify.
wine /tmp/spotify.exe

# Remove temporary files
rm /tmp/spotify.exe
rm /tmp/winetricks
&lt;/pre&gt;</description>
      <pubDate>Thu, 04 Aug 2011 22:50:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b3edae28-4381-4d04-a00e-26361570d31f</guid>
      <author>Keith Gable</author>
      <link>http://www.ignition-project.com/articles/2011/08/04/spotify-on-linux-easy-edition</link>
      <category>Howto</category>
      <category>Linux</category>
      <category>wine</category>
      <category>bash</category>
      <category>script</category>
      <category>spotify</category>
    </item>
    <item>
      <title>Howto: Use GNOME media keys with Amarok 2.0</title>
      <description>&lt;p&gt;Actually, this will work for anyone, regardless of desktop environment. GNOME users are the most affected, because GNOME doesn&amp;#8217;t send keys to Amarok for it to process.&lt;/p&gt;

&lt;p&gt;Anyway, this is really simple. First you need to know what your media keys are. I have a &lt;a href="http://www.daskeyboard.com/"&gt;Das Keyboard Professional&lt;/a&gt; so it lacks media keys; I use Meta and the numberpad to control my media stuff.&lt;/p&gt;

&lt;p&gt;First, install &lt;code&gt;xbindkeys&lt;/code&gt;. You probably already have it. Next, &lt;strong&gt;turn off Caps Lock, Numlock, and Scroll Lock&lt;/strong&gt;, then use &lt;code&gt;xbindkeys --key&lt;/code&gt; and press the key or key combination you want. You will likely get a name for the key like &lt;code&gt;XFMediaPlayPause&lt;/code&gt;. Failing that, you&amp;#8217;ll get a code. Either will work. Copy the code or better yet the name.&lt;/p&gt;

&lt;p&gt;Edit &lt;code&gt;~/.xbindkeys&lt;/code&gt;. Make yours like this:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;&amp;quot;amarok --play-pause&amp;quot;
  Mod4 + KP_Multiply

&amp;quot;amarok --next&amp;quot;
  Mod4 + KP_Add

&amp;quot;amarok --previous&amp;quot;
  Mod4 + KP_Subtract&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;First line isn&amp;#8217;t indented and is the command to execute. Second is indented two spaces and the code you got previously.&lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;xbindkeys&lt;/code&gt; to ~/.xinitrc (you may need to create it, &lt;code&gt;chmod +x&lt;/code&gt; it, and put &lt;code&gt;#!/bin/bash&lt;/code&gt; at the beginning of the file).&lt;/p&gt;

&lt;p&gt;Hopefully that helps!&lt;/p&gt;</description>
      <pubDate>Sun, 11 Jan 2009 23:45:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:dfd7b1de-8ab3-4db0-9154-ff9376149eb4</guid>
      <author>Keith Gable</author>
      <link>http://www.ignition-project.com/articles/2009/01/11/howto-use-gnome-media-keys-with-amarok-2-0</link>
      <category>Howto</category>
      <category>Linux</category>
      <category>howto</category>
      <category>amarok</category>
      <category>gnome</category>
    </item>
    <item>
      <title>Fix: Dolphin hijacks the GNOME Places menu</title>
      <description>&lt;p&gt;I had a problem where items in the GNOME Places menu were opening in Dolphin (and weren&amp;#8217;t working). Somehow Dolphin hijacked the &lt;code&gt;file://&lt;/code&gt; protocol. The fix is simple though is something I just found by looking around in GConf Editor.&lt;/p&gt;

&lt;p&gt;Why would I have Dolphin installed in GNOME you ask? Amarok 2.0 needs it. By the way it&amp;#8217;s nice.&lt;/p&gt;

&lt;p&gt;Do this as your normal user (&lt;strong&gt;not root&lt;/strong&gt;):&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;gconftool-2 --set --type=string /desktop/gnome/url-handlers/file/command 'nautilus &amp;quot;%s&amp;quot;'
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/file/enabled true
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/file/need-terminal false&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Hopefully other users find this through Google, because having the GNOME Panel&amp;#8217;s Places menu launch Dolphin instead of Nautilus sucks, and this fixes it! :) (that&amp;#8217;s a paragraph of keywords, folks)&lt;/p&gt;

&lt;p&gt;(If you use a different file manager, replace the command as needed)&lt;/p&gt;</description>
      <pubDate>Thu, 08 Jan 2009 00:16:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:143478bc-ab82-4de3-b7f4-faa1878fa9fb</guid>
      <author>Keith Gable</author>
      <link>http://www.ignition-project.com/articles/2009/01/08/fix-dolphin-hijacks-the-gnome-places-menu</link>
      <category>Howto</category>
      <category>Linux</category>
      <category>Hacks</category>
      <category>gnome</category>
      <category>panel</category>
      <category>dolphin</category>
      <category>kde</category>
      <category>places</category>
      <category>nautilus</category>
    </item>
    <item>
      <title>My Deinterlacing and Post-Processing Scripts</title>
      <description>&lt;p&gt;At work, we put up a lot of Flash video. I use On2 Flix Pro for the Flash encoding part. But I get the content in a variety of formats. Perhaps the most common format we get is 480i MPEG-2 video interleaved. I&amp;#8217;m encoding on a Mac, and QuickTime cannot correctly feed the audio stream into Flix Pro because it&amp;#8217;s interleaved in the video stream. Also, Flix Pro&amp;#8217;s deinterlacer sucks. So, I use &lt;code&gt;mplayer&lt;/code&gt; and &lt;code&gt;mencoder&lt;/code&gt; to fudge the video around and deinterlace it. It&amp;#8217;s working very well. Oh yeah, you&amp;#8217;ll need &lt;a href="http://perian.org/"&gt;Perian&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Read it after the break.&lt;/p&gt;

&lt;p&gt;Wait, how do you get &lt;code&gt;mplayer&lt;/code&gt; and &lt;code&gt;mencoder&lt;/code&gt; on a Mac? &lt;code&gt;mplayer&lt;/code&gt; is included in MPlayer OSX. Show Package Contents, Resources, External_Binaries, mplayer, Show Package Contents, MacOS, and bam, your binary for mplayer is in there. &lt;code&gt;mencoder&lt;/code&gt;, on the other hand, is hard to find. I ended up using ffmpegX&amp;#8217;s &lt;code&gt;mencoder&lt;/code&gt;, which is &amp;#8220;MEncoder dev-CVS-060307-04:23-4.0.1&amp;#8221;, compared to my &lt;code&gt;mplayer&lt;/code&gt; which is &amp;#8220;MPlayer dev-SVN-r25648-4.0.1&amp;#8221; and way newer.&lt;/p&gt;

&lt;p&gt;First, I have to strip the MP3 audio stream and the MPEG-2 video stream, into separate files. I have my video rips folder set up with a &amp;#8220;scripts&amp;#8221; subfolder and a &amp;#8220;work&amp;#8221; subfolder. Here is my script to dump both streams:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#!/bin/bash

# Takes $1 and dumps it into two files in work/
./scripts/mplayer &amp;quot;$1&amp;quot; -dumpvideo -dumpfile work/dump.m2v
./scripts/mplayer &amp;quot;$1&amp;quot; -dumpaudio -dumpfile work/dump.mp3&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Next, I run cropdetect, which is a stupid script to save me typing:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#!/bin/bash

# Runs crop detect on the stream we dumped.
./scripts/mplayer work/dump.m2v -vf cropdetect -vo null -ao null&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Next, I run a deinterlacing and cropping filter. And postprocessing maybe, but I&amp;#8217;m not even sure if it works in &lt;code&gt;mplayer&lt;/code&gt; like it works in &lt;code&gt;mencoder&lt;/code&gt;. I&amp;#8217;m sure the latest &lt;code&gt;mencoder&lt;/code&gt; can let me combine this step with the next one. But as it stands I need to do this in two steps.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#!/bin/bash

# Takes work/dump.m2v and applies the crop in $1
# and deinterlaces, outputting to work/dump.deint.yuv

./scripts/mplayer work/dump.m2v -vf crop=$1,pp=de,yadif=0 \
    -vo yuv4mpeg:file=work/dump.deint.yuv&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Finally, I put both streams together, doing final postprocessing. I also convert it to HuffYUV because QuickTime can play it with &lt;a href="http://perian.org/"&gt;Perian&lt;/a&gt;. Again, I think the latest mencoder has the &lt;code&gt;yadif&lt;/code&gt; deinterlacer, which would let me combine the previous script and current script in one step. BTW - A/V sync gets off if you leave out &lt;code&gt;harddup&lt;/code&gt;.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#!/bin/bash

# Takes files in work and compiles them into work/output.avi
# $1 if specified is a list of additional filters to apply.

if [ &amp;quot;x$1&amp;quot; == &amp;quot;x&amp;quot; ]; then
    ./scripts/mencoder work/dump.deint.yuv -noskip -vf harddup,pp=de -ofps 30000/1001 -ovc lavc \
        -lavcopts vcodec=huffyuv:format=422p -audiofile work/dump.mp3 -oac copy -o work/output.avi
else
    ./scripts/mencoder work/dump.deint.yuv -noskip -vf harddup,pp=de,$1 -ofps 30000/1001 -ovc lavc \
        -lavcopts vcodec=huffyuv:format=422p -audiofile work/dump.mp3 -oac copy -o work/output.avi
fi&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Also, if you noticed, the previous script lets me specify additional filters on the command line if I want. Usually I have to run hqdn3d, but not always.&lt;/p&gt;

&lt;p&gt;Oh, and this will use about 1 GB per minute of content, times two because it&amp;#8217;s creating an uncompressed file twice (the final AVI and the intermediate &lt;code&gt;.deint.yuv&lt;/code&gt;). Don&amp;#8217;t run yourself out of disk space! :)&lt;/p&gt;</description>
      <pubDate>Wed, 26 Nov 2008 09:05:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:afb21c67-069b-4594-8089-e9601b2ec996</guid>
      <author>Keith Gable</author>
      <link>http://www.ignition-project.com/articles/2008/11/26/my-deinterlacing-and-post-processing-scripts</link>
      <category>Howto</category>
      <category>Linux</category>
      <category>Hacks</category>
      <category>multimedia</category>
      <category>deinterlacing</category>
      <category>mplayer</category>
    </item>
  </channel>
</rss>

