Results 1 to 3 of 3

Thread: Possible for avconv to reduce video dimensions by percentage?

  1. #1
    Join Date
    Oct 2013
    Beans
    1

    Possible for avconv to reduce video dimensions by percentage?

    Long story short, is it possible for avconv to reduce the dimensions of a video by a percent? In my case, 50% smaller.

    If the original video is 1280x720, I would like the output to be 640x360.
    If the original video is 1024x768, I would like the output to be 512x384.
    ... and so on.

    Is there a single generic parameter I can use that would allow me to automate the process in a script?

  2. #2
    Join Date
    Mar 2010
    Location
    Metro-ATL
    Beans
    Hidden!
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Possible for avconv to reduce video dimensions by percentage?

    Only deal with the 2nd resolution and have your script divide by 2 then look for the closes mod-16 number. Turns out that using modulus 16 numbers is more efficient with many codec transcodes.

    Or you could build a table.

    I don't use avonv myself, switched to handbrakeCLI about 2 yrs ago to use the "constant quality" setting under h.264. When I was using mplayer with xvid, I scripted this stuff.

    BTW, there no need to ask about options for most Linux tools. The "man page" will explain all available options. Just looked at the avconv man page - no percent resize option exists in the version that I have loaded, however, simple calculations ARE supported, including trig functions.

  3. #3
    Join Date
    Sep 2006
    Beans
    3,491

    Re: Possible for avconv to reduce video dimensions by percentage?

    You can do this with the scale video filter:

    Code:
    ffmpeg -i input -vf scale=iw*0.5:-1 -codec:a copy output
    "-codec:a copy" will allow you to steam copy the audio and avoid re-encoding.

    Note that my advice only applies to ffmpeg from FFmpeg, and not anything from the fork Libav, so it may not work for anything from the repository.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •