<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Putztastic Tech</title>
	<atom:link href="http://www.nikvdp.com/technotes/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.nikvdp.com/technotes</link>
	<description>A chronicle of my putztastic technical escapades</description>
	<lastBuildDate>Wed, 25 Apr 2012 15:22:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to unlock a PDF for annotation</title>
		<link>http://www.nikvdp.com/technotes/?p=148</link>
		<comments>http://www.nikvdp.com/technotes/?p=148#comments</comments>
		<pubDate>Wed, 25 Apr 2012 15:07:21 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=148</guid>
		<description><![CDATA[A lot of PDFs come password protected to prevent you from copying text out of them. Unfortunately, this also means you can&#8217;t annotate them or take notes on them, something I do a lot of when reading academic journal articles. Luckily opensource tools come to the rescue as usual. Download ghostscript (if you&#8217;re running OS <a href='http://www.nikvdp.com/technotes/?p=148'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>A lot of PDFs come password protected to prevent you from copying text out of them. Unfortunately, this also means you can&#8217;t annotate them or take notes on them, something I do a lot of when reading academic journal articles. Luckily opensource tools come to the rescue as usual. Download ghostscript (if you&#8217;re running OS X, or anything *nix you probably have it already) and run the following (replacing the filenames with your files of course)  to generate a new copy of the file that you can annotate:</p>
<p><code>gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -c .setpdfwrite -f originalPDF.pdf</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=148</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting iBooks to read a book out loud (narrate) on an iOS 5 iPhone (with page-turning)</title>
		<link>http://www.nikvdp.com/technotes/?p=142</link>
		<comments>http://www.nikvdp.com/technotes/?p=142#comments</comments>
		<pubDate>Sun, 12 Feb 2012 10:50:09 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=142</guid>
		<description><![CDATA[Information on this is surprisingly muddled and confusing. A lot of info seems to say it can only be done on an iPad, or don&#8217;t mention how to toggle Voiceover on and off. Here&#8217;s the solution I&#8217;m using now, and it doesn&#8217;t even require a jailbroken iPhone. (Incidentally, it does require iBooks which doesn&#8217;t run <a href='http://www.nikvdp.com/technotes/?p=142'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Information on this is surprisingly muddled and confusing. A lot of info seems to say it can only be done on an iPad, or don&#8217;t mention how to toggle Voiceover on and off. Here&#8217;s the solution I&#8217;m using now, and it doesn&#8217;t even require a jailbroken iPhone. (Incidentally, it does require iBooks which doesn&#8217;t run right with earlier jailbreaks. See <a href="http://www.redmondpie.com/fix-ibooks-on-ios-5.0.1-iphone-ipad-ipod-touch-after-untethered-jailbreak-using-corona-1.0.5-update/">this link</a> if you&#8217;re phone is jailbroken and your iBooks won&#8217;t start. Long story short, you need to use Cydia to install the latest Corona jailbreak).</p>
<p>To get this working, first go to accessibility settings and prepare your voiceover settings. Start settings, go to Accessibility, and scroll to the bottom. From there hit the &#8216;Triple-click Home&#8217; option and choose &#8220;VoiceOver.&#8221;</p>
<p>If you want, go into the VoiceOver settings at the top of this page and customize VoiceOVer to your liking. Once this is done open up iBooks and open up the book you want to listen to. Flip to a page with text, then tap the home button three times. You&#8217;ll hear the iPhone say &#8220;Voiceover on.&#8221; Now, tap and hold on the line of text you want reading to start from. The phone will read it out loud and put a small box around the line of text. Now, using two fingers drag from that line downwards and the phone will start reading the text out loud, and flip to the next page when the last line is reached. Enjoy.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=142</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watching movies in two languages: Merging two separate srt files (one for each language) into one single SRT file</title>
		<link>http://www.nikvdp.com/technotes/?p=129</link>
		<comments>http://www.nikvdp.com/technotes/?p=129#comments</comments>
		<pubDate>Tue, 24 Jan 2012 18:25:53 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=129</guid>
		<description><![CDATA[Been trying to figure out how to do this for quite awhile. Finally found a program that can handle it, but unfortunately it&#8217;s windows only and GUI based, so doing it for a batch is difficult. Anyway, here&#8217;s the problem this sets out to solve: For language learning purposes or because you want to watch <a href='http://www.nikvdp.com/technotes/?p=129'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Been trying to figure out how to do this for quite awhile. Finally found a program that can handle it, but unfortunately it&#8217;s windows only and GUI based, so doing it for a batch is difficult. Anyway, here&#8217;s the problem this sets out to solve:</p>
<p>For language learning purposes or because you want to watch something with a friend who doesn&#8217;t read the same language as you you want to watch a movie with subtitles from two different languages playing at the same time. We&#8217;ll assume the subtitles you&#8217;re working with are in SRT format, if they&#8217;re not the situation is quite a bit more complicated, you can check the suggestions below.</p>
<p><a style="display:none;" id="te2051506966" href="javascript:expand('#te2051506966')">Suggestions for subtitles in other formats</a>
<div class="te_div" id="te2051506966"><script language="JavaScript" type="text/javascript">expander_hide('#te2051506966');</script>
Your best bet is simply to get them into SRT format. You can find a lot of subs at <a href="http://subscene.com/">subscene</a> or <a href="http://www.opensubtitles.org/">opensubtitles</a> (or just google) and save yourself the trouble of converting. If that&#8217;s not an option, then you can simply convert your subs to SRT format. The program we&#8217;ll be using below, Aegissub can import a wide variety of subtitle files, with the exception of vobsub (.idx/.sub extension subtitles).</p>
<p>If you have that kind of subtitle you&#8217;ll need to do an OCR conversion, do some googling for avidemux and/or vobsub.<br />
</div></p>
<div> If you&#8217;re running windows, then the easiest solution by far is just to use <a href="http://www.kmplayer.com/forums/">KMPlayer</a> (as of this writing latest download link is <a href="http://www.kmplayer.com/forums/showthread.php?t=22193">here</a>, if it&#8217;s changed just browse the forum a bit). In KMPlayer you can open the file, then choose a 1st and 2nd language subtitle from within the right click menu.</div>
<div></div>
<div>If you&#8217;re not on windows then you&#8217;ll need to proceed with the merge and convert process. In order to merge the subtitles together you&#8217;ll first need to download <a href="http://www.aegisub.org/">Aegisub</a> (it&#8217;s cross platform). Within Aegisub open the first language&#8217;s subtitle file, hit Cmd-A (or Ctrl-A on windows) and then Edit-&gt;Copy Lines. Open the second language&#8217;s file, and paste the contents in. Then do File-&gt;Export Subtitles and save to a new file. If you re-open that new file you&#8217;ll see that subs have been merged together. So just rename the new file to match your subtitle file and you&#8217;re good to go.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=129</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Homebrew issues after upgrading to OS X Lion</title>
		<link>http://www.nikvdp.com/technotes/?p=91</link>
		<comments>http://www.nikvdp.com/technotes/?p=91#comments</comments>
		<pubDate>Thu, 08 Dec 2011 17:00:11 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=91</guid>
		<description><![CDATA[Random things I had to deal with: Getting NTFS write support to work This was not all that bad, I installed homebrew, then used it to compile ntfs-3g (and by extension fuse). Fuse requires a little manual editing to get it going by hand, but homebrew helpfully points out what needs to be done. The <a href='http://www.nikvdp.com/technotes/?p=91'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Random things I had to deal with:</p>
<p><span style="text-decoration: underline;">Getting NTFS write support to work<br />
</span>This was not all that bad, I installed homebrew, then used it to compile ntfs-3g (and by extension fuse). Fuse requires a little manual editing to get it going by hand, but homebrew helpfully points out what needs to be done. The only tricky bit was that the <a href="http://fernandoff.posterous.com/ntfs-write-support-on-osx-lion-with-ntfs-3g-f">website</a> with directions that homebrew points you too on how to get fuse automounting NTFS filesystems is meant to be used with MacPorts, so one line of the<code>/sbin/mount_ntfs</code> that he gives you needs to be changed. On line 30 you want to change <code>/opt/local/bin/ntfs-3g</code> to <code>/usr/local/bin/ntfs-3g</code></p>
<p><span style="text-decoration: underline;">Getting Homebrew packages such as mplayer and ffmpeg to install correctly<br />
</span>The other problem I ran into is that Lion seems to be using a different version of gcc than Snow Leopard was using, which caused a lot of programs to stop building correctly. Someone has nicely packaged up an installer for the non-llvm version of GCC, it&#8217;s available from <a title="here" href="https://github.com/kennethreitz/osx-gcc-installer" target="_blank">here</a>.  To fix the problems and install correctly first uninstall Xcode via <code>/Developer/Library/uninstall-devtools --mode=all</code>, install that package&#8217;s gcc, and then reinstall Xcode.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=91</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing DuoKan on a 3.2.1 Kindle</title>
		<link>http://www.nikvdp.com/technotes/?p=79</link>
		<comments>http://www.nikvdp.com/technotes/?p=79#comments</comments>
		<pubDate>Tue, 28 Jun 2011 18:58:32 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=79</guid>
		<description><![CDATA[This is possible! Long story short a comment on YiFan&#8217;s 3.2.1 jailbreak page pointed out how to do it. I won&#8217;t fully explain how to do it here, but basically you need to use YiFan&#8217;s jailbreak, then install usbNetwork access to get SSH access to your kindle. Once that&#8217;s done you can copy DuoKan onto <a href='http://www.nikvdp.com/technotes/?p=79'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This is possible! Long story short a comment on YiFan&#8217;s 3.2.1 <a href="http://yifan.lu/2011/06/02/kindle-3-2-1-jailbreak/">jailbreak page</a> pointed out how to do it. I won&#8217;t fully explain how to do it here, but basically you need to use YiFan&#8217;s jailbreak, then install usbNetwork access to get SSH access to your kindle. Once that&#8217;s done you can copy DuoKan onto the kindle as usual, and use your SSH access to run the install script. I&#8217;m new to the kindle jailbreaking world, but everything I needed to download to make this work was available <a href="http://www.mobileread.com/forums/showthread.php?t=88004usbnetwork">here</a>. Duokan itself (english version) you can get from the links on flip&#8217;s post <a href="http://flip.netzbeben.de/2010/11/duokan-available-with-english-gui-today/">here</a>.</p>
<p>Some notes (mostly to remind myself so I don&#8217;t have to figure it all out again next time, but maybe they will be useful to someone)</p>
<p>Jailbreak seemed to work used someone&#8217;s <a href="http://pastebin.com/nc3rsVQw">perl script</a> to make it quicker</p>
<p>for the usbNetwork portion, I followed the steps in the usbNetwork README_FIRST.txt, only thing I had to do that wasn&#8217;t mentioned was set up a static ip for my computer that was in the same subnet as the IP set up on the kindle.</p>
<p>This didn&#8217;t seem to be mentioned anywhere in the readme files, but to disable the usbnetworking and get back to disk mode you have to retype ~usbNetwork in the search box.<br />
Original text of the comment from elale.smth on <a href="http://yifan.lu/2011/06/02/kindle-3-2-1-jailbreak/">Yifan&#8217;s page</a> for posterity:</p>
<p>If you wanna install Duokan (for Chinese user), you need first install usbnetwork-0.33, and copy DK¿s folders to root of Kindle drive. Then telnet/ssh to kindle via usb or wifi to run the following script on your kindle:sh /mnt/us/DK_System/install/install.sh(this is just the installation script of Duokan, which cannot be executed by its update bin file, so you need to do it manually. Now you can ¿reboot¿ your kindle to make it work).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=79</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Extracting vobsub subtitles with mencoder (after Handbrake encodes them into an mp4)</title>
		<link>http://www.nikvdp.com/technotes/?p=70</link>
		<comments>http://www.nikvdp.com/technotes/?p=70#comments</comments>
		<pubDate>Sun, 27 Mar 2011 02:36:39 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=70</guid>
		<description><![CDATA[The new version of Handbrake allows you to store vobsub subtitles into the output mp4 file as you rip. This is a very nice touch in that now you no longer have to fire up vobsub separately to rip your subtitles and can convert the whole movie in one rip. Unfortunately, as the Handbrake people <a href='http://www.nikvdp.com/technotes/?p=70'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The new version of Handbrake allows you to store vobsub subtitles into the output mp4 file as you rip. This is a very nice touch in that now you no longer have to fire up vobsub separately to rip your subtitles and can convert the whole movie in one rip. Unfortunately, as the Handbrake people mentioned player compatibility with mp4 vobsub subtitles is rather low. To get around this, I needed a way to extract standard vobsub format subtitles from the mp4 file. As usual, mplayer/mencoder was able to take care of it for me.</p>
<p>First, make sure you have a good copy of mplayer/mencoder installed with support for osd and subtitles. This is covered in other posts here, if using macports you&#8217;ll need to add custom variants. Homebrew takes care of it by itself.</p>
<p>First open the mp4 in VLC and check the subtitles control to see what languages you have available and what IDs they are. Then, run this command:</p>
<p><code>mencoder vendetta\ guy.m4v -vobsubout vendettaguy -vobsuboutindex 2 -vobsuboutid en -sid 1 -nosound -ovc copy -o test.avi</code></p>
<p>in this example -vobsubout provides the name of the .idx/.sub vobsub files you&#8217;ll create. -vobsuboutindex is the index in the output vobsub files (if you want to add multiple languages to your output you can repeat this process). the -sid parameter controls which stream you extract from your input file, so enter the number you got from VLC here. Use the -vobsuboutid paramter to control the name of the language in the list. Good luck finding a list of the proper format of these codes, I only know English = en, Chinese (Simplified) = zh and Japanese = ja.</p>
<p>You may additionally need to add the fps if mencoder doesn&#8217;t detect it properly. To do this, just add -fps to the command line arg, (try 29.970) or another valid value.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=70</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a Poptop (PPTP) VPN on Ubuntu</title>
		<link>http://www.nikvdp.com/technotes/?p=51</link>
		<comments>http://www.nikvdp.com/technotes/?p=51#comments</comments>
		<pubDate>Fri, 13 Aug 2010 14:11:29 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=51</guid>
		<description><![CDATA[This is a pretty useful trick if you need to get around a corporate firewall or the Great fireWall of China. It still allows PPTP through, setting it up is pretty easy and unlike OpenVPN it&#8217;s supported by every major OS without any additional software. You can even use it from your iPhone. To get <a href='http://www.nikvdp.com/technotes/?p=51'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This is a pretty useful trick if you need to get around a corporate firewall or the Great fireWall of China. It still allows PPTP through, setting it up is pretty easy and unlike OpenVPN it&#8217;s supported by every major OS without any additional software. You can even use it from your iPhone.</p>
<p>To get it going you need one server or VPS that you have access too. Install pptpd with<br />
<code>sudo apt-get install pptpd</code><br />
Now to edit some files&#8230; I&#8217;d suggest giving your machine a static IP address by editing<code> /etc/network/interfaces</code> (be careful, if you are not using the server version of Ubuntu Network Manager will most likely take over and set your machine back to DHCP. I&#8217;d recommend disabling Network Manager or trying to set a Static IP through it.</p>
<p>You will first need to figure out what subnet your router is using. The quickest way to do this is just to type <code>ifconfig</code> at the command prompt. Look for the output from</p>
<blockquote><p><code>eth0</code>, it should look something like this:<br />
<code>eth0      Link encap:Ethernet  HWaddr 00:22:22:22:22:22<br />
<strong><span style="color: #3366ff;">inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0</span></strong><br />
inet6 addr: fe80::240:45ff:fe26:775a/64 Scope:Link<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:225008 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:76464 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:32669088 (32.6 MB)  TX bytes:21169594 (21.1 MB)<br />
Interrupt:23 Base address:0xc800 </code></p></blockquote>
<p>The blue line is the one that you need to pay attention to. To drastically oversimplify, the numbers next to <code>inet addr</code>, are your IP address and the first three represent your subnet.  Ok, I&#8217;m too lazy to write the rest of this with that much detail. Long story short:</p>
<ul>
<li>set your current IP address with <code>/etc/network/interfaces</code> to a static IP. </li>
<li>edit <code>/etc/pptpd.conf</code> and add this:<br />
<code>localip 192.168.1.101<br />
remoteip 192.168.1.20-24<br />
</code><br />
changing the IPs to match your network&#8217;s config. </li>
<li>Add a line to /etc/ppp/chap-secrets with desired name and password</li>
<li>Uncomment and enable the the <code>#net.ipv4.ip_forward=0</code> line in 	<code>/etc/sysctl.conf</code> to <code>net.ipv4.ip_forward=1</code></li>
<li>Edit /etc/rc.local and add the following before the <code>exit 0</code>:<br />
<code>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<br />
iptables -A FORWARD -i eth0 -o ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
iptables -A FORWARD -i ppp0 -o eth0 -j ACCEPT</code></li>
<li>Execute <code>/etc/init.d/rc.local start</code> to start the IP masquerading</li>
<li>Execute <code>sysctl -p</code> to refresh the sysctl.conf settings you changed</li>
<p>That should do it.</p>
<p>References:<br />
<a href="http://www.ubuntugeek.com/howto-pptp-vpn-server-with-ubuntu-10-04-lucid-lynx.html">http://www.sharedknowhow.com/2008/09/linux-vpn-server-installation-for-use-with-iphone/</a><br />
<a href="http://www.ubuntugeek.com/howto-pptp-vpn-server-with-ubuntu-10-04-lucid-lynx.html">http://www.ubuntugeek.com/howto-pptp-vpn-server-with-ubuntu-10-04-lucid-lynx.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=51</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FFmpeg iphone recipes</title>
		<link>http://www.nikvdp.com/technotes/?p=33</link>
		<comments>http://www.nikvdp.com/technotes/?p=33#comments</comments>
		<pubDate>Sun, 18 Apr 2010 00:34:20 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=33</guid>
		<description><![CDATA[My Version This is the ffmpeg command I use with the copy of ffmpeg I built locally on my mac via MacPorts. Check that your ffmpeg is OK by running ffmpeg from the command prompt, it will spit out some information about the various options it was compiled with, should look more or less like <a href='http://www.nikvdp.com/technotes/?p=33'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><strong>My Version</strong><br />
This is the ffmpeg command I use with the copy of ffmpeg I built locally on my mac via MacPorts. Check that your ffmpeg is OK by running<br />
<code>ffmpeg</code><br />
from the command prompt, it will spit out some information about the various options it was compiled with, should look more or less like this:<br />
<code><br />
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.<br />
configuration: --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64<br />
</code></p>
<p>Then use a command like the one below:<br />
<code><br />
ffmpeg -i INPUT.MOV -acodec libfaac -ab 128k -s 640x480 -vcodec libx264 -vpre hq -vpre ipod640 -b 1500k -aspect 4:3 -threads 0 -f ipod output.m4v<br />
</code></p>
<p>Info taken from <a href="http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/">this site</a>.<br />
<strong>Stolen from Azureus</strong></p>
<p>Azureus now has iPhone encoding built in. I was a little curious how it managed the encoding, I had hoped they wrote a Java based video encoder capable of converting anything into iPhone suitable mp4s thereby creating a cross-platform solution that didn&#8217;t require compilation, but alas they, like everybody else used the power of open source via ffmpeg.</p>
<p>A little playing with the ps command and I was able to rescue the ffmpeg incantation they use to convert to iPhone. Since they helpfully include a pre-compliled ffmpeg binary with all the necessary libs this is actually almost as good since as many know trying to compile ffmpeg for each platform can be quite a difficult and trying experience.</p>
<p>Anyhow, here’s the code:</p>
<p><code>/Users/YourUser/Library/Application Support/Vuze/plugins/vuzexcode/ffmpeg -y -threads 2 -i file.avi -f mp4 -s 480x272 -r 23.976 -vcodec libx264 -bf 0 -coder 0 -refs 4 -g 50 -maxrate 8000kbps -bufsize 8000kbit -crf 20 -me_method umh -ar 32000 -ac 1 -ab 128 -acodec libfaac outfile.mp4</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=33</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Hardcoding subtitles using mencoder</title>
		<link>http://www.nikvdp.com/technotes/?p=27</link>
		<comments>http://www.nikvdp.com/technotes/?p=27#comments</comments>
		<pubDate>Fri, 25 Dec 2009 03:03:25 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=27</guid>
		<description><![CDATA[This post is about how to hardcode srt format subfiles in a separate file into your videos using mencoder, with a specific emphasis on doing it for Chinese subtitles. If you want to hardcode vobsub based subtitles, mencoder seems incapable of doing it, the only reliable way I&#8217;ve found thus far is to use Handbrake. <a href='http://www.nikvdp.com/technotes/?p=27'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This post is about how to hardcode srt format subfiles in a separate file into your videos using mencoder, with a specific emphasis on doing it for Chinese subtitles.</p>
<p>If you want to hardcode vobsub based subtitles, mencoder seems incapable of doing it, the only reliable way I&#8217;ve found thus far is to use Handbrake.</p>
<p>Update: VLC is also capable of it if you use it from the command line. It&#8217;s tricky tho. Here&#8217;s the command that worked for me:<br />
<code>/Applications/VLC.app/Contents/MacOS/VLC -I dummy -v "The Lost bladesman (donny yen).m4v" "vlc://quit" --start-time 225 --stop-time 240 --sout-transcode-soverlay --sub-track=0 --sout='#transcode{vcodec=mp4v,vb=400,scale=.5,acodec=mp4a,ab=96,channels=2}:std{access=file,mux=mp4,dst=lostblades.m4v}'<br />
</code></p>
<pre class="brush: plain;">
/Applications/VLC.app/Contents/MacOS/VLC -I dummy -v &quot;The Lost bladesman (donny yen).m4v&quot; &quot;vlc://quit&quot; --sout-transcode-soverlay --sub-track=0 --sout='#transcode{vcodec=mp4v,vb=600,scale=1,acodec=mp4a,ab=96,channels=2}:std{access=file,mux=mp4,dst=lostblades.m4v}'
</pre>
<p>http://automate-everything.com/lang/en/2009/05/how-to-embed-idx-subtitles-into-an-mp4-or-avi-file-with-mencoder/</p>
<p>Prerequisites:<br />
mplayer installed on your mac via ports with this command:</p>
<p><code><br />
sudo port install mplayer-devel +aa +mencoder_extras +osd +xvid +x264 +faac<br />
</code></p>
<p>To use Chinese subtitles you must have them encoded in a text encoding mencoder can understand, have a font that can render that text encoding, and then you must tell mencoder to actually use that text encoding. I made this happen with Chinese fonts by using one of Apple&#8217;s Chinese fonts, saving my subtitles file as utf8 and telling mencoder to use utf8 when rendering the subtitle. I had to disable fontconfig using the -<code>nofontconfig</code> option befause fontconfig did not seem to be properly supporting unicode (utf8) characters.</p>
<p>Merge Chinese subtitles (utf8 encoded) into the film. This made use of a Chinese font copied into ~/.mplayer/subfont.ttf. To be double sure I also edited ~/.mplayer/config to have <code>font=~/.mplayer/subfont.ttf</code>. The subtitle stream doesn&#8217;t actually get hardcoded in unless you specify <code>sid -1</code> (or whatever ID your subtitle stream is. You can find the subtitle ID by doing mplayer -v on your movie file. You can also just use the <code>-font</code> option as in this example:</p>
<p><code>mencoder -utf8 -nofontconfig -font /Library/Fonts/Hiragino\ Sans\ GB\ W6.otf -sub Waiting.Alone.2005.DVDScr.XviD.MP3-NewMov.cht.srt -ss 5:00 -endpos 30 -ovc lavc -lavcopts vbitrate=1000 -oac copy Waiting.Alone\[独自等待\].avi -o WaitingAlone.chineseSubs.avi</code></p>
<p>The <code>-nofontconfig</code> is used so that you can properly specify the Chinese font.</p>
<p><code>mencoder -utf8 -nofontconfig "Kiss.Kiss-Bang.Bang[2005]DvDrip[Eng]-aXXo.avi" -sub "Kiss.Kiss-Bang.Bang[2005]DvDrip[Eng]-aXXo.srt" -sid 1 -ovc lavc -lavcopts vcodec=ffvhuff -oac copy -ss 5:00 -endpos 30 -o ~/Desktop/test.avi</code></p>
<p><code><br />
mencoder /Users/nik/Desktop/torrents/waiting-alone/proper/simple.avi -sub /Users/nik/Desktop/torrents/waiting-alone/proper/simple.srt -sid 1 -subfont 'Helvetica' -subfont-text-scale 3.5 -ovc lavc -lavcopts vcodec=ffvhuff -oac copy -ss 5:00 -endpos 30 -o /Users/nik/Desktop/torrents/waiting-alone/proper/out.avi<br />
</code></p>
<p>Converting to iphone:<br />
<a href="http://blog.jharding.org/2008/05/encoding-video-for-iphone-with-mencoder.html">reference</a></p>
<p><code>mencoder wps-hearme-cd1.avi -ss 30 -endpos 15 -o test.mp4 -vf scale=480:-10,harddup -oac faac -faacopts mpeg=4:object=2:raw:br=128 -of lavf -lavfopts format=mp4 -ovc x264 -x264encopts nocabac:level_idc=30:bframes=0:threads=auto</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=27</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Snow Leopard upgrade difficulties (adventures with Prism and Fluid SSBs)</title>
		<link>http://www.nikvdp.com/technotes/?p=3</link>
		<comments>http://www.nikvdp.com/technotes/?p=3#comments</comments>
		<pubDate>Wed, 02 Sep 2009 23:07:24 +0000</pubDate>
		<dc:creator>Nik</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[gears]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://www.nikvdp.com/technotes/?p=3</guid>
		<description><![CDATA[For whatever reason upgrading to Snow Leopard broke the Fluid webApp I use to monitor my gMail account. (What&#8217;s Fluid you ask? Fluid is an application that allows you to make a website into a separate application. Basically, it&#8217;s a new browser window, but it gives you a separate icon on your Dock/Start Menu/What have <a href='http://www.nikvdp.com/technotes/?p=3'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>For whatever reason upgrading to Snow Leopard broke the <a href="http://fluidapp.com/" target="_blank">Fluid</a> webApp I use to monitor my gMail account. (What&#8217;s Fluid you ask? Fluid is an application that allows you to make a website into a separate application. Basically, it&#8217;s a new browser window, but it gives you a separate icon on your Dock/Start Menu/What have you). I use Fluid with Google Gear&#8217;s offline plugin to get the convenience of a standalone email app, but still use the Gmail interface I&#8217;m used too and still be guaranteed to have access to all my email anywhere I can find a web browser.</p>
<p>One of the nicest things about using Fluid was that it let me use Google&#8217;s Offline Gmail extension (and the Google Gears plugin it requires) separate from my browser. That way I don&#8217;t have to clutter up my browser&#8217;s profile directory  with all my offline emails (this is important to me since I sync my entire browser profile over <a href="http://www.getdropbox.com">Dropbox</a> so that I get the same browsing experience everywhere). Unfortunately, it appears Google&#8217;s Gears isn&#8217;t quite compatible with Snow Leopard yet, so my offline Gmail functionality is no longer working. Confusingly, Fluid wouldn&#8217;t even load the Gmail website, it just hung at a white screen repeatedly.</p>
<p>Until Google updates the Gears plugin to support Snow Leopard, I&#8217;m temporarily switching back to Mozilla&#8217;s Prism product. Prism is very similar to Fluid (in fact, Prism is what inspired Fluid&#8217;s developers to create Fluid), but instead of being based on Apple&#8217;s WebKit (and thus highly integrated with OS X) it&#8217;s based on the Firefox code. This has the nice advantage that it&#8217;s cross platform and that it&#8217;s capable of using Firefox add-ons. It turns out only the Gears Safari plugin is broken on Snow Leopard, the Gears firefox add-on still works fine, so Prism has been able to solve all my email woes.</p>
<p>Well, almost all. One nice feature of Fluid is that it automatically shows dock badges on the Gmail dock icon whenever a new email message comes in. With Prism I&#8217;m stuck relying on my Gmail Checker Firefox add-on to alert me to new messages. Getting offline Gmail to work in Prism is a bit of a challenge though. I ended up following the directions here:</p>
<p><a href="http://otaqui.com/blog/382/enable-google-gears-and-offline-gmail-for-mozilla-prism/">http://westacular.livejournal.com/43666.html</a></p>
<p>with some references to the directions here:</p>
<p><a href="http://otaqui.com/blog/382/enable-google-gears-and-offline-gmail-for-mozilla-prism/">http://otaqui.com/blog/382/enable-google-gears-and-offline-gmail-for-mozilla-prism/</a><br />
Here&#8217;s my modified copy of the <a href="wp-content/uploads/gears-for-prism.xpi">google-gears xpi</a>, it should work on any version of Prism since I basically just short-circuited the version check. YMMV, I&#8217;m not responsible for any computing disasters that may result from using this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nikvdp.com/technotes/?feed=rss2&#038;p=3</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

