Hot answers tagged

15 votes
Accepted

How do the super resolution filters in FFmpeg work?

I realise this question is pretty old now but it still comes up quite high in search results so I would like to document how I got the "sr" to work (August 2020) in case it can help someone ...
Mark's user avatar
  • 266
13 votes
Accepted

How to convert a 3D movie to 2D using ffmpeg

While you might be able to achieve this by manually using ffmpeg's crop filter, the stereo3d filter is designed specifically for this purpose. You didn't specify the exact 3d format you have. There ...
kevmitch's user avatar
  • 246
7 votes

How do the super resolution filters in FFmpeg work?

Since Google Summer of Code 2018, FFMpeg has supported the sr filter for applying super-resolution methods based on convolutional neural networks. However, as you have discovered, few super-resolution ...
Witiko's user avatar
  • 183
6 votes
Accepted

How to combine ffmpeg vf commands for resizing and color correction?

Filter complex isn't needed. When a series of filters are to be applied to a single input in sequence, they are to be separated with a comma and passed along as a single filterchain (-vf, -af). You ...
Gyan's user avatar
  • 32.6k
5 votes
Accepted

Scaling videos of variable size to a fixed aspect ratio

Use ffmpeg -i "input.mov" -vf "scale='if(gt(a*sar,16/9),640,360*iw*sar/ih)':'if(gt(a*sar,16/9),640*ih/iw/sar,360)', pad=640:360:(ow-iw)/2:(oh-ih)/2,setsar=1" -vcodec ...
Gyan's user avatar
  • 32.6k
5 votes
Accepted

ffmpeg vf scale shifts colors to washed out

The video's color transfer characteristics (trc) and color primaries flags are not being set on the output video, which is causing the video player to use incorrect values for playback, resulting in ...
Zach F.'s user avatar
  • 321
4 votes

How do the super resolution filters in FFmpeg work?

Although Mark has provided great answer, you don't need to train models from scratch, all Super-Resolution models that ffmpeg supports have pre-trained checkpoints: https://github.com/XueweiMeng/sr/...
Alex's user avatar
  • 51
3 votes

How do the super resolution filters in FFmpeg work?

If all you need to do is superscale an image, going through the trouble of training neural networks is re-inventing the wheel. By all means, if you're studying computer science and are interested in ...
Jason Conrad's user avatar
  • 4,444
3 votes
Accepted

How to combine and optimize ffmpeg filters to avoid encoding multiple times?

The single command will be long, but here's an example for 3 inputs. ffmpeg -i input_01.mp4 -loop 1 -t 11 -i input_01_logo.png -i input_02.mp4 -loop 1 -t 11 -i input_02_logo.png -i ...
Gyan's user avatar
  • 32.6k
3 votes
Accepted

FFmpeg scale video filter does not working as expected

The scale filter will adjust the sample aspect ratio to maintain the original display aspect ratio, which is 16:9 for your input. Use the SAR filter to reset the SAR after scaling. ffmpeg -i 1.mp4 -...
Gyan's user avatar
  • 32.6k
3 votes

Downscaling 4K YUV420 to 1080p YUV444 with ffmpeg introduces red tint

I dug further and after reading the entire topic at Personal View, I found that user willyfan suggested to add in_range=full to both first scale arguments to correct a color shift that he also ...
kdarras's user avatar
  • 161
3 votes
Accepted

Downscaling 4k to 1080p in Premiere Pro, Image Zooming 2x

Changing the preference doesn't change any clip settings retroactively. But once you have set it, and then create a new project and a new sequence, and when you freshly import your 4K clip and drop ...
Michael Tiemann's user avatar
3 votes
Accepted

Converting a Video from 1600*1200 to 1920*1080

Using ffmpeg, ffmpeg -i input.mp4 -vf "scale=1920:1080:flags=lanczos,setsar=1" output.mp4 This will stretch the video to 1920x1080. ffmpeg -i input.mp4 -vf "scale=-1:1080:flags=lanczos,setsar=1,pad=...
Gyan's user avatar
  • 32.6k
3 votes

How can I scale more than 300% in Premiere?

If you're using an older Version of Premiere: As mentioned above, you can apply the maximum scale on the original clip, then nest the clip (right click > Nest), and here apply another scale ...
erdin's user avatar
  • 31
2 votes

How to convert a 3D movie to 2D using ffmpeg

I found a reference on this forum. http://www.ffmpeg-archive.org/How-to-re-encode-3d-video-to-2d-video-td4676271.html ffmpeg -i './a3dmovie.mp4' -vf "crop=w=iw/2:h=ih:x=0:y=0,scale=w=2*iw:h=ih,...
nelaaro's user avatar
  • 243
2 votes

What is the difference between 'Set To Frame Size' and 'Scale To Frame Size'?

Scale to Frame Size Scales the clip to fit the size used in the current sequence whilst retaining the original aspect ratio to fit within the frame. Essentially, the clip has been rasterized to match ...
Ambo100's user avatar
  • 932
2 votes

How to convert a 3D movie to 2D using ffmpeg

As an adaption of kevmitch's answer, I went with ffmpeg -i "foo.mkv" -vf stereo3d=sbs2l:ml -c:a copy "bar.mp4" Notable difference: It's using sbs2l (instead of sbsl2) and just ...
Mister Henson's user avatar
2 votes

Scale video without keeping aspect ratio in ffmpeg

I resolved this issue by setting the attached SAR (Sample/Storage Aspect Ratio): ffmpeg -i test.mp4 -vf scale=1000:200,setsar=1 output.mp4
Pierre de LESPINAY's user avatar
1 vote

FFmpeg does not preserve colors after resizing

There is already a solution here. But I will try to summarize it in brief. You need to specify the correct flags for color properties of the original file. Your original file (as probably many other ...
Tzamutzl's user avatar
1 vote

FFmpeg does not preserve colors after resizing

Ad 1: Try adding the -pix_fmt yuv420p10le option (e.g. before -vf). Or only -pix_fmt + for using the same pixel format as the input video has. If it doesn't help, you obviously have an inappropriate,...
MarianD's user avatar
  • 1,494
1 vote
Accepted

ffmpeg fade in from center (with scale image)

Use ffmpeg -i file.mp4 -i image.jpg -filter_complex "[1:v]pad=iw*2:ih*2:(ow-iw)/2:(oh-ih)/2:c=black@0,zoompan='1+on/125':x='(iw-iw/zoom)/2':y='(ih-ih/zoom)/2':d=125:s=WxH,format=gbrap,fade=t=in:d=5:...
Gyan's user avatar
  • 32.6k
1 vote

ffmpeg scaler options not working

Use the print_info flag to see what the scaler is doing, example from an actual conversion: -filter:v "scale=w=1280:h=-2:flags=print_info+bicubic" Part of the relevant output: [Parsed_scale_0 @ ...
Carlos Alloatti's user avatar
1 vote
Accepted

Setting different resolution for encoding and display when encoding in ffmpeg

There's the setsar and setdar filters for this purpose -vf scale=960:720,setdar=16/9 Since you know the output display ratio, it's convenient to use setdar here, although both filters only alter the ...
Gyan's user avatar
  • 32.6k
1 vote

How to use ffmpeg to fade in/out a veriable frame rate video clip with unknown duration

This works here ffmpeg -i VID_1.mp4 -sseof -2 -copyts -i VID_1.mp4 -lavfi "[1]fade=out:s=1:d=2[tail];[0][tail]overlay,fade=in:s=0:d=2,scale=640:-2[video];anullsrc,atrim=0:2.1[audiotail];[0][audiotail]...
Gyan's user avatar
  • 32.6k
1 vote

Scale, position, and zoom a still image in Premiere Pro CC

That's very easy. Simply select all images, press right click -> Nest. Give it a name and you are done. Now on this single "clip" apply your movement. If you want to edit the single images, double ...
Timothy Lukas H.'s user avatar
1 vote
Accepted

I scaled down a video, but the bit rate does not change

The scale filter has no effect on the encoder's bitrate control. Yes, a scaled down video should have a lower bitrate if it is encoded with the same encoder settings as the source. In your command, ...
Gyan's user avatar
  • 32.6k
1 vote

Making video content for 30' x 10' 3:1 Widescreen

Since the resulting projected image is 3240 px wide, that's the size you should create. Then output two "halves" -- the leftmost 1920 px, then the rightmost 1920 px. There will be 600 px that appear ...
Jim Mack's user avatar
  • 4,674
1 vote
Accepted

Width and Height troubles

I just found out how to solve my problem. The H.264 codec is the issue, it somehow does not work with it and AE gives you a warning: Output file will be resized from 2085 x 2560 (1.0 PAR) to 2000 x ...
Zararsiz's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible