Categories
Computing HowTo Linux

Command to convert folder(s) of .MTS to .mp4 for editing

For this command to run correctly every .MTS file that has been split in multiple .MTS files by the camera (for example where the recording size has exceeded 2.0GB and the camera has automatically split it into mulitple files) these files need to be concatenated back into a single file.

This can be done manually by:

cat secondFile >> firstFile
cat thirdFile >> firstFile

and so on..

If you want a GUI way of doing this you can use this nautilus script I edited from the one found here:

cfn=$1
shift;
for arg
do
cat “$arg” >> “$cfn”
mv “$arg” ~/.local/share/Trash/files/
done

Open your favourite text editor and copy and paste the above code in and save it in the following location

~/.gnome2/nautilus-scripts/Concatenate

You should now be able to right click several .MTS files and select Scripts > Concatenate. The machine will then concatenate the files and move the unessential  .MTS files to your Trash / Waste Basket. You’ll know the concatenation is complete when the last file in the series appears in your waste basket/disappears from it’s original folder.

Before transcoding the .MTS files we need to install some programs to help with the transcoding:

sudo apt-get install ubuntu-restricted-extras x264

With the concatenation complete (if necessary) and everything we need installed, you can now run the following command to transcode the .MTS files into .MP4 files that can be used and editied without sync issues on Ubuntu.

find /location/of/MTS/files -name “*.MTS” -type f -exec ffmpeg -i {} -vcodec libx264 -vpre hq -crf 19 -threads 0 -deinterlace -acodec copy {}.mp4 \;

Categories
Computing HowTo Linux Ubuntu

How to convert .MTS files to .AVI in Ubuntu using ffmpeg

Just a quick post. If you want to bulk convert .MTS files (from JVC or Sony HD camcorders) then you can use the below script:

You’ll need csh and ffmpeg installed:

sudo apt-get install csh ffmpeg

Make a new file called convert (I use joe but you can use nano or whatever you prefer)

joe convert

Copy and paste the below:

#!/bin/csh
# For NTSC change -fps 50 tp -fps 60000/1001 below
foreach f ($*)
ffmpeg -i $f -threads 4 -deinterlace -f avi  -r 25 -vcodec libxvid -vtag XVID  -s 1920×1080  -aspect 16:9 -maxrate 1800k -b 1500k -qmin 3 -qmax 5 -bufsize 4096 -mbd 2 -bf 2 -flags +4mv -trellis -aic -cmp 2 -subcmp 2 -g 300 -acodec libmp3lame -ar 48000 -ab 128k -ac 2 -o ${f:r}.avi
end
Make the file executable:
chmod +x convert
Convert your .MTS files:
./convert *.MTS
Done!
Categories
Computing HowTo Linux Ubuntu

Setting up Munin on Ubuntu 10.04

Server setup (as root):

apt-get install apache2 munin munin-node munin-plugins-extra munin-libvirt-plugins munin-java-plugins

a2dissite default

Edit munin apache config to enable stats to be veiwed from anywhere:

joe /etc/apache2/conf.d/munin

change Allow localhost 127.0.0.1/8 ::1 line to:

allow all

Restart apache2:

/etc/init.d/apache2 restart

Setup hosts we want to monitor in /etc/munin/munin.conf . For each host we need to add a section that’s similar to the following:

[hostname]

address ipaddress

use_node_name yes

Now on each server we defined in the last step (including the munin server itself) we need to ssh into them and setup munin  node:

apt-get install munin-node munin-plugins-extra munin-libvirt-plugins munin-java-plugins

Allow access from the munin server:

joe /etc/munin/munin-node.conf

Add:

allow ^192\.168\.0\.1$

where 192.168.0.1 is the ipaddress of your munin server.

Restart the munin node:

/etc/init.d/munin-node restart

Open up a web browser and navigate to:

addressOfMuninServer/munin

This should present you with a webpage with all your configured nodes. Click on them to get stats/charts about the nodes. NB Munin can take up to 5 minutes to collect stats so if you’ve got nothing coming up wait 5 minutes. If you’ve still got nothing then you’ve probably got a configuration problem.

The Munin install differs on 10.04 Lucid as the install configures it’s own virtual host, which in previous versions of Ubuntu it never use to. The virtual host the Munin install provides is only accessible to the localhost hence the need for the configuration change.

Categories
Computing HowTo Linux Ubuntu Work

Network problems after a Ubuntu 10.04 Lucid Lynx install and what fixed them for me

After installing from a live CD where there was no problem with the network, I was supprised to boot a fresh install of Ubuntu 10.04 lucid lynx, with no network access. Fair enough, I thought probably just a one off, my PC. However after my work mate also had trouble with the network after a fresh install where the network was working on the live cd before hand I decided that something must be afoot.

Anyways this is how I fixed my network problem, hopefully it’ll help someone else!

  1. Edit /etc/network/interfaces and remove all traces of eth0 (remove both lines)
  2. My Network Manager had failed to start at all so to manage the network connections open up System > Preferences > Network Connections
  3. Add a new wired connection. I copied the mac address of my adapter in, although I’m not sure this actually matters. Click Apply and Save your new connection.
  4. Reboot

All being well you should have network-manager running, with a live network connection.

Categories
Computing HowTo Linux

How to set the multiple Nvidia GPUs to auto fan in Ubuntu

Just a quick one. I’ve recently purchased an additional card to go in my Ubuntu machine, but my cards when set up in SLI were running very hot.

Using the information found here I was able to stick one GPU into auto fan mode, however the second GPU would stay at a fixed value and be overheating.

Looking at the man page for nvclock I found that you can use a command line switch to list and control individual  GPUs.

First install nvclock and nvclock-gtk

sudo apt-get install nvclock nvclock-gtk

Secondly open up nvclock-gtk

sudo nvclock_gtk

You may need to set a fan speed under ‘Hardware Monitor’ for each GPU, after you’ve done this use the following commands

nvclock -s

This command gives a list of all the (nvidia) GPUs connected to the system.

nvclock -c 1 -f -F auto

nvclock -c 2 -f -F auto

Repeat the above command for each GPU you want to be put in auto mode. You should now see in nvclock-gtk the fan speeds, under ‘Hardware Monitoring’ adjusting up and down, automatically on there own.

If you want this done automatically at login then you can add the commands (one at a time unfortunately, unless you make a script) to your sessions System > Preferences > Startup Application as shown here

Categories
Computing Musicals Thoroughly Modern Millie

How to convert DSS files to .mp3 with ubuntu linux

I have an Olympus DM-20 which I use to record stuff from my amateur dramatics group, just recently I recorded a script read through of Thoroughly Modern Millie and needed to chop up the read-through by scene. Ubuntu Linux doesn’t support .dss files natively so I needed to convert them. A bit of googling lead me to believe that I’d need to convert it using a program under wine. Below is how I got it all to work, hopefully it will help someone!

Things you will need:

To Install:

  • Install wine from the repositories

sudo apt-get install wine

You should be able to Right Click and Open with Wine Windows Program Loader.

Using the same methodology as above right click and open with Wine Windoes Program Loader.

Install as above. Run the program, add the files, choose your output type and location and hit convert!

Bang, you’re done.

Information sourced from Google and the ubuntu forums I couldn’t initially get Swift working because I didn’t have the C++ libraries installed hence my repost!

Categories
Computing

Virtualisation and Gaming

For those of you that don’t know I use Ubuntu as my main operating system; at home, at work and on my laptop.

I still however have applications, mostly games, that I still have to keep a windows install handy for. At the moment at home I dual boot between windows vista and Ubuntu Intrepid Ibex.

With all the advancement in virtualisation technology recently I thought I’d take a few of them for a spin and see if I could get any decent games to run on them. The ideal situation would have been being able to boot up into Ubuntu double click a shortcut and let the virtual machine present the game without the teletubbie xp background.

My main game of choice at the moment is Oblivion which at the time of writing is a few years old so you might have been excused for thinking that virtual machines would have the technology avaliable to them to either pass the 3D rendering to the host GPU or to at least emulate a 3D device in some way.

It appears in practice we couldn’t be further away.

I tried a windows xp virtual machine with 2GB of memory and 128 MB of video memory and oblivion crashed out with an error. To be fair to VirtualBox its seemless mode was very good apart from one glitch in drawing my background and I was impressed with its seemless mouse interaction between host and guest OS.

I also tried to install Paraelles but the program itself wouldn’t actualy install. This was a shame because for the googling I’ve done paraelles seems to be the solution closest to having 3D acceleration working. I would have also though being a relatively smaller player in the VM market paraelles would want to make sure their solution installs on as many platforms and distributions as possible.

I did find a patch to fix the problem I encountered with paraelles but by the time I had done all that googling I didn’t have it in me to be bothered to patch and recompile. In a tough market like virtualisation products need to just work or people will just move on to another solution that will. Perhaps paraelles should sit up and take note? (according to my googling installing paraelles on ubuntu has always required more than average user knowledge to install so this is nothing new…)

For fairness I also tried installing Oblivion via Wine and Crossover games, neither of which worked.

I guess my days of dual booting will continue for a while to come yet, or until virtualisation solutions provide proper 3D acceleration support or the devs at wine fix the bugs that affect direct x games.