31

I've recorded a video using recordmydesktop, but have unfortunately chosen for capturing the whole screen (1600*896) instead of a small part with geometric 900*690.

How do I crop this video? Preferably in the editor I'm using, Kdenlive, to minimize quality loss. I've tried the Crop, Pan & Zoom and Scale0tilt effects, modifying the pixel ratio, movie size inside project settings options without success. A step-by-step guide would be preferred or at least some hints.

RolandiXor
  • 51,797
Lekensteyn
  • 178,446

6 Answers6

18

Cropping a video can be done multiple ways in Kdenlive.

One way is to set the project to the desired size, then set the video to original size so that only the cropped part is visible in the project.

How to do it:

  1. Start a new project with the desired crop size.

    If no profile available with required size you should create a new project profile by clicking on Manage project profiles button. screenshot

    Then click on create new profile.

    screenshot

    Change the profile settings as required in your case make it 900x690.

  2. Import your clip to project bin and add it to timeline.

  3. Add Position and Zoom effect to your clip.

  4. Click on adjust to original size in the effect settings.

    screenshot

  5. Change the X and Y to adjust the position of the cropped region as desired.

Pablo Bianchi
  • 17,371
Andyba
  • 431
12

Handbrake

I would recommend using another program, Handbrake. Use the Loose Crop option, then switch back to the Summary tab to see a visual representation of the crop effect. I found it rendered faster than Kdenlive using the crop effect as well.

screenshot

Pablo Bianchi
  • 17,371
NuclearPeon
  • 446
  • 4
  • 8
8

If nothing else works, you could use mencoder. It is not an interactive editor and will result in re-encoding of the video. If you can live with that, here's how: mencoder -oac pcm -ovc x264 -vf crop=900:690:0:0 -o output.mp4 input.mp4 where the :0:0 part is upper left coordinates of the cropped area. You may want to play around with -oac and -ovc options and see which codecs produce the best results. Use mencoder -ovc help -oac help to get a listing of available options.

Pablo Bianchi
  • 17,371
taneli
  • 2,629
2

Kdenlive

Install Kdenlive 23.08.1 with Flatpak, then:

  1. Add clip to project bin and drag & drop it to the video track.

  2. On Effects tab, search for Edge Crop

    screenshot

  3. Drag & drop it to video section to crop.

    screenshot

  4. On the left, on the Effect/Composition stack, tune the crop parameters, checking the results preview on the project monitor (by default in the upper right corner).

    screenshot

Done.


From manual:

Warning

As of this writing and in version 23.04 this effect still behaves strangely. The parameter values seem to interfere with each other and it is not possible to have all four sides being cropped. It is either top/bottom or left/right and only the last value entered is applied (and then on both sides). Until this is fixed it is recommended to use the Crop, Scale and Tilt effect.

Based on this idea.

Pablo Bianchi
  • 17,371
0

I wanted to crop and scale up a vertical clip that was embedded in a horizontal video (480p) with huge useless bars on the sides, and I figured out how to do it:

  • First read this answer here from Andyba as it has all the screenshots and stuff that were useful for me, but I will say what I had to do differently from there:

  • Start by creating a new project with Custom settings, copy the "Vertical HD 30fps" or 60fps project and alter it to your desired final resolution settings, in my case 480p 9:16 or 480x854, save a new copy with a new name, then use that project

  • Import your clip into the Project Bin, drag it into the timeline in either V1 or V2 as usual

  • In the panel in the top left, click over to the "Effects" tab, search for "Position and Zoom", click and drag it onto the clip in the timeline below.

  • If the video preview on the top right is looking funky, such as the V1 and V2 being beside each other as though it is trying to split-screen your video with the other video track, the easy solution is either fully close and reopen Kdenlive, or just hide the other video track with the filmstrip looking button on the left of its timeline in the timeline interface

  • Click on the clip in the timeline that you just dragged the effect onto, then in the bottom right corner click on the "Effect/Composition Stack" tab

  • The exact settings you will need may vary, but what worked for me was to set the "Size" field to about 320%

I did not need to use the X/Y settings at all but if you do, you may want to start with the little Center Vertically or Center Horizontally buttons in between the offsets and the size fields, then start tweaking those offsets a bit manually if they aren't quite right for you.

0

To crop a video without black sides, in Kdenlive 24.02.1 I used effect "Transform, Distort and Perspective -> Position and Zoom": enter image description here

So you essentially zoom + shift until you get only the part of the image you need in the existing window size.

warvariuc
  • 2,335