gpt-4o-2024-05-13· OpenAI
WildChat-4.8M (AI2)
hi,can you give me a ffmpeg 6 arg crop outer edge 1 pix and rescale 1920x 1080
- User
hi,can you give me a ffmpeg 6 arg crop outer edge 1 pix and rescale 1920x 1080
- Assistant
Sure! To crop off the outer edge by 1 pixel on all sides and then rescale the video to 1920x1080 using FFmpeg, you can use the following command:
ffmpeg -i input.mp4 -vf "crop=in_w-2:in_h-2:1:1,scale=1920:1080" -c:a copy output.mp4Here's a breakdown of the command:
-i input.mp4specifies the input file.-vf "crop=in_w-2:in_h-2:1:1,scale=1920:1080"applies a video filter chain:crop=in_w-2:in_h-2:1:1crops the video by removing 1 pixel from each side.in_wandin_hare the input video width and height.in_w-2: the width after cropping 1 pixel from both the left and right sides.in_h-2: the height after cropping 1 pixel from both the top and bottom sides.1:1: the coordinates for the top-left corner of the crop, starting from (1, 1) in the input frame (effectively ignoring the outer 1-pixel edge on all sides).
scale=1920:1080rescales the cropped video to 1920x1080 resolution.