polewthenew.blogg.se

Ffmpeg scale image
Ffmpeg scale image












ffmpeg scale image

So I decided to recode the video one more time, this time also deinterlacing it and opting for higher quality output: ffmpeg -i input.ts -vf "crop=1760:1080:80:0,scale=1920:1080,setdar=16:9,yadif" \ The original, interlaced video was okay the transcoded result, also interlaced, showed interlacing artifacts. I was still not happy with the result, however. This time around, however, I did not specify the audio codec, because I wanted ffmpeg to encode it with the MPEG-4 default. So rather than re-encode the MPEG-4 file, I decided to encode the TS file directly: ffmpeg -i input.ts -vf "crop=1760:1080:80:0,scale=1920:1080,setdar=16:9" output.mp4 ts) file, from which the MPEG-4 video was produced. Then I realized that I still have the original transport stream (. As for the audio, I asked it to simply copy the audio stream without re-encoding. Then, I asked it to scale the video back to the standard 1920x1080 resolution, using the display aspect ratio of 16:9 this ensured square pixels. First, I cropped the video to 11/12th its original width, centering the crop rectangle horizontally. To explain: under the -vf option, I specified several video filters.

ffmpeg scale image

I consulted several Web sites, and eventually constructed the following command: ffmpeg -i input.mp4 -vf "crop=1760:1080:80:0,scale=1920:1080,setdar=16:9" -c:a copy output.mp4 My tool of choice, of course, was ffmpeg, but I had to find the right combination of command-line parameters. I wanted to correct this distortion and re-encode the resulting video using the standard 1920x1080 square pixels. Thus, the image was distorted to the tune of 12:11. Taking a screenshot of something that was supposed to be circular (a company logo during the end credits), I saw that the logo was 132 pixels wide by 144 pixels tall. Recently, I came across a curious problem: an HD video recording that had the right aspect ratio (1920x1080 square pixels), but in which the actual content was encoded such that everything was squished a little.














Ffmpeg scale image