A couple of weeks ago, I shot a lot of short video clips with my
digital camera at an indoor fun fly (in the intervals when I wasn't
crashing around with the other crazy pilots).
But then ... what to do with a bunch of disconnected video clips?
I've uploaded short clips to youtube before, but never extracted the
good parts and edited them together. And most video editing programs
look pretty complex.
The answer turned out to be kdenlive, which was surprisingly easy to
use -- once I got past one initial bug. So I wrote up the details.
Part I, covering the basics of how to get started and combine clips,
is on Linux Planet:
Movies in Linux with Kdenlive.
Watch for part II in a couple of weeks, where I'll cover transition
effects, music and titles.
[ 18:25 May 13, 2010
More writing |
permalink to this entry
(and how to convert MPEG video to animated GIF)
I gave an Ignite
this week at Ignite Silicon Valley
It was a great event! Lots of entertaining talks about all sorts of topics.
I'd always wanted to do an Ignite speech.
I always suspected the kicker would be format:
O'Reilly's guidelines specified PowerPoint format.
Of course, as a Linux user, my only option for creating PowerPoint
slides is OpenOffice. Historically, OpenOffice and I haven't gotten
along very well, and this slide show was no exception. Happily,
Ignite needs only 20 slides ... how hard can that be, right?
Most of my slides were very simple (a few words, or one picture),
with one exception: I had one simulation I wanted to show as a
video. (When I give this presentation on my own machine, I run
the simulation live, but that's not an option on someone else's machine.
First I wrestled with Open Office to create the non-animated slides.
It was harder than I'd expected.
I just loved having to go back and un-capitalize words that
OO kept helpfully re-capitalizing for me.
And the way it wouldn't let me change text format on any word that
triggered the spellchecker, because it needed to show me the spellcheck
context menu instead. And the guessing game clicking around trying to
find a place where OO would let me drag to move the text to somewhere
where it was approximately centered.
And when I finally thought I had everything, I saved as .ppt, re-loaded
and discovered that it had lost all my formatting, so instead of yellow
96 point centered text I had white 14-point left-aligned, and I had to
go in and select the text on each slide and change three or
four properties on each one.
And I couldn't use it for an actual presentation.
In slideshow mode, it only showed the first slide about one time out
of six. The other times, it showed a blank slide for the first 15
seconds before auto-advancing to the second one.
The auto-advance timing was off anyway (see below).
Fortunately, I didn't need use OpenOffice for this presentation;
I only needed it to create the PPT file.
I ended up making a separate version of the slides in HTML to practice with.
Inserting a movie
But I did eventually have all my static slides ready.
It was time to insert my movie, which I had converted to MPEG1
on the theory that it works everywhere. With the mpeg added,
I saved one copy to OpenOffice's native format of .odp,
plus the .ppt copy I would need for the actual presentation.
Then I quit and opened the .ppt -- and the video slide was blank.
A bit of searching revealed that this was a long-known issue,
but there seems to be no interest in fixing it.
So I was out of luck if I wanted to attach an MPEG,
unless I could find someone with a real copy of PowerPoint.
Plan B: Animated GIF
Next idea: convert my 15-second video to an animated GIF.
But how to do that? Google found me quite a few web pages that claimed
to give the recipe, but they all led to the same error message:
ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24.
So what? Just add
-pix_fmt rgb24 to the commandline,
right? But the trick turns out to be where to add it, since
ffmpeg turns out to be highly picky about its argument order.
Here's the working formula to convert a movie to animated GIF:
$ ffmpeg -i foo.mpeg -pix_fmt rgb24 foo.gif
This produced a huge file, though, and it didn't really need to be
1024x768, so I scaled it down with ImageMagick:
convert -depth 8 -scale 800x600 flock-mpeg.gif flock-mpeg-800.gif
which brought the file size from 278M down to a much more reasonable
Happily, OpenOffice does seem to be able to import and save animated
GIFs, even to .ppt format. It has trouble displaying them -- that's
-- so you wouldn't want to use this format for a presentation you were
actually going to give in OpenOffice. But as I mentioned, OpenOffice
was already out for that.
If you do this, make sure all your static slides are finished first.
Once I loaded the animated GIF,
OpenOffice slowed to a crawl and it was hard to do anything at all.
Moving text on a slide turned into an ordeal of "hover the mouse where
you think a move cursor might show up, and wait 45 seconds ... cursor
change? No? Okay, move a few pixels and wait again." Nothing happened
in real time. A single mouse click wouldn't register for 30 seconds or
more. And this was on my fast dual-core desktop with 4G RAM;
I don't even want to think what it would be like on my laptop.
I don't know if OOo is running the animations continuously, or what --
but be sure you have everything else finished before you load any animations.
The moment of truth
I never found out whether my presentation worked in real Microsoft Powerpoint.
As it turned out, at the real event, the display machine was a Mac
running Keynote. Keynote was able to import the .ppt from OpenOffice,
and to display the animation. Whew!
One curiosity about the display: the 15 seconds per slide auto-advance
failed on the animated slide. The slide showed for 30 seconds rather
than 15. I had written this off as another OpenOffice bug, so I wasn't
prepared when Keynote did the same thing in the live presentation,
and I had to extemporize for 15 seconds.
My theory, thinking about it afterward, is that the presentation
programs don't start the counter until the animation has finished
playing. So for an Ignite presentation, you might need to set the
animation to play for exactly 15 seconds, then set that slide to
advance after 0 seconds. If that's even possible.
Or just use HTML. The great irony of this whole story is that some of
the other presenters used their own laptops, so I probably could have
used my HTML version (which had none of these problems) had I asked.
I will definitely remember that for the next Ignite!
Meanwhile, I suppose it's good for me to try OO Impress every few
years and remind myself why I avoid it the rest of the time.
[ 15:36 Mar 05, 2010
More speaking |
permalink to this entry
Apress asked me to make some short screencast videos illustrating
GIMP tips, to help advertise the second edition of
I've never made videos (except for putting a digital camera in
video mode) so it's been an interesting learning experience, and
I was surprised at how easy it was in the end.
My Apress contact suggested XVidCap and Wink as possible options.
XVidCap looked quite interesting but didn't seem to work in its Ubuntu
incarnation. Wink worked very nicely and produced flash videos that
worked in a browser with no extra fiddling ... but unfortunately
when I tried plugging in a microphone, Wink didn't seem able to read it.
And it seemed to slow down all my cursor movements, rather than
following my actions in real-time.
But while working with those two, I stumbled across recordmydesktop.
It records mouse movements in real-time and it handles the microphone too.
It has several front ends available (such as gtk-recordmydesktop) but
I found the basic command-line version easiest to use.
To make a video in the upper left 1024x768 section of my screen:
recordmydesktop -width 1024 -height 768 -o layermask.ogv
Since I need to make sure all the action happens within that
rectangle, I made a special desktop background that has a nice, not
too distracting image in just that 1024x768 rectangle.
Any other windows I'm using in that desktop
(such the terminal window I'm using to control recordmydesktop)
stay outside that area.
recordmydesktop starts recording right away. I run through my tutorial
steps, narrating as I go, and when I'm done, I move the mouse back to
the terminal window where I started the recording and hit Ctrl-C, and
recordmydesktop stops recording and encodes the video (which takes a while).
It saves to ogg format, .ogv. Of course, most web surfers can't view
that, and youtube doesn't accept it either (at least, ogg isn't on its
list of allowed formats) so I needed to translate it into something
else. Youtube suggests mpeg4, so that's what I used. Luckily, I already had
a mencoder incantation that some helpful person gave me a long time ago:
mencoder movie.ogv -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vqmin=2:vlelim=-4:vcelim=9:lumi_mask=0.05:dark_mask=0.01:vhq -o movie.mp4
Only one problem: the audio came out very faint and difficult to hear.
I'm sure that's a problem with the microphone I'm using, a cheap OEM
model that came with some computer or other many years ago -- it's
been sitting in a box since I normally have no use for a microphone.
But it turns out mencoder can amplify the volume, with -af volume=X
where X is decibels. A little experimentation with mplayer -af volume=X
on the original ogg suggested a value around 15 or 20, so the final
mencoder movie.ogv -af volume=19 -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vqmin=2:vlelim=-4:vcelim=9:lumi_mask=0.05:dark_mask=0.01:vhq -o movie.mp4
But Apress tells me that their Windows boxen had trouble with the mp4
and they had to run it through something called "Handbrake", so maybe
some other format would have worked better. Here are two other mencoder
incantations I know (without the sound amplification):
mencoder movie.ogv -oac pcm -ovc lavc -o movie.divx (divx -- Windows sometimes has trouble with this too)
mencoder movie.ogv -oac pcm -ovc lavc -lavcopts vcodec=mpeg1video -o movie.mpeg (mpeg1)
It's not great cinema, but the end result is up on the Apress page for the
[ 10:14 May 12, 2009
More linux |
permalink to this entry
Something to do while sick, when I couldn't stand lying in bed
reading any more ...
A few of us got to talking about video formats and our confusion
about which formats were which, which ones were open, and so forth.
I've never found a web document that really explains that clearly,
but since I wasn't up to going anywhere or doing anything hard,
I spent some quality time with google and wrote up my findings:
It's still very rough, but at least it tries to make clear what's
a codec vs. what's a container, and how to identify the container
and codec used in a particular file. And it's a good place to store
a few references that I found useful.
[ 22:05 Dec 07, 2004
More linux |
permalink to this entry