return to I Love My Journal
A Little Closer to Center...
Musings about Life, Linux, and Latter-day Saints.
Pages
About Me
Links


Tags
PERSONAL 520
SPIRITUAL 416
LDS 312
BOOK OF MORMON 237
SCRIPTURES 154
STUDIO-JOURNEY 129
RELIGION 112
LINUX 79
COMPUTERS 65
LIFE 60
GENERAL CONFERENCE 46
GENTOO 39
MISCELLANEOUS 37
MUSIC 37
PROGRAMMING 33
CARS 29
MICROSOFT 23
FAMILY 23
AUDIO 21
I LOVE MY JOURNAL 18
FUN 15
CHILDREN 12
CURRENT EVENTS 10
NATURE'S WAY 10
VIDEO 9
DRM 9
CONEXM 7
BABBLINGS 7
PROVO CITY CENTER TEMPLE 6
FRIENDS 6
HEROD THE FINK 5
GAMES 5
COMPUTER HARDWARE 5
DRUMS 4
HAND OF GOD 3
ADVERSITY 3
KDENLIVE 3
AUDIO HARDWARE 3
GENERAL INSANITY 3
STUDIO 3
THANKS4GIVING 2
CATS 2
MY JOURNAL 1
POETRY 1
FOREVERGREEN 1
EVERYDAY THOUGHTS 1
GOSPEL 1
PARENTING 1
YOUTH CONFERENCE 1
CHURCH NOTES 1
POLITICS 1


RSS Feed

RSS FeedSubscribe!
Mon - Jun 09, 2008 : 10:33 am
tired
   rated 2 times
>>next>>
<<previous<<
Video Editing With Kdenlive
I've recently become interested in integrating video into my journal and blog.  As such, I realized that my 4-year old digial camera just wasn't gonna cut it anymore, so I went out and bought the cheapest camera I could find that would shoot 30 frames per second which happened to be the Nikon S210 digital camera.  It takes pretty good video.

Then, I began the search for any video editing software on Linux.  I had created a video using Kdenlive a couple of years back, but I remembered it being a pain to use.

Long story short, after using about 6 other obscure video editing software programs for Linux, I came right back to Kdenlive.

To begin, the most valuable piece of advice I can give you at this time about using Kdenlive is this:

SAVE YOUR WORK EVERY 10 SECONDS.

Then you'll enjoy working with it much, much more.  Kdenlive will randomly crash, losing all unsaved work.  The crashes happen from 15 seconds, to 2 hours - man, it SUCKS losing 2 hours of work, so, save your work often.  If it does crash after a save, the saved portion of my work always came back without a problem.

Besides the totally random crashes (I worked on Kdenlive straight for 3.5 hours with no crashes, once), the biggest gripe I have about this program is the total inability to configure or manually modify the video format for the project.  You are limited to what the developers think you need.

For me, this creates a bit of a frustration because my camera shoots at exactly 30 FPS, not 29.976.  Well, there's no option for me to open a project where the video will work at 30 FPS, which makes me have to re-encode all my raw footage to 29.97, in order for the A/V sync to stay spot-on.

But the first item of business is to let you know how to start the program itself.  If you just type in "kdenlive" in a terminal, or click on it on some GUI menu somewhere, the MLT framework (upon which kdenlive is built) will default to PAL standards, which for people here in the good ol' USA, is no good at all.  Use the following command to begin the program, and it'll save you loads of headaches:

MLT_NORMALISATION=NTSC kdenlive

That'll help a lot.

the next necessity for good video editing with Kdenlive is to have footage which fits one of the pre-configured settings in the project.  If you don't, your video will look fine, but the A/V sync will drift, making the footage useless, and causing you to rip your hair out.

For me, since my footage is all at 30 FPS, I run the footage through ffmpeg to get it to 29.97, and then it works wonderfully.  Here's the command I use:

ffmpeg -i input_filename.avi  -b 10667.6k -r 29.97 -ar 22050 output_filename.avi

That should do the trick (at least for video recorded at 30FPS at 640x480).

After all my footage has been massaged to fit the requirements of Kdenlive, I then start the project and make sure the project video format is Square NTSC, which fits the precise resolution, and FPS of my footage.  I do this by clicking on Project->Configure Project, and then this box pops up:



From there, it's smooth sailin'.  You just edit your video like you normally do, remembering to save every 10-20 seconds.

When you're ready to export your masterpiece, you've got about 2000% more options than you do importing your footage.  This is good, and bad, as I've found half of them to completely mess up the exported video.

What I have found to work is the following:

I export the video by clicking on File->Export Timeline and then an export box pops up.  From there, I choose the "Medium" tab, and then mpeg4->640x480->High.  It looks something like this:



From there, I export my video (my last one was a 12-minute video and it took about 4.5 minutes to export).

After the export, I run it through ffmpeg once again to convert it to the correct resolution to fit in my flowplayer flash video player widget I use for this site, and then I'm done!

Here's the final ffmpeg command:

ffmpeg -i input_filename.avi -f flv -b 700k -ar 22050 -s 450x338 output_filename.flv.

And that, my friends, seems to work for me quite consistently.

Hope it helped.
Comment by sam on Jun. 19, 2008 @ 08:51 am
omfg... thanks. The thing drove me nuts with stupid audio lagging/syncing problems, often jumps in audio/video that didn't make sense, along with crazyness being shuttled to the export. this saved me.
Comment by Mesqueeb on Dec. 19, 2008 @ 08:34 pm
At the end of the command lines after hitting enter with the correct code you game me it says:

Unsupported codec for output stream #0.0

And the new video is 0 bytes and can't be played... What shall I do? Is there another way to make videos from 30fps to 29.... ?

Thanks!

-Mesqueeb
Comment by PoeticIntensity on Dec. 20, 2008 @ 03:50 pm
That just means that you have to compile support for the mpeg-4 codec into ffmpeg.  Google will tell you how to do that.