Export GIF with same resolution as cropped source video

Hello. I am trying to figure out how to export my GIF with the same resolution as the cropped, source video. I have looked online for answers and tried suggestions, but I have not been able to solve the problem. I feel like this should be a really simple thing to do, but I can’t figure it out.

The issue:

  • The exported GIF is not perfectly center (I have to eyeball it to the grid)
  • The exported GIF has black bars (or any colour) on the top, bottom, and sides

What I want to do:

  • Crop a portion of the source video and also zoom in on it
  • Center the source video
  • Export as GIF

What I have tried:

  • I am using “Size, Position & Rotate”, “Crop: Rectangle”, and “Crop: Source” filters
  • I have matched the export resolution with that of the “Size, Position & Rotate” filter
  • I tried only using the first 2 filters and experimenting with different resolutions
  • I tried adjusting the aspect ratio
  • I tried adding a transparent background

I have added an attachment to show the issue. I used a blue background to highlight the areas that are being rendered. I do not want these in the GIF. Only the area in the red box.

This is not really a targeted use case as the tool is video-oriented and does not have great quality GIF Animation output (are you sure you cannot use a MP4?), but give this a try:

  1. Use Crop: Rectangle filter to choose the area without going outside the video resulting in any negative Position.
  2. Choose Settings > Video Mode > Custom > Add…
  3. Enter the Size from the previous step as both Resolution and Aspect ratio. Click OK
  4. Remove the Crop: Rectangle filter
  5. Add the Size, Position & Rotate filter
  6. Fiddle with Zoom and Position to make it close to what you want.
  7. Export using the GIF Animation preset

Hi Dan, thanks for your response.

I followed your steps but I am still having issues.

The size and aspect ratio look correct in Shotcut, but when exporting as a GIF, the output is stretched, as if it were 16:9, and it still has black bars on the top, bottom, and sides.

If I export it as an .mp4 using the H.264 Main Profile preset, the dimensions are correct, as in not stretched like above, but the black bars remain.

What I then did was take the .mp4 export and create a GIF using ffmpeg, but then the results are even worse than the exported GIF from Shotcut. The ffmpeg GIF is stretched again, blurry, distorted, and has a weird fisheye effect.

Any suggestions?

Do not change the resolution or aspect ratio in the export settings.

Following @shotcut 's instructions:

1-second gif
karmer 1256x992

1 Like

Thanks guys. I guess I made a mistake somewhere, though I did do a few exports.

On a related note, how do you deal with the “grab handles” going out of the preview window when you REALLY want to zoom in? I was cropping another video for a GIF and the content I wanted was in the top left of the screen. It was small, so I had to zoom in a lot, but I kept losing the grab handles.


This topic was automatically closed after 90 days. New replies are no longer allowed.