33

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,957
Lekensteyn
  • 178,864
  • Have you tried Blender? I could try to find a way and write a tutorial. – bntser Sep 22 '11 at 21:16
  • I haven't tried it with Blender, but for suddenly, the crop feature works as expected. I restarted the program after some modifications, but cannot remind the taken steps. – Lekensteyn Sep 23 '11 at 14:03
  • Would it be meaningful to add answers for other programs such as avidemux and openshot as mentioned in http://ubuntuforums.org/showthread.php?t=1604224&page=2? – N.N. Feb 25 '12 at 12:48
  • If a different editor is suggested, it's OK. – Lekensteyn Feb 25 '12 at 13:02
  • I am a first-time Kdenlive user myself, but I found this youtube video suggesting to use the transform effect. Worked just fine for me. I know this is not a detailed guide, but the video explains the gotchas better anyway. – JepZ Jun 16 '19 at 08:03
  • 1
    To those who don't know. You have to drag the transform effect onto the video timeline. Then you'll be shown a window where you can adjust the offset at all sides of the video by a certain number of pixels. – Nav Dec 25 '22 at 05:53
  • @Nav, no window appears for me, using https://koji.fedoraproject.org/koji/rpminfo?rpmID=39851559. See https://youtu.be/eoZm0bqWK8g for an example. – RokeJulianLockhart Sep 23 '24 at 13:15
  • Ah, you have to click on the clip after applying the effect. – RokeJulianLockhart Sep 23 '24 at 13:19

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,552
Andyba
  • 431
  • This didn't work for me. I have a 1280x720 clip which I want to crop to Facebook cover image 820x312. When I click 4) adjust to original, Kdenlive makes the clip larger, but still too much height. It is as if this effect always forces the project settings dimensions (820x312) on the clip, whatever size I set it to – Thomas Lindvig Feb 01 '20 at 11:39
  • Hi Thomas Lindvig.
    What version of Kdenlive are you using?
    – Andyba Feb 01 '20 at 12:52
  • Kdenlive 19.12.1 for Windows. – Thomas Lindvig Feb 08 '20 at 08:37
  • [SOLVED] Point 4 in the guide should be "check distort" then it worked for me – Thomas Lindvig Feb 08 '20 at 08:59
13

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,552
  • 2
    Now a 'Custom' option in a 'Cropping' drop-down but otherwise the same. The 'Preview' window allows you to see the affect your changes will having on the output. – theotherdy Oct 31 '22 at 09:18
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,552
taneli
  • 2,629
3

Kdenlive

Install Kdenlive 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.

Based on this idea.

Pablo Bianchi
  • 17,552
  • 2
    After using Edge Crop, when I render the project to a file, the resulting file is still the full resolution of the original video - it just has a lot of black space. What am I missing? – Guss Jan 02 '24 at 18:03
  • @Guss Not sure. Check your output resolution setup or the warning on the manual (I updated the post) – Pablo Bianchi Jan 03 '24 at 13:42
  • I've tried to render to a different resolution by creating a custom Output Preset, and with just Edge Crop it was weird - it rendered in the resolution I specified in the preset, but the full video, scaled (with correct aspect ratio) to the resolution I specified. After adding also a Transform effect, the result was what I wanted - a full frame video with just the cropped content and no black borders. – Guss Jan 03 '24 at 17:22
  • @Guss, that's the same behaviour for me, using Edge Crop (per https://askubuntu.com/questions/60752/how-do-i-crop-a-video-clip#comment2687642_60752). Perhaps ask at https://discuss.kde.org/tag/kdenlive? – RokeJulianLockhart Sep 23 '24 at 13:23
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