Hot answers tagged

13 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 ...
user avatar
  • 246
12 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 ...
user avatar
  • 236
6 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 ...
user avatar
  • 173
5 votes

ffmpeg - resize and crop

Use this: -vf "scale=iw*min(1920/iw\,1080/ih):ih*min(1920/iw\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2" This code evaluates which ratio to apply ...
user avatar
  • 30.3k
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 ...
user avatar
  • 30.3k
4 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 ...
user avatar
  • 30.3k
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/...
user avatar
  • 51
4 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 ...
user avatar
  • 181
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 ...
user avatar
  • 30.3k
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 -...
user avatar
  • 30.3k
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 ...
user avatar
  • 4,211
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 ...
user avatar
  • 31
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 ...
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 ...
user avatar
2 votes

Best presets to scale legacy 4:3 and 5:4 videos using ffmpeg

In order to maintain the aspect ratio of the source movie through FFMpeg's scaler, you have to specify a scale with an unknown: ffmpeg -i input.mp4 -an -vcodec libx264 -profile:v main \ -pass 2 -vf ...
user avatar
  • 213
2 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=...
user avatar
  • 30.3k
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 ...
user avatar
  • 882
2 votes

How to scale a layer in pixelated fashion in After Effects?

It will scale like that, because every picture made of pixels (except vector graphics, but just don't use that) You can force it with effect Stylize > Mosaic Good luck!
user avatar
  • 1,729
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,...
user avatar
  • 1,372
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:...
user avatar
  • 30.3k
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 @ ...
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 ...
user avatar
  • 30.3k
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]...
user avatar
  • 30.3k
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 ...
user avatar
1 vote

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,...
user avatar
  • 213
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, ...
user avatar
  • 30.3k
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 ...
user avatar
  • 4,654
1 vote

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 ...
user avatar
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 ...
user avatar
1 vote
Accepted

How to scale a layer in pixelated fashion in After Effects?

Ok, I read your mind. What you are talking about called Quality and Sampling. You can find it in the timeline on your layer when "Switches" are activated: Adjust it to pixelated view, and you will be ...
user avatar
  • 1,729

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