Wednesday, September 22, 2010

Convert movies to iPhone friendly format with ffmpeg on a Mac

I wanted to make a bash script that parsed a given directory for movie files and then made them into an iPhone friendly format. In this script I use HandBrakeCLI and ffmpeg.

HandBrakeCLI is a no-brainer to install, just download the binary and run it, but ffmpeg is a bit harder to get working, so here are a brief and "technical" instruction on how I succeeded. Apple Developer Tools is required!

1. mkdir ~/source
2. cd ~/source

3. cvs -d:pserver:anonymous@lame.cvs.sourceforge.net:/cvsroot/lame login (press enter when asked for passwd)
4. cvs -z3 -d:pserver:anonymous@lame.cvs.sourceforge.net:/cvsroot/lame co -P lame
5. cd lame
6. ./configure
7. make
8. sudo make install

9. cd ~/source
10. cvs -d:pserver:anonymous@faac.cvs.sourceforge.net:/cvsroot/faac login
11. cvs -z3 -d:pserver:anonymous@faac.cvs.sourceforge.net:/cvsroot/faac co -P faac
12. cd faac
13. ./configure
14. make
15. sudo make install

16. cd ~/source
17. svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
18. cd ffmpeg
19. ./configure --enable-libmp3lame --enable-shared --disable-mmx --arch=x86_64 --enable-libfaac --enable-gpl --enable-nonfree --enable-avfilter --enable-postproc
20. make
21. sudo make install


And now, when you're done, you can convert movies to mp4 that is 480px wide and keeping the aspect ratio. This is what I use, found bits here and there and put it together to this:

ffmpeg -i INPUT.avi -acodec libfaac -ac 2 -vcodec mpeg4 -vf "scale=480:-1" -b 1000k -ab 128k -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 OUTPUT.mp4

I'm using ffmpeg SVN-r25157, Lame 3.98.4 and faac 1.28 on Mac OS X 10.6.4. If you download and compile the standard ffmpeg 0.6, the "-vf "scale=480:-1" bit will not work. So download the latest through cvs.

This is more or less a rip off of the instruction at stephenjungels.com. In the latest svn of ffmpeg, there is no support for faad, so I left that bit out.

This instruction is available "as is". I will not answer any questions about "How do I do this and that?"

Friday, August 20, 2010

If Boot Camp drivers fails to install

Had this problem yesterday with a new iMac (iMac10,1).

I had an old Windows XP SP3 image with all the applications etc I wanted in Windows. I applied the image to a Boot Camp partition, booted Windows without any problems.

Now I wanted to install the Boot Camp drivers from the Snow Leopard DVD, I launched the installation, but it failed immediately with a message saying something like "a problem occurred, please try again later".

The event log said "msiinstaller error code 11708", which gave me nothing.
Then I launched the BootCamp.msi (in /Boot Camp/Drivers/Apple) with "msiexec /i BootCamp.msi /l* c:\bc.log". In the log file I found that a function called GETINTELGRXID failed with exit code 3.
I think this is supposed to get which kind of Intel graphics card it is in the machine, but since it's an Nvidia card in this iMac I thought it didn't matter if that function ran or not.

So next thing to do was editing the msi with Orca and delete all entries that contained "GETINTELGRXID" (I think I found it in two places). When that was done, I just saved the msi and launched it with the command above, and it worked! Now I have an iMac that have a fully working Boot Camp install!

Thursday, June 3, 2010

Task Sequnce to install App-V 4.6 and remove older App-V and Softgrid versions

This is a sequence I created for installing the App-V 4.6 client. At our university we have many different Softgrid/App-V installations, so I had to make this TS with a lot of different conditions for each step. Hope this will help someone :)

The PDF is just an overview of the task sequence, it requires some knowledge and packages to be created already, you must also have the MSIs for all the older versions you want to uninstall (to be able to create conditions).

App-V 4.6 TS.pdf

Provided "as is"...

Reassign Site Code in SCCM client

Found this yesterday... If you want to trigger an automatic site code discovery in the Config Manager client, you can distribute this vbscript as an assigned program:

Set smsclient=CreateObject("Microsoft.SMS.Client") 
smsclient.ReAssignSite()

Simple? Yes :) But it took me a while to find this, so I wanted to share it!