How to best convert Flash compatible mp4 files with FFMPEG?

前端 未结 8 1016
北恋
北恋 2021-01-30 02:32

I am trying to convert different files to a flash compatible .mp4 file with ffmpeg, but I can\'t seem to get it to work. Of course the objective is to get the great

相关标签:
8条回答
  • 2021-01-30 03:19

    I found this (very verbose, i'm not sure what half of it even does) snippet somewhere on the web. It's made for doing two passes, so it won't output any video on the first pass, you'll need to set it to do -pass 2 to run the second pass and output the actual video.

    ffmpeg -y -i output.mp4 -vcodec libx264 -acodec libfaac -ab 12000 -ac 2 -b 200000 -threads 2 -flags +loop -cmp +chroma -partitions 0 -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M -bufsize 10M -rc_eq \’blurCplx^(1-qComp)\’ -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -s 304x224 -pass 1 yourinfile.avi
    

    To get progressive playback during download you will also need to move the metadata to the start of the file. ffmpeg puts this at the end and flash needs this before it can start playing. A useful tool for this is QTIndexSwapper

    0 讨论(0)
  • 2021-01-30 03:33

    If you're using ffmpeg to make .mp4s, look in the ffpresets/ directory and use -vpre. The default options (for all codecs, but especially libx264) are very bad and practically all of them should be set to something custom. -vpre takes care of most of it for x264.

    0 讨论(0)
提交回复
热议问题