UPDATED OCT 2014
Taking still images from MTS
Converting MTS movie files into films
Editing films with Kdenlive
Rendering projects to different movie formats
I use Kdenlive as my dedicated video editor and encoder for all my projects. (Install notes on Xfce step2 page)
I'm currently shooting films with a Panasonic V500 which has pretty reasonable quality and colour, and produces progressive HD video saved as .MTS files. You can Google what MTS is, it's something like h264 mp4 AVC compressed video, HD being 1920 x 1080 pixels, interlaced 25fps (1080i), while full HD is progressive 50fps (1080p).
Firstly, compressed HD video files take a lot of cpu power to play or seek through with an editor programme, so unless you have 2nd/3rd generation Intel i5 or similar, you will experience staggered playback or pauses while trying to stop and play in Kdenlive (as my Intel core duo gave me). [Kdenlive has an auto proxy clip maker for large HD files, so once those have been made - time for a coffee or two if you have a low-spec CPU - playing and cutting is much smoother, but with on-screen quality loss of course from the proxies.]
I locate my STREAM dir on the camera's SD card (inserted) and copy all the MTS files to a raw files disk. Then I work by last modified time-date (with a quick play to check) to move files into different directories according to place or day or activity.
You could also use bash to sort the files into folders, by date
for i in *.MTS; do DAT=$(date -r $i +%y-%m-%d); mkdir -p $DAT; mv $i $DAT ; done
Taking still images from MTS
I use Gnome-mplayer to get quality stills from my film -it's also possible to take shots of the film on the camera itself, though I haven't taken to this method.
Player tab: video output = gl or x11 (I don't notice the difference)
Mplayer tab: check Deinterlace + Drop frames
Interface tab: check Only allow one instance + when opening.. replace existing file + When opening file, bring main window to front + Remember Window Location and Size (but will go off screen when opening a large MTS file) + Pause playback on mouse click.
In wheezy gnome-mplayer doesn't resize with each new file loaded. Also setting the half-size video play makes snapshots get blacked out on the lower half. So on the first large HD file played, ALT-F8 (Xfce) and resize the window, or check Half Size (1:2) under View.
1. browse to the MTS files and click one to play the mts file with Gnome MPlayer
the first pause might need a mouse click to do it
2. space to pause/play CTRL-T [I change that to CTRL-Z] to capture still frame (and press space again to un-pause and get the snapshot saved!)
open the next file in the dir list
seeking with the left/right keys move about 10sec on/back so might end the film if its short
*bad clips can be deleted at this stage!
3. pics saved in same dir as video files as 6MB .png files,
move them to ".../NEW/abc" on your picture storage partition/disk (that's just my way)
-----do 3. after each folder of mts files
4. rename pics in each dir in the /abc dir and run a mogrify command to convert to jpeg format (see my image processing page)
5. once the files are converted, run a couple of commands on them to write the EXIF date to them
first, to write the date from the file modify date with"
exiftool -overwrite_original "-filemodifydate>alldates"
and then to adjust the date so that it better matches the real date of the video it came from, e.g.
jhead -ds2014:10:09 *
that will set the date on all files, leaving the time stamp as-is
Although it's possible to edit MTS files (though they don't like seeking) and directly render to a finished format with Kdenlive (mpeg2, mp4, h264, webm, vob etc), my rendered movies have been showing pauses at the points where clips join. Even with ffmpeg and melt built from latest snapshots.
I think there's something happening with Kdenlive's MLT in dealing with the compressed MTS files, because the clips are good with no frozen frames if i join them after converting them to mpeg2 or m2ts.
It's like, Kdenlive says, "Oh, the end of a clip, what do we do now? Oh, the next clip, let's start it.." And with that behaviour, there will be frozen frames at the end of nearly every clip. There is a solution though - and at first I tried transcoding to raw formats (see my sub-page transcoding MTS) but results were not perfect either and it ate up hours of CPU intensive work. We simply have to turn on "Overwrite mode" in kdenlive and move the next clip up so that it overlaps the end of the clip before it. That way MLT will not get to see the end of the clip, but the next one will be starting already!!
Editing films with Kdenlive
For detailed install instruction see my install Step 2 page. I highly recommend doing long video productions/encodes on a desktop PC with a modern multi-core CPU (3rd gen i5 preferably) and plenty of RAM (>8gb), as laptops are just not built for it).
There's a graphic Manual here! http://userbase.kde.org/Kdenlive/Manual
1. Add clips to the Project Tree
Click on the black film icon just above the clip tree to open video files from a folder
The clips may take some time to load and you can only use them once they've all appeared as thumbs, and the last clip appears in the Clip monitor.
The cpu will slow down once they're loaded.
When the files open the profile should be set to what files you are using e.g. HD 1080p 50fps 16/9 -this can be set as default also in Settings >Configure Kdenlive >Project Defaults.
Also set the default kdenlive project folder >Configure Kdenlive >Environment >Default folders tab.
You should set videos of over 1000px to have proxy clips made, so that seeking through them in the Timeline will be much smoother than trying to seek huge, compressed and cpu-intensive movie files. (Configure Kdenlive > Project Defaults)
When using proxy clips you will have to leave the PC to build all the clips when you add them to the Project before you can get on with the video editing.
In the Project Tree you can make folders and drag and drop clips into them, or select a folder and click on the add clips button to add new clips into the folder. This is indispensible for a project made of many clips from all sorts of directories on disk -otherwise you'd have them all mixed up, ordered just by file names.
You can close some of the Kdenlive components so that its less cluttered, under View (you just need Clip tree, Clip monitor and Project monitor, and Effects stack if you add effects and have to adjust them)
You want to make some short-cut keys to help speed up the work: Settings >Configure shortcuts
2. Adding clips to the Timeline
Select the needed clips (or click in the clip tree and CTRL-A) and drag down to the time-line, they will snap to the start as you move them close.
-also you can press Q to show the whole length of the clips in Timeline, without them going off the end.
at this moment it is good to click the save icon (CTRL-S) and give the project a name.
now click on the Project Monitor tab (the marker will be set to the start of the project) and the project will start playing, pause with Space (or press L to fast forward).
Select a clip in the Project Tree and play it in the Clip Monitor (check it under View menu)
Play/pause with Space , or by clicking on the Monitor, and then set in and out points with buttons or I and O
Click on the Clip Monitor and drag it down to the Timeline and the selected part of the clip (within the in/out points) will be added to the Timeline, wherever you like.
3. Using sub-clips
Similarly as above, play a clip in the clip monitor and set in/out points, then click and drag from the Clip Monitor to the Project Tree -the clip segment will be listed under its parent clip (with time of segment start).
Thus the segment of the clip (between in/out points) becomes a sub-clip in the Project Tree (much like a bookmarked part of a clip) ready for use on the Timeline.
Select the parent clip in the Project Tree to make more sub-clips
Select a sub-clip, adjust the in/out points in the Clip Monitor and the sub-clip will be updated.
4. Cutting clips on the Timeline
when you hit a part of the clip that's unneeded, pause with Space, find the exact place to make a cut by moving backwards/forwards by one second ( Shift-left or Shift-right ) or by one frame ( C or V or left/right key)
then click on the clip in Timeline to highlight it and use Shift-X to cut at the seek point or press X for the razor/sissor tool and click on the clip at the seek point (not accurate).
Press V to move on repeatedly or hold down (if the film moves) or press S and click on timeline to find the next cut place, zoom out with Z if necessary
Use Shift-X again or the scissors at the end of the part to remove.
Press S and click on the part to remove to select it.
Press D to remove it.
Right click in the empty space and press R to close the gap (or you can leave the gaps and close them later)
! Caution! If you close a gap and you have clips on multiple Video/audio tracks then only one track moves along, disrupting the alignment. Therefore it is better to use the Spacer tool with M in that case and drag the whole proceeding part of the project up.
However, if you need only to cut a piece out of a clip, it will not help if you reset the start or end of the clip, you will need the razor tool or Shift-X on seek point at the start and end of the piece to remove.
Keep saving the project as you go along -just in case there's a crash!
Note about frozen frames after joining MTS clips
The only way to get around this problem (unless its fixed in a new build of MLT) is to overlap the end of the clip with the following one.
So to do this, turn on "Overwrite mode" and just move up the clip to right so that it overlaps the end of the clip to its left.
But to do this while editing, just click the point at which normally you'd cut the clip (to remove the end) and then overlap the clip to the seek line.
If you've already made edits, cutting clips, then you need to
The spacer tool M is used to move all the clips up along the track and make some space to insert a clip.
You can select multiple clips in the time-line by right-click and Group clips (or CTRL-G), then CTRL-click on clips.
Release CTRL to move them all together.
But if you want to move them to another part on the time line you'll have to move them onto the second row and then along.
if on occasion Kdenlive deals badly with a certain clip and it appears frozen when you play it in the time-line, it's most likely that the camera did something to it, a write error.
Say you've been working on a few clips on the Timeline and you'd like to use that edit in another Project... you can't drag the in/out zone to the Project Tree, unfortunately, so you have to save that and import the saved project as a clip to the Project Tree in the new Project.
But if you have been using proxy clips in the project you want to import, very strangely the new project will put the proxy files into the rendered film! So you need to turn off proxy clips (select all and right click > Proxy Clip) and save the project before importing it to another project :(
5. Adding Sub-titles
to add sub-titles you need to make a Title clip, with transparent back-ground. Move the clip which the Title clip will coincide with down onto video track 2, drag the Title clip from the Project Tree on to Track 1 and resize it to the right duration.
there is a huge amount of effects available.
if adjusting brightness (RMB on clip in the timeline >Add Effect >Colour Correction)
stretch the Effects Stack so you can adjust the value manually
-increase brightness: you need to increase the contrast also (RMB on clip in the timeline >Add Effect >Colour) and perhaps saturation a very little
-increase brightness from 500 to 700 and contrast from 250 to 350 for example and adjust further until the right colour is obtained
-if reducing brightness there's no need to adjust contrast
To apply an effect to multiple clips,
7. Rendering / Encoding
when ready, click on the Render icon on tool bar or press R !
set a guide at the end of a clip: press "end" key, use shortcut G for Add marker/guide quickly.
Note that the guide will stick to its time placement, so if you close up gaps or make edits before it on the timeline, the guide will need moving again (it will drag and snap to a clip end).
In the render dialogue select the area on the project to be encoded Full.. Selected Zone.. Guide Zone.
then render or generate a script
You can however, clear the timeline if you need to, with just Ctrl-A and press D (with Timeline active)
Rendering projects to different movie formats
I often render a "backup" copy of my film to mpeg2 @ 12000 K bitrate, which is an easier format to deal with later.
EXPERIMENTAL: TO FORCE WIDESCREEN PLAY OF 16:9 VIDEO ON A 4:3 DISPLAY, SELECT DVD 4:3 WITH THE 16:9 SOURCE. YOU GET A 16:9 PICTURE ON A 4:3 SCREEN -BUT NO GOOD FOR A WIDESCREEN TV.
Add your best encoding profiles to favorites.
Rendering takes time! The faster your processor the less time it will take. I would leave the render queue going all night on my Intel dual core.
If you are confident with your rendered film then you can dispose of the MTS files, unless you want to keep them for a while.
take care using Avidemux to cut and join mpeg2, only make cuts at KEYFRAMES! If you don't it will cause smearing of frames at the joins in the resulting movie.
You can quite easily use Avidemux to cut an mpeg2 film shorter, using Same for video and audio, but +40 ms to correct the audio lag. But you must be careful when dealing with compressed video - use key frames only for cuts.
SEE NEXT PAGE!!
add the vob files made with the DVD render to bombono and create the DVD files (which you can move to a folder).
I used to use DVD Styler, but it remuxes the films (whether 720p mpeg2 or vob files) and that takes a long time.
Then burn the DVD file set with k3b Video DVD project (put all the files in the VIDEO folder).
Or create the iso image in bombono, then burn image with k3b -for a more stable burn.
Or burn from command line with:
growisofs -dvd-compat -Z /dev/dvd=file.iso (use /dev/dvd1 or /dev/dvd2 for an external DVD writer)
convert the 1920p mpeg2 with h.264 codec 2pass @ 2000 kbps for Youtube.
Convert to mp4 with mpeg4 codec @ constant quality=8 and resize to 820p for showing on TV with a thumb-drive.
Also just "decomb" the video (Picture settings >Filter), don't force deinterlace, as not all frames are interlaced, so combing gets those that are and the result is a nice picture.
my tutorials >