Monday, January 7, 2013

Creating Word Drift Trailler #2: Import and cutting raw video in Kdenlive

This is a post about how I created the video trailer for my word puzzle game, Word Drift.

Continue from Creating Word Drift Trailler #1: Capture Android screen to create a promotional clip

Once I transferred the video clip from my Sony NEX 3 to my PC, it is time to cut it down.  The raw clip is about 25-minute long, and I need to cut it down to about 1 minute to fit the music that I planed to use for this clip (more about music in future post).

Kdenlive is an excellent video editor running on *NIX machines, including Linux, Mac,and FreeBSD.   I'm running it on Fedora.  While official Fedora repository do not have Kdenlive, it is easy enough to install it from rpmfusion.  See the Edenlive download page for details.

Open Kdenlive and it looks like this


Just below the menu and tool bar, there are 3 boxes that are empty now.  The one on the left is where you drag and drop your raw video clip (and still images, sound file, etc) in.  It acts as, say, resource holder so Kdenlive knows what clips, images, etc you want to use in your project.

The one on the right is the preview screen.  It is capable of showing almost real-time rendering of your final video clip so you now what it would look like at the end.  You will need it to synchronize things in your clip.

The middle is the configuration box for the transition or effect that you use in your clip.  For Word Drift trailer, I only use the transition called Composite.  If you see the trailer, there is a little hand moving around.  It is all done by compose the hand over the raw video clip, which I will write about later.

Below, we have the timeline.  This is where you put your raw clip in.  So let's do just that.

First, you need to drag and drop your raw clip to the left box, then drag that clip from that box to the timeline.   It should end up looking like this



Notice the little triangle pointer on top of the timeline (just under the number 00:00:00.00)?  If you move it, the preview screen will be updated to where that pointer is pointing.

The raw clip is way too long and in most part are boring.  To cut it down to 1 minute, I select the cutting tool at the bottom toolbar.


Now slide the pointer to the beginning of the section of clip that you want to cut out, and click it there.  Then slide the pointer to the end of the section, the make another cut.  The clip should now be separated into 3 sections.  Switch back from the cutting tool to selection tool (the one left of cutting tool), the select the section that you just cut.  It should look like this.


Press delete button on your keyboard, that section is gone.  Note that your original raw clip is not affected.  This is how it should look now.


The final step is to remove that gab between remaining section. This is easy, just click and drag the second section to the left.


And that's all.  In my case, I had to scan for interesting bits in my clip the cut the boring part out.  It took some planing, and still I made lots of bad cut, so save often.

By the way, this is also a good time to separate the sound from your clip.  Right click on your clip and select "Split Audio" from the popup menu.  The sound clip will now be in its own track.  Right click the sound clip and select "Ungroup clips" because when you split the sound, Kdenlive will group the video clip and sound clip together.  Once the sound clip is ungrouped, delete the track the sound clip is in.

In the next post, I will write about the composition and how to make the hand moves.

Sunday, January 6, 2013

Creating Word Drift Trailler #1: Capture Android screen to create a promotional clip

To create the video Trailer for Word Drift, I will need to find the way to capture the screen of the android device. It took me a few days to find the most effective way to do so. These are some ideas I had

Running program on Android Emulator and using the screencasting program.
Well, I didn't actually try it. The emulator is too slow. While the real game runs at about 60fps, the emulator at best is at about 10fps.

Running VNC server on Android, control it from the PC, and use screencasting to capture the action.
This might give better performance than using the emulator.  I didn't try it since I have LG phone which comes with the utility program that lets me control the phone from PC.  It serves the same purpose.

Using LG's On Screen Phone and screen casting.
LG OSP let you connect the phone from your PC and export the screen to your PC.  You can use mouse and keyboard to control it.  The screen update rate is about 30fps.

Using HDMI out to video capture card and record it directly.
This would be the best solution.  Too bad I don't have video capture card in my PC :-(

What I did.
I ended up using LG's OSP to control the phone from my PC.  Instead of capture the phone screen using screencasting program on PC, I use my camera (Sony NEX 3) to capture the actual phone.  Because the lighting is not ideal, the captured video looks a bit washed out but it has enough details to be use able.  I used the capture video in my final Trailer


Saturday, January 5, 2013

Word Drift Trailer



This little trailer is made using only open source software in less than a day. I'm the first to say it's not that good, but I think it serves the purpose, that is, to introduce the game and give the idea to viewers how the game plays. The software I used are Gimp, Inkscape, Audacity, and kdenlive. They are running on Fedora.

I think I will write a bit when I have time how use these tools together to make a video clip like this. Don't expect much, this is the first time I edited any video clip in more than 10 years (the last time I did I was in college, using Adobe Premiere). By the way, this is how the whole thing was set up. Just tripod, Sony Nex 3, some afternoon soft light, and a water bucket to keep the tripos still :)

Wednesday, January 2, 2013

AndEngine and "Conversion to Dalvik format failed with error 1"

I am developing a word puzzle game called Word Drift using AndEngine.  While everything went well, I found that when I tried to sign the game (so that I can upload it to Google Play), I got the error "Conversion to Dalvik format failed with error 1"

Google around shown that it is common problem.  Many people solved it simply by clear the project and rebuild it.  Unfortunately all the solutions I found from searching did not solve the problem I had.

What made it very confusing is that when I remove some features off the game (thus reduce the number of lines in the code), I could sign the game without any problem.  Is my game too big?  It can't be. It's only a bit more than 10 thousand lines.

So I tried different settings and finally the problem went away. I don't really understand it but I'm posting what I did here hopefully it is helpful to some of you.

Basically, when I first started playing with AndEngine, I follow the excellent tutorial at raywenderlich.com by Ali Hafizji.  That tutorial asks you to add AndEngine library to your project using the Android-specific configuration dialog box (see picture below, in the Library box).


This is the configuration that worked when my game had fewer lines of code.  It failed to sign with my full game.  What I did to solve it is to remove the reference to AndEngine from my game from this dialog box, and add AndEngine library directly to the 'libs' directory in my game.


After rebuild the code, it signed properly.  I don't really know why it worked though.

By the way, if you are curious what my AndEngine game looks like, it is called Word Drift, a free, fast-pace word puzzle game and you can get it on Google Play (yes, those are bombs.  The only word puzzle game with bombs :)