4

I am tasked with trying to 'improve' the quality of video from a point and shoot camera. I was considering perhaps up-sampling and then applying some unsharp masking.

Can any FFMPEG experts suggest some starting settings for unsharp masking, both with, and without up-sampling (say from 320X180 to 720P 1280X720)?

1
  • use the hqdn3d filter?
    – rogerdpack
    May 15, 2013 at 21:07

1 Answer 1

8

See the scale and unsharp filters in ffmpeg:

ffmpeg -i input -filter:v "scale=1280:-1:flags=lanczos,unsharp=5:5:1.0:5:5:0.0" output
  • The -1 in the scale filter will automatically choose the correct height to preserve aspect ratio.

  • You can change the scale algorithm with the flags option in the scale filter. For upsampling lanczos is worth trying. Default is bicubic (if using -vf/-filter:v) or bilinear (if using -filter_complex). See the full list of algorithms with ffmpeg -h filter=scale (listed under -sws_flags) or at FFmpeg Scaler Documentation.

  • This example uses the default unsharp settings: 5:5:1.0:5:5:0.0, which were included for demonstration purposes. These values allow you to sharpen or blur chroma and/or luma. See the unsharp filter documentation more examples.

3
  • Option filter:v (set stream filtergraph) cannot be applied to input
    – e-info128
    Jul 14, 2019 at 2:26
  • 1
    @e-info128 Order of options matters. You're attempting to apply filters to the input, but filtering is an output option. ffmpeg [input options] -i input [output options] output
    – llogan
    Jul 18, 2019 at 18:24
  • Wow, thanks for the lanczos tip, I was wondering why videos scaled with ffmpeg had worse quality than when I fullscreen them in the player. So that was because ffmpeg uses the cheap bicubic scaling by default...
    – Klesun
    Mar 1, 2021 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .