Archive

Posts Tagged ‘video’

Getting information about your video files

February 16th, 2010 No comments

The other day, I wanted to find out which of the videos in my movie collection were encoded with multitrack (e.g. 5.1) sound.

I found a tool for Linux called themonospot. Happily, it’s packaged with Fedora and can be installed simply by doing

yum install themonospot-console

Once installed it’ll quickly give you information about your video files:

[jonathan@zeus ~]$ themonospot-console /media/public/Movies/Sunshine/Sunshine.avi
File path:               /media/public/Movies/Sunshine/Sunshine.avi
Codec name:              XVID
Codec desc:              xvid
Frame size:              704 x 288
Average video bitrate:   1,423 Kb/Sec
File size:               1,525,886 KB
Total time:              01:47:26.00 seconds
Frame rate:              24.00 frames/sec
Total frames:            154,574
Video data rate:         23 frames/sec
Video quality:           113
Packet Bitstream:        False
ISFT data:               VirtualDubMod 1.5.10.2 (build 2540/release)
JUNK data:               VirtualDubMod build 2540/release
USER data:               XviD0046
Audio 01:                0x2000 (AC3) 448.00 Kb/Sec - 48000 Hz (6 Channels)

As you can see, my copy of Sunshine has 6-channel audio (i.e. 5.1). But what if you want to run a batch job to check all of your films and see which ones have surround sound?

Then use perl.

I wrote an extremely hacky script that takes a path as an argument and whizzes round to fetch the encoding of all .avi or .AVI files in the directory. It prints the names of any that have more than 2 audio channels (i.e. better than stereo).

It sometimes goes wrong if the output of themonospot-console varies, as it occasionally does.

So you get output like this…

[jonathan@zeus ~]$ ./findAudioEncoding.pl /media/public/Movies/
/media/public/Movies/Catch Me If You Can/Catch Me If You Can.avi : 6
/media/public/Movies/National Treasure - Book of Secrets/National Treasure - Book of Secrets.avi : 6
/media/public/Movies/Never Been Kissed/Never Been Kissed.avi : 6
/media/public/Movies/Rescuers, The/Rescuers, The.avi : 5
Argument "" isn't numeric in numeric gt (>) at ./findAudioEncoding.pl line 12.
/media/public/Movies/Brideshead Revisited/Brideshead Revisited.avi : 5
/media/public/Movies/Passion of the Christ, The/Passion of the Christ, The.avi : 6

If you’re interested in the source, here it is. If you find this useful, why not “like” my post? (The at the bottom)

#!/usr/bin/perl -w
# findAudioEncoding.pl

use strict;
my $path = $ARGV[0];
chomp (my @files = `find $path 2> /dev/null | grep -i .avi`);
foreach my $file (@files) {
        chomp (my $channels = `themonospot-console "$file" | grep \"Audio 01\" | awk \' { print \$10 } \'`);
        $channels =~ s/\(//g;
        if ($channels > 2) {
                print "$file : $channels\n";
        }
}
Categories: Guides, Linux Tags: , , , ,

The house of the future

December 23rd, 2009 2 comments

Some years ago, my dad bought me a book about electronics, computers and robots from a jumble sale for 10p. It was published in 1984 and probably about 15 years out of date when I received it.

Today I came across it on my bookshelf back at my parents’ house, and there’s a double-page spread in it called Television and Video in the Year 2000. It has a picture of how a house might look in the millennium year.

Of course, speaking today with a decade’s hindsight, the house looks like something from Thunderbirds, but some of its predictions have indeed come true. Let me reproduce it for you here.

When you are grown up and your children are going to school, this book may not exist. In fact, schools as you know them may not exist either, and libraries with books may be museums. All this will happen because of television and video. Television was invented during the 1920s by John Logie Baird.

Studying by Television

Let’s visit a home of the future, say in the year 2000, and see what everyone is doing. Alice is 12 years old. She is not wasting time watching television; she is at school. That’s her teacher on the screen. She manages to see Alice once a week to check her written work, but not for long. By teaching on television she could have a thousand pupils in her class at once, but she doesn’t have more than a hundred. Alice likes to ‘go to school’ in the living-room where there is a row of flat screens against the wall. She wears headphones to listen to the teacher.

Alice’s brother, Peter, likes to work by himself in his bedroom with a smaller, personal screen. He is 20 years old and, although he lives in Britain, he’s studying with the Massachusetts Institute of Technology in the United States. His microcomputer and screen are linked by telephone to the local library. They are sending Peter a new article written in America. They received it overnight from the United States during the cheaper-rate computer time.

Work and Leisure

Dad has worked at home for the last five years, ever since his supermarket became fully automated. As supply manager for the supermarket, he checks the stock on the shelves every Monday morning visually through the closed-circuit television cameras. On his home screen he can also study the computer totals produced by the automatic check-out tills.

Mum is watching a live television programme. Her favourite daytime programme is the 24-hour European news station which the family receive through their satellite dish receiver on the roof.

Grandad Jones is the only member of the family who uses the video disc. At the moment he’s looking at a dahlia catalogue, and the video disc gives the best picture available on any system.

Granny Jones can hardly walk and spends her time watching the goings-on out in the street through the local closed-circuit camera system. The council originally set up the system to help stop burglaries.

I’ve also photographed the image from the book – apologies for the quality. I might even get round to scanning it one day. Click for a larger version.

A house of the future

A house of the future

So how accurate were the predictions?

Lots of  the things mentioned in the picture are easily possible with today’s technology. But few people do them because they are inconvenient or expensive, or simply a bad idea.

It would be easy to set up a videoconferencing system to allow pupils like Alice to have school lessons at home – but nobody would do it because it misses out on an awful lot of face-to-face contact. Peter’s use of technology to get hold of documents is more realistic.

Likewise the father working from home – it’s possible to install cameras around Tesco and have the stock manager working from home, but it’s useless and expensive.

As for the mother watching 24-hour live news and the grandad watching what’s essentially a DVD – spot on. But how bored must the granny be to sit there watching CCTV in her own street?

It seems to me the biggest omission of this futuristic house is the use of computers and the Internet – although lots of the video systems in use seem to do computer-like tasks. Each person in the house is using specialist equipment for each task, and each piece of equipment has its own source of external connectivity.

The beauty of modern computers is that they can do a wide variety of tasks, and that the Internet can be used to carry any sort of data, whether it’s a text document or a video stream.

The most saddening thing about that house is that nobody is talking to anyone else, and nobody has any reason to go outside. I hope that doesn’t come true!

Categories: Gadgets, Science Tags: , ,

DV editing on Fedora

August 15th, 2009 No comments

Recently, a friend asked me if I could copy her home videos from a miniDV tape onto a DVD. I said sure, OK, and if she lent me her camcorder I’d be able to get it done.

I’ve never actually used miniDV before, and I’ve only ever tried to process video on Linux a handful of times – and it’s usually been a disaster. Fedora seems to be a rock-steady platform for many tasks, although I would say it can be a bit lacking in high-quality media tools. I decided to give it a go on Fedora, but I was also prepared to fail over to Windows Movie Maker if necessary. Yuck.

So I searched the Fedora repos for the term DV, and came across a tool called Kino.

Kino is a non-linear DV editor for GNU/Linux. It features excellent integration with IEEE-1394 for capture, VTR control, and recording back to the camera. It captures video to disk in Raw DV and AVI format, in both type-1 DV and type-2 DV (separate audio stream) encodings.

Great – sounds like it will do the job. I plugged in the camcorder (a Sharp VL-NZ50) and fired up Kino. It immediately recognised the camera, no intervention necessary. Kino has full control of the tape – I was able to start, stop, rewind, and fast-forward the video. There was a single button to capture the entire tape to disk.

I found it made a new file for each time recording had been restarted on the camcorder. This might be ideal if you wanted to later burn a DVD with scene selection, but I wanted to create a single video.

After capture was complete, approximately one hour of video took up just over 12 GB – luckily I have crazy disks in my PC!

Kino also has features to export video in various formats. I simply exported as a single DV file (no re-encoding required).

Then I used DeVeDe to wrap the raw video file in a nice DVD format with a basic menu, and create an ISO image that I could simply burn to DVD.

I was very pleasantly surprised at how easy it was to get great results copying a miniDV tape to a DVD using Fedora.

Categories: Gadgets, Linux Tags: , , , , ,