8

I'm using kdenlive 16.12.3 (with Ubuntu Studio 17.04), so this cannot be the How to get the stabilization function working in Kdenlive? issue I assume since that bug supposed to be fixed a good while ago.

What I'm doing:

  1. I add the video clip I want to stabilize to the project. Then I can right click on the clip and add videostab2 (Clip Job > Stabilize), looks the same as the screenshot included in the SO issue I referenced above. But when I do this nothing happens.

  2. When I save, eventually an .mlt file appears next to the source video file. I can see that it has some info about videostab2 (see mlt-service towards the end we can see videostab2's parameters):

    20928
    pause
    GOPR0444.MP4
    2
    video
    29.97
    0
    2704
    1524
    0
    29.97
    yuvj420p
    1
    709
    1
    h264
    H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    44963086
    2017-06-08T11:08:26.000000Z
    eng
    
GoPro AVC
    GoPro AVC encoder
    audio
    fltp
    48000
    2
    aac
    AAC (Advanced Audio Coding)
    128000
    2017-06-08T11:08:26.000000Z
    eng
    
GoPro AAC
    avc1
    0
    avc1isom
    2017-06-08T11:08:26.000000Z
    HD3.03.03.00
    1
    1
    1
    1
    1
    0
    1
    avformat
    30000
    1001
    709
    1
    2704
    1524
    0
    1
    
    
    
    
        4
        8
        6
        1
        0.3
        0
        10
        -1
        -1
        1
        0
        1
        0
        1
        0.8
        videostab2
        GOPR0444.MP4.mlt.trf
        0
    
    
    
    
    
    
    
  3. I place the clip on the playlist.

  4. I render.

For reference when I generate the render script it doesn't contain any traces of videostab. Not surprisingly the end result is not stabilized at all.

How can I get this working?

Csaba Toth
  • 1,388
  • 4
  • 18
  • 30
  • it isn't necessary to save the project. import video. place it on time line. add the stabilizer to the video. then render. – ravery Jun 17 '17 at 22:22
  • Whatever is necessary, what should I do to make stabilization happen? I doubt I meant to manually modify the render script. I need to figure out "add the stabilizer to the video" part. I don't see any option to do that. The motion effects contain only the freeze and speed, I see the vidtsab2 only as a clip addon. – Csaba Toth Jun 17 '17 at 22:24
  • see the edit on my comment. – ravery Jun 17 '17 at 22:25
  • @ravery How to do that. If I select the video on the timeline and I invoke the same menu (Project > Clip Job > Stabilize), I check "Crop", then it offers to override the mlt file. Then I repeat the step again, but it forgets that I checked the crop 10 seconds ago. It saves something but goes into /dev/null? – Csaba Toth Jun 17 '17 at 23:07
  • @ravery When I right click on the video in the timeline I don't see any Stabilize in the context menu. Stabilization is not an effect (although that could be a good place) or transition. – Csaba Toth Jun 17 '17 at 23:08
  • @ravery If you can tell me this how to add it, explain it in an answer I'll mark it and accept it. Both of us will be happy. – Csaba Toth Jun 18 '17 at 18:54
  • sorry I do not know how to add it to kdenlive if it is not available in the plugin ist – ravery Jun 18 '17 at 19:01

2 Answers2

5

To stabilize a specific video file I import the file into kdenlive, right-click on it, select "clip jobs" and then "stabilize".

This will start a "job" which produces a file with .mpi appended to the end of the original video file name.

Then remove the original video from the project file list, add the .mpi video file, put that in the timeline and render it.

The problem is that this .mpi file will only work in the project environment in which it was created. It also takes a lot more time than the length of the original video because the processing is single-threaded. Then there are possible memory issues with large files. So creating a large video and then stabilizing it is a very time and memory-intensive process, requiring at least as much memory and swap-space and multiples of the time required to create that large video in kdenlive without stabilizing it. It's a good argument for an IS video camera or at least breaking the unstabilized final product into chunks and stabilizing the chunks in groups which will not require use of the swap file, then combining all the stabilized chunks into one final project and rendering it.

Then there is the effectiveness of the stabilization pass...kdenlive gives you a lot of options to play with, all affect speed, memory requirements, IQ and stabilization. Or you can try using the ffmpeg tools directly which requires a new level of understanding and effort...but at least it's possible.

Deshaking videos using script

in any case it will help immensely to do this at low-res and figure it all out before trying to do it on unstabilized files straight from the camera shot at high resolutions especially at high frame-rates. My 4Gig laptop just spent 5 days stabilizing a 30min 5GB 4k-30fps h265 mp4 video. Now I'm trying to figure out how best to render the .mpi file. I'm considering just rendering the final product at 720p or at least at 1080p. It took 8 hrs or so to render the original unstabilized 5GB 4k product at moderate IQ and encoding settings that was a mixture of 12MP stills and 1080p video...and that was for 30 minutes of 4k video. My fear is that trying to render a final product at 4k is going to ask too much of the 4GB ram + 1GB swap that I have currently and it simply has to be done at 1080p to match the original video components. So I'll try that first and update this later.

  • Scroll down in the referenced entry: https://askubuntu.com/a/947892/180266 "I tried the deshake for my helmet mounted GoPro bicycle footages but it looked like almost didn't do anything. Deshake is part of the official Ubuntu version of ffmpeg, maybe there's some parameter combination it'd work better, but reading on the net sounds like vid.stab will be better." So far I don't have any solution, but not editing these days much – Csaba Toth Mar 19 '19 at 18:54
  • Later is more than 1 month waiting ;) It renders so slowly :D – kokbira May 28 '19 at 12:45
  • What do you mean by "start a job"? Should something happen visually? When I select the menu option, nothing at all happens and I don't see any files being created. – Greg H Aug 27 '19 at 22:54
  • 1
    in kdenlive 20.04, there is no stabilize option anymore under "clip jobs" – kdarras Jun 24 '20 at 18:07
0

As @kdarras wrote in the comments above : "in kdenlive 20.04, there is no stabilize option anymore under 'clip jobs'" .. well, i use the newer 20.12.1 and it has such menu item : Clip -- Clip Jobs -- Stabilize (vidstab) which can also be reached by right-mouse-click on a video in the Project Bin list.