Saturday, January 23, 2010

Getting Started with Kdenlive in Ubuntu

I recently got a JVC MS120 digital camcorder. I tried for a while to get something to work for me in Ubuntu as far as video capture and editing was concerned, but couldn't figure it out. I decided to go ahead and give the software that came packaged with the camera a whirl - FAIL. It is awful. It requires that iTunes be installed, and I dislike iTunes, so that's one strike against it. Whenever I add video content to the application it doesn't show up until I restart the application. It serves about the same purpose as Windows explorer - shows you your videos. LAME.

So I went back to Linux. After two days of poking and prodding around, I finally have a solution that works VERY well. Note that I have an Acer 5920 running Ubuntu 9.10, and the solution I have found here works for my purposes. If you follow these steps and it doesn't work for you, then your PC probably hates Linux.

#1: Get your codecs
This url is a trouble-shooting page from the kdenlive website (which we will be using, but there are specific installation instructions for that, so keep reading). Basically if you run the following apt-get instructions you'll have all of the codecs you need:
sudo apt-get install libavcodec-unstripped-52 libavdevice-unstripped-52 libavfilter-unstripped-0 libavformat-unstripped-52 libavutil-unstripped-49 libpostproc-unstripped-51 libswscale-unstripped-0

#2: Get kdenlive
I found these instructions here but have summarized them below.
Go to System > Administration > Software Sources, click on the "Other Software" tab, then click "Add", then insert the following line:
ppa:sunab/ppa

Yes, that is correct. Confirm the repository reload then run the following from the command line:
sudo apt-get update
sudo apt-get install kdenlive

#3: The Project Monitor in kdenlive on my system works as far as video is concerned, but the sound is horribly choppy and just bad. I found out how to fix this from this video. To fix this, get the following library:
sudo apt-get install libsdl1.2debian-pulseaudio

Once this is installed, open kdenlive, go to Settings > Configure Kdenlive, go to Playback, and select "PulseAudio" for the audio driver.

Now you should have the latest version of kdenlive, the codecs necessary to encode to virtually any format, and a project monitor that looks AND sounds good. All you need to do now is get crackin'.

[EDIT] - one more thing - I have to adjust the pixel aspect ratio to 1.19 for all of the videos I import - the software doesn't import the JVC MOD files quite right, but once you adjust the pixel aspect ratio it's fine. To do this, right-click on a clip you have imported, select Clip Properties, then go to Advanced, and plug in the number. I'm also going to try this Slideshow Creator out, it would be good to integrate it into some videos.

[EDIT 2] - just discovered "OpenShot Video Editor", it is Gtk native as opposed to KDE as Kdenlive is. I tried to get it and run it but some sort of Python errors prevented it from running. After some tweaking I finally got it to run. After a few minutes of poking and prodding around, I quickly determined that this would not give me the flexibility I need that Kdenlive offers. So I'm sticking with Kdenlive.

Sunday, January 17, 2010

Scanner Sharing over Network CAN Work in Ubuntu 9.10!

Can't sleep so I thought I'd share today's Linux-wrangling experience.

I have a Xubuntu 9.10 system designated as my file/print/everything else server. It has an HP All-In-One Deskjet F4135 printer/scanner combo attached to it. I wanted to be able to acquire images from my scanner directly to Gimp (image editing application) on my laptop from the comfort of my couch without having to bother with remote desktop connections, file transfers, etc., so I decided to share my scanner over the network. I had done this a few years back via xinetd, but after reading this link I was under the impression that they had greatly simplified the process of setting up a scanner as a network resource.

I followed the directions, then went to test my newly network-enabled scanner, but got nothing. I poked and prodded and checked help forums for a while, but got nothing. I even tried the old method of setting up a network scanner (via xinetd) but still nothing. Eventually I came across a suggestion on the sane FAQ page to run the sane daemon in debug mode by adding the "-d" flag. I ran it with the saned user, but still got nothing. I decided to try running as root and I was able to connect! After a little more poking around I found where my USB port was located in the file system - /dev/bus/usb/001 and saw that its owner was root but group was "lp". This is why I was able to share my scanner as root but not as saned - saned is neither root nor is it in the lp group, so it didn't have access to the scanner. I added the saned user to the lp group, restarted the saned daemon (under the saned user) then bam, network scanner access.

All this to say, scanner sharing over your LAN is as easy as the Ubuntu guide would lead you to believe, you just need to run the following command:
sudo adduser saned lp
...and you should be good to go. Just remember to restart the server daemon:
sudo /etc/init.d/saned restart

I found a bug report a few minutes ago indicating this has been a bug since Ubuntu 8.04. You can read there for more information. If I had read it earlier it would have saved me a lot of headache, but I wouldn't have had the satisfaction of figuring it out myself :)