We're using ffmpeg to batch out some TIFF images that are being resized and having white borders created to fit specific paper sizes.

The resulting images default to 72dpi, even when the source is 300dpi. Is there a way to set the dpi flag in the output file?

Many thanks :-)


I have managed to answer my own question:

for %%a in ("*.tif") do ffmpeg -i "%%a" -vf "scale=6974:4919:force_original_aspect_ratio=decrease,pad=7016:4961:(ow-iw)/2:(oh-ih)/2:color=white,format=rgb24" -dpi 300 "%%~na A2 poster 594x420mm-Border.tif"
  • 1
    You might want to add imagemagick to the pipeline to set the dpi, I don't think there's anything in ffmpeg that deals with DPI at all.
    – stib
    Mar 17 at 6:48
  • Many thanks stib - I'd been looking at ImageMagick. It seems like that is the way to go!
    – jim_e_jib
    Mar 17 at 21:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.