How to best convert Flash compatible mp4 files with FFMPEG?

前端 未结 8 1036
北恋
北恋 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:18

    Actually you shouldn't be using maxrate, especially not a maxrate of 10000k when you have your bitrate explicitly set to 200k. In fact looking at this even closer I really don't think you understand what most of that stuff is for :)

    For starters you're calling the input file output.mp4, plus the output file (which should actually be /dev/null for pass 1) is called yourinfile.avi and you haven't actually set a container format so what you would end up with is an h264 encoded avi file.

    Try this for high quality 1080p HD flash compatible h264 encoded MPEG-4 videos, first create a file with the following contents in the same directory as the video you're encoding and name it something like flash-mp4.ffpreset

    vcodec=libx264
    b=5000k
    acodec=libfaac
    ab=256k
    ac=2
    ar=44100
    coder=1
    flags=+loop+mv4
    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=4
    directpred=3
    trellis=1
    flags2=+wpred+mixed_refs+dct8x8+fastpskip
    wpredp=2
    fflags=+rtphint
    profile=1
    

    then from the command line:

    ffmpeg -y -i sourcefile.avi -fpre ./flash-mp4.ffpreset -f mp4 outputfile.f4v
    

    That should play perfectly with flash 10+

提交回复
热议问题