How to Resize, Crop, and Transcode Videos
Learn when to resize, crop, or transcode a video, then use FFmpeg or HandBrake to export it for your destination without stretching or cropping out important content.
To resize, crop, and transcode a video, first decide the destination’s aspect ratio, dimensions, codec, and quality needs. Resizing changes frame dimensions; cropping removes image area; transcoding decodes and re-encodes streams, potentially changing the codec, container, bitrate, frame rate, or resolution. You can combine these operations in one export. Keep the aspect ratio when scaling the full image, preview crops before encoding, and remember that lossy re-encoding can reduce detail.
Choose the right operation
| Operation | What changes | Use it when |
|---|---|---|
| Resize | Output frame dimensions | You need a particular resolution or want a smaller or larger frame. |
| Crop | Visible image area | You need to remove black bars or reframe for a different shape. |
| Transcode | Encoded media streams and export settings | The destination needs a different codec, container, quality target, or other encoding setting. |
Resizing can preserve the full image if you constrain proportions. When source and destination shapes differ, fitting the whole image may leave unused space; filling the destination frame requires cropping. Cropping discards pixels and can remove useful content. Preview the result rather than assuming an automatic crop is correct.
Inspect the source and define the destination
- Identify the destination. Check its accepted containers, codecs, resolution, aspect ratio, frame-rate guidance, and file-size limits. If the destination is unknown, retaining the source frame rate and aspect ratio is a conservative start.
- Inspect the source. Note pixel dimensions, display aspect ratio, frame rate, black bars, interlacing, and pixel aspect ratio. A mismatch in pixel aspect ratio can distort the image; Adobe describes frame size, frame rate, and pixel aspect ratio as separate export properties in its Premiere export settings documentation.
- Choose fit or fill. Fit retains the whole picture and may leave unused space. Fill covers the new frame and trims some image area. Check that faces, captions, and other important subjects remain visible.
- Set dimensions and encoding. Use the destination requirements or a relevant preset as a starting point. Avoid unnecessary upscaling; HandBrake notes exceptions can exist, such as a platform upload requirement, in its resizing guide.
- Preview and inspect. Check edges, aspect ratio, motion, audio, colors, and playback before distributing the output.
Resize, crop, and transcode with FFmpeg
FFmpeg can read media, apply filters, and encode an output. These commands use input.mp4 and write output.mp4; replace paths and settings for your source and destination. See the FFmpeg command documentation, filter documentation, and scaler documentation.
Resize proportionally to fit within 1280 by 720
ffmpeg -i input.mp4 -vf "scale=1280:720:force_original_aspect_ratio=decrease" -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 128k output.mp4
This scales the picture down, if needed, so it fits within the bounding dimensions while preserving proportions. The output frame may not be exactly 1280 by 720. To create an exact 1280 by 720 canvas and add padding where needed, append a pad filter:
ffmpeg -i input.mp4 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 128k output.mp4
Fill a 1280 by 720 frame by cropping
ffmpeg -i input.mp4 -vf "scale=1280:720:force_original_aspect_ratio=increase,crop=1280:720" -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 128k output.mp4
This fills the target frame and trims excess image area. Inspect the framing, especially when the subject is near an edge.
Crop known black bars or a fixed region
ffmpeg -i input.mp4 -vf "crop=iw:ih-160:0:80,scale=1280:-2" -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 128k output.mp4
The crop expression keeps the input width, removes 80 pixels at the top and bottom, then scales the result to 1280 pixels wide. Change these values after inspecting the source; an incorrect crop can remove image content. For a centered crop to a 16:9 shape, you can use crop='min(iw,ih*16/9)':'min(ih,iw*9/16)', though exact output dimensions may still need a scale step.
Transcode without resizing
ffmpeg -i input.mov -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4
This re-encodes video as H.264 and audio as AAC in an MP4 container while leaving frame dimensions unchanged. -crf is a quality target for this encoder: lower values generally mean higher quality and larger files. The chosen value is a starting point, not a guaranteed bitrate or file size. -preset trades encoding speed for compression efficiency. +faststart moves MP4 metadata toward the beginning of the file for progressive playback.
Retain source frame rate and audio streams
FFmpeg normally selects streams according to its defaults. For a file with multiple audio or subtitle streams, inspect the streams and map the ones you need explicitly. For example, to keep the first video and first audio stream:
ffmpeg -i input.mkv -map 0:v:0 -map 0:a:0? -vf "scale=1280:-2" -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 128k output.mp4
The question mark makes the audio mapping optional, so the command can also work when there is no audio stream. No explicit frame-rate conversion is requested, which avoids deliberately changing the source rate. If the destination specifies a frame rate, set it deliberately and check for motion cadence changes.
Use HandBrake for a graphical workflow
- Open the source and choose a preset suited to the intended device or web playback. The official preset guide describes device, web, and general-use presets; check the selected preset’s limits because it may cap resolution or frame rate.
- Open the dimensions or sizing controls. Choose automatic sizing, a resolution limit, or custom dimensions, and keep proportions constrained if you want to scale the whole picture.
- Choose automatic crop only as a first estimate. Check the preview and adjust crop values manually where needed. HandBrake’s cropping guidance recommends checking the preview.
- Set the video encoder and quality or bitrate controls for the destination. Choose audio tracks and settings as needed.
- Preview, select the output destination, and start the encode. Inspect the exported file before delivery.
Destination example: YouTube
YouTube’s recommendations apply to YouTube uploads, not every hosting service. Its recommended upload encoding settings list MP4, H.264, progressive scan, and matching the recorded frame rate where possible. For SDR video, its bitrate table recommends 8 Mbps for 1080p at standard frame rates (24, 25, or 30 fps), 12 Mbps for 1080p at high frame rates (48, 50, or 60 fps), 35–45 Mbps for 2160p at standard rates, and 53–68 Mbps for 2160p at high rates. These are upload recommendations, not guarantees of a specific quality or file size.
YouTube describes 16:9 as the standard computer aspect ratio, while its player adapts to vertical and square video. Its resolution and aspect ratio guidance advises against baking padding or black bars into the video because they can interfere with player adaptation. Keep vertical or square footage in its intended shape unless your actual delivery requirement calls for reframing.
Or skip the browser setup
If you are capturing a web page as a video frame or need a clean reference screenshot before editing, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF. See the API documentation for options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Cookie banners are accepted like a visitor and removed along with known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, with no card.
Performance, reliability, and cost
- Encode time: Higher resolutions, more complex filters, and slower quality presets can increase processing time. Adobe says maximum render quality can help preserve detail and reduce aliasing when scaling, but can significantly increase export time, especially without supported GPU hardware; see its export settings guidance.
- File size: Lower CRF or higher bitrate usually produces larger output. Results depend on the footage, codec, frame size, and motion. Make a short sample when the size limit matters.
- Quality: Scaling removes or interpolates samples; lossy transcoding discards information. Keeping the original and avoiding repeated generations helps preserve quality.
- Reliability: Confirm the output exists, inspect the full duration, and play it in a representative target player. For long jobs, retain logs and enough disk space for source, temporary files, and output.
- Cost: FFmpeg and HandBrake are software workflows; resource costs depend on the machine, time, and storage you use. Do not choose a bitrate from file size alone when a destination publishes specific encoding guidance.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Image looks stretched | Width and height were forced without preserving aspect ratio, or pixel aspect ratio was misinterpreted. | Use proportional scaling such as scale=1280:-2 and inspect source display and pixel aspect ratios. |
| Important subject is cut off | Fill or crop settings removed part of the frame. | Preview and adjust crop offsets, or fit the whole picture and accept unused space. |
| Black bars remain | Bars are encoded in the source or the chosen fit mode leaves unused space. | Crop only the actual bars, or use fill if trimming other image content is acceptable. |
| Output has unexpected dimensions | Proportional scaling preserves shape and may not produce the exact requested canvas. | Use a pad filter to create exact dimensions, or a crop filter when filling the frame is intended. |
| Output is too large | Quality target or bitrate is high, or the codec is less efficient for the chosen constraints. | Make a short sample, adjust quality or bitrate, and verify the destination still accepts the result. |
| Encode is too slow | High resolution, expensive filters, or a slower preset. | Use a faster preset, simplify filters, or reduce output dimensions if the destination allows it. |
| No sound or missing tracks | The output mapping or container omitted streams, or the source has multiple tracks. | Inspect streams and map desired audio explicitly; verify the selected codec is supported by the container. |
| FFmpeg says “width not divisible by 2” | Some chroma subsampling and encoders require even dimensions. | Use an even-dimension expression such as scale=1280:-2, or adjust crop dimensions to an even number. |
| Video plays poorly on target | Codec, profile, frame rate, pixel format, or container is unsupported or mismatched. | Use the destination’s current encoding guidance or an appropriate HandBrake preset, then test in the target player. |
Frequently asked questions
Should I crop before or after resizing?
For a target aspect ratio, define the crop and scale together so the final frame has the intended shape. Preview the combined result; the order and dimensions affect which content remains.
Will transcoding make the video smaller?
Not automatically. The output may be smaller or larger depending on codec, quality target, bitrate, and content.
Can I upscale a video?
Yes, but upscaling does not restore source detail. Do it only when a delivery requirement or workflow justifies the larger dimensions.
Do I need to change frame rate when resizing?
No. Resizing changes spatial dimensions; change frame rate only when the destination or editing goal requires it.
Which settings are best?
There is no universal combination. The right settings depend on source properties and destination requirements, especially the desired frame shape, compatibility, quality, size, and export time.


