Ok, so my previous post didnt exactly add any technical details on how I got my iPod classic working with mythTV. Personally I hate that, it took me a fair bit of googling to get this working and I too got stuff with too many useless blogs with no explanation on how they got it working. So here is some more details on what I did, its not exhaustive, but contact me if you want to know more:
My server runs Ubuntu6.06 LTS server. MythTV 0.20.x, backend only and mythweb.
first off I followed the instructions at www.mytht2ipod.org I ensured I got nuvexport and ffmpeg installed via apt-get and the ubuntu repositories. But of course none of it seemed to work correctly. So……
I grabbed the latest nuvexport Then tried to manually export to ipod. But of course it then informs me that ffmpeg needs to be newer than the one isntalled by Ubuntu. So now I download the latest from SVN
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
Now I try to build it, this involves installing libs (e.g sudo apt-get install libx264) and then building ffmpeg
./configure --enable-gpl --enable-pp --enable-zlib --enable-libvorbis --enable-libogg --enable-libtheora --enable-liba52 --enable-libgsm --enable-libx264 --enable-faad --disable-debug --enable-libxvid --enable-libfaac --enable-pthreads --enable-libmp3lame --disable-vhook --prefix=/usr
One thing to note is that ffmpeg at some stage in the last year or so has changed the way it references most of the libs. You used to do –enable-aac now its –enable-libfaac and so on for the 3rd party libs to be built in.
Sooo…. turns out the version of libX264 included in the Ubuntu universe was too old to convert files correctly for iPod, so I download the latest x264 driver
svn co svn://svn.videolan.org/x264/trunk x264
Then it turns out I had to install from tarball the latest version of YASM, to build libx264 correctly. http://www.tortall.net/projects/yasm/
Now, I compiled and installed YASM, NOW you can compile and install libx264, now you can compile ffmpeg that will support iPod correctly.
Almost there, well not quite, now nuvexport wont call ffmpeg correctly, so go back to the nuvexport site and apply the patches listed there so that it references the libs correctly. I cannot find links to the patches right now…. but once these are applied it will call ffmpeg correctly, again this is to do with the renaming of the ffmpeg flags. nuvexport internally calls ffmpeg to detect which 3rd party drivers it supports, so the new ffmpeg is reporting it supports libx264 but nuvexport is looking for x264 not libx264. The patch fixes that.
Sooooo now myth2Ipod didnt really work still, although reading through the code it did all the rss feed stuff fine and I didnt fancy writing my own code, so I just modified the myth2ipod code to call nuvexport to export to nuvsql
$nuvoptions ="--mode=nuvsql --nice=19 --cutlist --nodenoise --nodeint
erlace --nomultipass";
$cmd = "/usr/local/bin/nuvexport --chanid=$chanid --start=$start $nuvoptions --filename=$chanid\_$start.temp --path=$feedpath";
$cmd = "/usr/local/bin/brian2ipod $feedpath$chanid\_$start.temp/$chanid\_$start.mpg $feedpath$chanid\_$start.$portable.mp4";
the brian2ipod script simply then converts the mpg2 file dumped by nuvexport into mp4 format.
#!/bin/bash
#rm -rf tmp.mpg* 2> /dev/null
#mythtranscode --mpeg2 -i $1 -o tmp.mpg
/usr/bin/ffmpeg -i $1 -acodec libfaac -ac 2 -ar 44100 -ab 128k -s 320x240 -vcodec libx264 -b 300k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 300k -maxrate 300k -bufsize 300k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 15 -qmax 51 -qdiff 4 -level 30 -aspect 320:240 $2
# rm -rf tmp.mpg* 2> /dev/null
Easy Huh! its very cool now its running, but basically you have to rebuild ffmpeg, libx264, nuvexport and then hack myth2ipod to make it work. Is it more hassle than its worth, I dont think so. I really love these features on my iPod…. now if only they could fix the iPod bugs to make the experience even better!