ffmpeg conversion command to output to h.264 for iPad

26,420

Check this link. All the conversion settings you can shake a phone at. http://develop.participatoryculture.org/index.php/ConversionMatrix

Share:
26,420
janet-PCF
Author by

janet-PCF

Updated on June 23, 2020

Comments

  • janet-PCF
    janet-PCF almost 4 years

    I'm looking for a good (general) conversion command that will convert any input file to h.264 sized for the iPad.

    Currently I have this command that works, that was adapted from robert.swain

    With presets:

    $ ffmpeg -i INPUT -acodec aac -ab 160000 -s 1024x768 -vcodec libx264 \
             -vpre slow -vpre ipod640 -b 1200kb -threads 0 -f mp4 OUTPUT.mp4
    

    Long form, no presets:

    $ ffmpeg -i INPUT -acodec aac -ab 160000 -s 1024x768 -vcodec libx264 \
             -coder 1 -flags +loop -cmp +chroma \
             -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method umh \
             -subq 8 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 \
             -i_qfactor 0.71 -b_strategy 2 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 \
             -bf 3 -refs 5 -directpred 3 -trellis 1 \
             -flags2 +bpyramid+mixed_refs+wpred+dct8x8+fastpskip -wpredp 2 \
             -rc_lookahead 50 -coder 0 -bf 0 -refs 1 -flags2 -wpred-dct8x8 \
             -level 30 -maxrate 10000000 -bufsize 10000000 -wpredp 0 -b 1200k \
             -threads 0 -f mp4 OUTPUT.mp4
    

    Note: I'm skipping the aspect ratio because we handle that in the program, and we only resize it if the input resolution is greater than the output resolution.

    If there's any suggestions for improvement, we are looking to balance speed, quality and conversion time.

    • makc
      makc over 9 years
      Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height :(
  • Stewie Griffin
    Stewie Griffin almost 10 years
    It seems this website may be outdated.
  • user3443139
    user3443139 about 8 years
    Link is dead, what parameters would you recommend?