Paul’s Linux Blog

Just Another Uber-Geek

Browsing Posts tagged convert

Thanks to this great little script you no longer need to work out which program to use to uncompress multiple file archive formats.
Add this script to your .bashrc file and use as follows:
extract file.zip

 
extract () {
if [ -f $1 ] ; then
case $1 in
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>.bz2)   <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvjf $1    ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>.gz)    <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvzf $1    ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>.xz)    <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvJf $1    ;;
*.bz2)       bunzip2 $1     ;;
*.rar)       unrar x $1     ;;
*.gz)        gunzip $1      ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>)       <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvf $1     ;;
*.tbz2)      <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvjf $1    ;;
*.tgz)       <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvzf $1    ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">zip</span>)       unzip $1       ;;
*.Z)         uncompress $1  ;;
*.7z)        7z x $1        ;;
*.xz)        unxz $1        ;;
*.exe)       cabextract $1  ;;
*)           echo "\`$1': unrecognized file compression" ;;
esac
else
echo "\`$1' is not a valid file"
fi

At last I managed to get handbrake-gui on my pc big woohoo.

Not that excited hmm maybe not but I have tried many times to install handbrake, the only success I have had was on windows :( I have managed to get the Linux CLI version installed but could not get the out of my files quite right. The gui version I thought would be a simple install however I kept running into dependency issues.

Finally I did it, and worst of all it was far easier than expected.

First ensure you have subversion installed and configured as follows.

  • sudo apt-get install subversion

Now setup subversion

  • sudo svnadmin create /svn

Now to sort the dependencies.

  • sudo apt-get install  yasm build-essential autoconf libtool zlib1g-dev libbz2-dev intltool libglib2.0-dev libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev libwebkit-dev libnotify-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

To begin the install you will need to fetch the latest build of handbrake as follows:

  • svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk

Once the handbrake source code has downloaded change into the src directory.

  • cd hb-trunk

To configure and install handbrake in one easy go use the following command.

  • ./configure --launch

Once the build has completed you should be able to launch the gui as follows.

  • cd build/gtk/src
  • ./ghb &

NOTE: You are able to copy the ghb binary file to anywhere on your system.

I would recommend moving it to the local bin dir, then you should be able to launch it from a terminal screen by typing handbrake-gui &

  • mv ghb /usr/local/bin/handbrake-gui

If all was good you can delete the installation directory.

  • rm -rf hb-trunk

NOTES: I have run through these instructions on crunchbang / ubuntu 8.04 & 8.10 with no problems.

Today was one of those days when I had to fall back to windows :(

I wanted to backup my DVD to avi for the PS3 and found my unusual method of using dd to dump the DVD to an iso file failed. I kept getting the message error reading disc.

I tried my other method of using vobcopy but this failed as well with errors.

My next try was DVD-Shrink via wine this method has worked on occasion but only on old discs, this time the app hung.

My last resort was booting into windows and using DVDFab, I could have installed it via wine but after spending so long trying I just wanted it done, so I could get on with other things.

Anyway windows came through and the image can now be converted into a ps3 compatible format.

In case you wonder why I do it the long way, I just don't like having my DVD drive spinning for several hours when I am converting video, especially if I do higher resolution backup.

Well it's almost done and I have probably saved another disc from the sticky hands of my kids.

Right now I need to convert some flv's to avi so I can watch them on my ps3.

Once again a little googling and 5 minutes later I have the method. Once again I find that mencoder comes to the rescue.

 mencoder -oac copy -ovc lavc -o output_name.avi input_name.flv

I love mencoder it probably one of my most used commands these days. I travel to work on the train every day and it's an hour each way. I find that wathcing a DVD is ok but it drains the battery on the laptop and also generates heat not to mention I don't like carrying my DVD around in my drive all day.

The solution is MENCODER. more on this to follow.

Powered by WordPress Web Design by SRS Solutions © 2010 Paul’s Linux Blog Design by SRS Solutions