[PLUG] ffmpeg to convert video ratio and resolution

Rich Shepard rshepard at appl-ecosys.com
Wed Jun 17 17:58:53 UTC 2020


I've used the LaTeX Beamer class to prepare PDF slides for presentations for
more than 20 years. The PDFs are in 4:3 aspect ratio with the default
resolution dependent on monitor resolution. I can set the display resolution
in impressive to 800x600, but not to a 16:9 aspect ratio that I need for
video presentations.

Web searches found that ffmpeg can change both display ratio and resolution
but the hits I found all start with videos from cameras or DVDs, not from a
PDF file in an .mp4 file.

The ffmpeg man page has an aspect option:

-aspect[:stream_specifier] aspect (output,per-stream)
 	Set the video display aspect ratio specified by aspect.

         aspect can be a floating point number string, or a string of the
         form num:den, where num and den are the numerator and denominator of
         the aspect ratio. For example "4:3", "16:9", "1.3333", and "1.7777"
         are valid argument values.

 	If used together with -vcodec copy, it will affect the aspect ratio
         stored at container level, but not the aspect ratio stored in
         encoded frames, if it exists.

There're also references to resolution but not that I understood.

The minimum resolution for YouTube is 1280x720 and 1920x1180 is preferred;
both are 16:9 aspect ratios.

My naive command line would be:

ffmpeg -i filename.mp4 -aspect 16:9

  ... and this is the extent of my current highly limited knowledge.

Please expand my ffmpeg knowledge to knowing how to convert a recorded
video's ratio and resolution.

TIA,

Rich



More information about the PLUG mailing list