start up :x64 native tool command prompt for vs 2019
cd /d D:/programfile/Git
run git-bash.exe
or
cd D:/programfile/Git/usr/bin
run mintty.exe
CC=cl ./configure --enable-shared --prefix=/d/binmsvcbuild/x264
platform: X86_64
byte order: little-endian
system: WINDOWS
cli: yes
libx264: internal
shared: yes
static: no
bashcompletion: no
asm: yes
interlaced: yes
avs: yes
lavf: no
ffms: no
mp4: no
gpl: yes
thread: win32
opencl: yes
filters: crop select_every
lto: no
debug: no
gprof: no
strip: no
PIC: yes
bit depth: all
chroma format: all
You can run 'make' or 'make fprofiled' now.
cd /d/ffmpeg-vs/x264-master
export PATH=$PATH:/d/programfile/Qt/Tools/mingw810_64/bin
mingw32-make install
cd /d/binmsvcbuild/x264/lib/
cp libx264.dll.lib libx264.lib
--------------------------------------------------------
cd /d/ffmpeg-vs/FFmpeg-n4.1.11
vim build.sh
libx264_path=/d/binmsvcbuild/x264/
X264_INCLUDE=$libx264_path/include
X264_LIB=$libx264_path/lib
./configure --toolchain=msvc --arch=x86_64 --enable-yasm --enable-asm --enable-shared --disable-static --enable-libx264 --enable-gpl --extra-cflags="-I$X264_INCLUDE" --extra-ldflags="-LIBPATH:$X264_LIB" --prefix=/d/binmsvcbuild/ffmpeg
chmod +x build.sh
./build.sh
chenmin@DESKTOP-VIB3O4E MINGW64 /d/ffmpeg-vs/FFmpeg-n4.1.11
$ ./build.sh
install prefix /d/binmsvcbuild/ffmpeg
source path .
C compiler cl
C library msvcrt
ARCH x86 (generic)
big-endian no
runtime cpu detection yes
standalone assembly yes
x86 assembler nasm
MMX enabled yes
MMXEXT enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AESNI enabled yes
AVX enabled yes
AVX2 enabled yes
AVX-512 enabled yes
XOP enabled yes
FMA3 enabled yes
FMA4 enabled yes
i686 features enabled yes
CMOV is fast yes
EBX available no
EBP available no
debug symbols yes
strip symbols no
optimize for size no
optimizations yes
static no
shared yes
postprocessing support yes
network support yes
threading support w32threads
safe bitstream reader yes
texi2html enabled no
perl enabled yes
pod2man enabled no
makeinfo enabled no
makeinfo supports HTML no
External libraries:
libx264 schannel
External libraries providing hardware acceleration:
d3d11va dxva2
Libraries:
avcodec avdevice avfilter avformat avutil postproc swresample swscale
Programs:
ffmpeg ffprobe
Enabled decoders:
aac amrwb dirac h263p mp3float pcm_s32le sbc vb
aac_fixed amv dnxhd h264 mp3on4 pcm_s32le_planar scpr vble
aac_latm anm dolby_e hap mp3on4float pcm_s64be sdx2_dpcm vc1
aasc ansi dpx hevc mpc7 pcm_s64le sgi vc1image
ac3 ape dsd_lsbf hnm4_video mpc8 pcm_s8 sgirle vcr1
ac3_fixed aptx dsd_lsbf_planar hq_hqa mpeg1video pcm_s8_planar sheervideo vmdaudio
adpcm_4xm aptx_hd dsd_msbf hqx mpeg2video pcm_u16be shorten vmdvideo
adpcm_adx ass dsd_msbf_planar huffyuv mpeg4 pcm_u16le sipr vmnc
adpcm_afc asv1 dsicinaudio iac mpegvideo pcm_u24be smackaud vorbis
adpcm_aica asv2 dsicinvideo idcin mpl2 pcm_u24le smacker vp3
adpcm_ct atrac1 dss_sp idf msa1 pcm_u32be smc vp5
adpcm_dtk atrac3 dst iff_ilbm msmpeg4v1 pcm_u32le smvjpeg vp6
adpcm_ea atrac3al dvaudio ilbc msmpeg4v2 pcm_u8 snow vp6a
adpcm_ea_maxis_xa atrac3p dvbsub imc msmpeg4v3 pcm_vidc sol_dpcm vp6f
adpcm_ea_r1 atrac3pal dvdsub imm4 msrle pcm_zork sonic vp7
adpcm_ea_r2 atrac9 dvvideo indeo2 mss1 pcx sp5x vp8
adpcm_ea_r3 aura dxtory indeo3 mss2 pgm speedhq vp9
adpcm_ea_xas aura2 dxv indeo4 msvideo1 pgmyuv srt vplayer
adpcm_g722 avrn eac3 indeo5 mszh pgssub ssa vqa
adpcm_g726 avrp eacmv interplay_acm mts2 pictor stl wavpack
adpcm_g726le avs eamad interplay_dpcm mvc1 pixlet subrip webp
adpcm_ima_amv avui eatgq interplay_video mvc2 pjs subviewer webvtt
adpcm_ima_apc ayuv eatgv jacosub mxpeg ppm subviewer1 wmalossless
adpcm_ima_dat4 bethsoftvid eatqi jpeg2000 nellymoser prores sunrast wmapro
adpcm_ima_dk3 bfi eightbps jpegls nuv prosumer svq1 wmav1
adpcm_ima_dk4 bink eightsvx_exp jv on2avc psd svq3 wmav2
adpcm_ima_ea_eacs binkaudio_dct eightsvx_fib kgv1 opus ptx tak wmavoice
adpcm_ima_ea_sead binkaudio_rdft escape124 kmvc paf_audio qcelp targa wmv1
adpcm_ima_iss bintext escape130 lagarith paf_video qdm2 targa_y216 wmv2
adpcm_ima_oki bitpacked evrc loco pam qdmc text wmv3
adpcm_ima_qt bmp ffv1 m101 pbm qdraw theora wmv3image
adpcm_ima_rad bmv_audio ffvhuff mace3 pcm_alaw qpeg thp wnv1
adpcm_ima_smjpeg bmv_video ffwavesynth mace6 pcm_bluray qtrle tiertexseqvideo wrapped_avframe
adpcm_ima_wav brender_pix fic magicyuv pcm_dvd r10k tiff ws_snd1
adpcm_ima_ws c93 fits mdec pcm_f16le r210 tmv xan_dpcm
adpcm_ms cavs flac metasound pcm_f24le ra_144 truehd xan_wc3
adpcm_mtaf ccaption flic microdvd pcm_f32be ra_288 truemotion1 xan_wc4
adpcm_psx cdgraphics flv mimic pcm_f32le ralf truemotion2 xbin
adpcm_sbpro_2 cdxl fmvc mjpeg pcm_f64be rawvideo truemotion2rt xbm
adpcm_sbpro_3 cfhd fourxm mjpegb pcm_f64le realtext truespeech xface
adpcm_sbpro_4 cinepak fraps mlp pcm_lxf rl2 tscc2 xl
adpcm_swf clearvideo frwu mmvideo pcm_mulaw roq tta xma1
adpcm_thp cljr g723_1 motionpixels pcm_s16be roq_dpcm twinvq xma2
adpcm_thp_le cllc g729 movtext pcm_s16be_planar rpza txd xpm
adpcm_vima comfortnoise gdv mp1 pcm_s16le rv10 ulti xsub
adpcm_xa cook gif mp1float pcm_s16le_planar rv20 utvideo xwd
adpcm_yamaha cpia gremlin_dpcm mp2 pcm_s24be rv30 v210 y41p
aic cscd gsm mp2float pcm_s24daud rv40 v210x ylc
alac cyuv gsm_ms mp3 pcm_s24le s302m v308 yop
alias_pix dca h261 mp3adu pcm_s24le_planar sami v408 yuv4
als dds h263 mp3adufloat pcm_s32be sanm v410 zero12v
amrnb dfa h263i
Enabled encoders:
a64multi ass fits mp2fixed pcm_s16le pcm_u8 s302m v308
a64multi5 asv1 flac mpeg1video pcm_s16le_planar pcm_vidc sbc v408
aac asv2 flv mpeg2video pcm_s24be pcx sgi v410
ac3 avrp g723_1 mpeg4 pcm_s24daud pgm snow vc2
ac3_fixed avui gif msmpeg4v2 pcm_s24le pgmyuv sonic vorbis
adpcm_adx ayuv h261 msmpeg4v3 pcm_s24le_planar ppm sonic_ls wavpack
adpcm_g722 bmp h263 msvideo1 pcm_s32be prores srt webvtt
adpcm_g726 cinepak h263p nellymoser pcm_s32le prores_aw ssa wmav1
adpcm_g726le cljr huffyuv opus pcm_s32le_planar prores_ks subrip wmav2
adpcm_ima_qt comfortnoise jpeg2000 pam pcm_s64be qtrle sunrast wmv1
adpcm_ima_wav dca jpegls pbm pcm_s64le r10k svq1 wmv2
adpcm_ms dnxhd libx264 pcm_alaw pcm_s8 r210 targa wrapped_avframe
adpcm_swf dpx libx264rgb pcm_f32be pcm_s8_planar ra_144 text xbm
adpcm_yamaha dvbsub ljpeg pcm_f32le pcm_u16be rawvideo tiff xface
alac dvdsub magicyuv pcm_f64be pcm_u16le roq truehd xsub
alias_pix dvvideo mjpeg pcm_f64le pcm_u24be roq_dpcm tta xwd
amv eac3 mlp pcm_mulaw pcm_u24le rv10 utvideo y41p
aptx ffv1 movtext pcm_s16be pcm_u32be rv20 v210 yuv4
aptx_hd ffvhuff mp2 pcm_s16be_planar pcm_u32le
Enabled hwaccels:
h264_d3d11va hevc_d3d11va mpeg2_d3d11va mpeg2_dxva2 vc1_d3d11va2 vp9_d3d11va vp9_dxva2 wmv3_d3d11va2
h264_d3d11va2 hevc_d3d11va2 mpeg2_d3d11va2 vc1_d3d11va vc1_dxva2 vp9_d3d11va2 wmv3_d3d11va wmv3_dxva2
h264_dxva2 hevc_dxva2
Enabled parsers:
aac bmp dpx g729 hevc mpegvideo rv40 vorbis
aac_latm cavsvideo dvaudio gsm mjpeg opus sbc vp3
ac3 cook dvbsub h261 mlp png sipr vp8
adx dca dvd_nav h263 mpeg4video pnm tak vp9
av1 dirac dvdsub h264 mpegaudio rv30 vc1 xma
avs2 dnxhd flac
Enabled demuxers:
aa bit flic image_jpegls_pipe microdvd pcm_alaw rtp tmv
aac bmv flv image_pam_pipe mjpeg pcm_f32be rtsp truehd
ac3 boa fourxm image_pbm_pipe mjpeg_2000 pcm_f32le s337m tta
acm brstm frm image_pcx_pipe mlp pcm_f64be sami tty
act c93 fsb image_pgm_pipe mlv pcm_f64le sap txd
adf caf g722 image_pgmyuv_pipe mm pcm_mulaw sbc ty
adp cavsvideo g723_1 image_pictor_pipe mmf pcm_s16be sbg v210
ads cdg g726 image_png_pipe mov pcm_s16le scc v210x
adx cdxl g726le image_ppm_pipe mp3 pcm_s24be sdp vag
aea cine g729 image_psd_pipe mpc pcm_s24le sdr2 vc1
afc codec2 gdv image_qdraw_pipe mpc8 pcm_s32be sds vc1t
aiff codec2raw genh image_sgi_pipe mpegps pcm_s32le sdx vivo
aix concat gif image_sunrast_pipe mpegts pcm_s8 segafilm vmd
amr data gsm image_svg_pipe mpegtsraw pcm_u16be ser vobsub
amrnb daud gxf image_tiff_pipe mpegvideo pcm_u16le shorten voc
amrwb dcstr h261 image_webp_pipe mpjpeg pcm_u24be siff vpk
anm dfa h263 image_xpm_pipe mpl2 pcm_u24le sln vplayer
apc dirac h264 image_xwd_pipe mpsub pcm_u32be smacker vqf
ape dnxhd hevc ingenient msf pcm_u32le smjpeg w64
apng dsf hls ipmovie msnwc_tcp pcm_u8 smush wav
aptx dsicin hnm ircam mtaf pcm_vidc sol wc3
aptx_hd dss ico iss mtv pjs sox webm_dash_manifest
aqtitle dts idcin iv8 musx pmp spdif webvtt
asf dtshd idf ivf mv pva srt wsaud
asf_o dv iff ivr mvi pvf stl wsd
ass dvbsub ilbc jacosub mxf qcp str wsvqa
ast dvbtxt image2 jv mxg r3d subviewer wtv
au dxa image2_alias_pix live_flv nc rawvideo subviewer1 wv
avi ea image2_brender_pix lmlm4 nistsphere realtext sup wve
avr ea_cdata image2pipe loas nsp redspark svag xa
avs eac3 image_bmp_pipe lrc nsv rl2 swf xbin
avs2 epaf image_dds_pipe lvf nut rm tak xmv
bethsoftvid ffmetadata image_dpx_pipe lxf nuv roq tedcaptions xvag
bfi filmstrip image_exr_pipe m4v ogg rpl thp xwma
bfstm fits image_j2k_pipe matroska oma rsd threedostr yop
bink flac image_jpeg_pipe mgsts paf rso tiertexseq yuv4mpegpipe
bintext
Enabled muxers:
a64 codec2raw g722 ismv mpeg1video pcm_f64be rm swf
ac3 crc g723_1 ivf mpeg2dvd pcm_f64le roq tee
adts dash g726 jacosub mpeg2svcd pcm_mulaw rso tg2
adx data g726le latm mpeg2video pcm_s16be rtp tgp
aiff daud gif lrc mpeg2vob pcm_s16le rtp_mpegts truehd
amr dirac gsm m4v mpegts pcm_s24be rtsp tta
apng dnxhd gxf matroska mpjpeg pcm_s24le sap uncodedframecrc
aptx dts h261 matroska_audio mxf pcm_s32be sbc vc1
aptx_hd dv h263 md5 mxf_d10 pcm_s32le scc vc1t
asf eac3 h264 microdvd mxf_opatom pcm_s8 segafilm voc
asf_stream f4v hash mjpeg null pcm_u16be segment w64
ass ffmetadata hds mkvtimestamp_v2 nut pcm_u16le singlejpeg wav
ast fifo hevc mlp oga pcm_u24be smjpeg webm
au fifo_test hls mmf ogg pcm_u24le smoothstreaming webm_chunk
avi filmstrip ico mov ogv pcm_u32be sox webm_dash_manifest
avm2 fits ilbc mp2 oma pcm_u32le spdif webp
avs2 flac image2 mp3 opus pcm_u8 spx webvtt
bit flv image2pipe mp4 pcm_alaw pcm_vidc srt wtv
caf framecrc ipod mpeg1system pcm_f32be psp stream_segment wv
cavsvideo framehash ircam mpeg1vcd pcm_f32le rawvideo sup yuv4mpegpipe
codec2 framemd5
Enabled protocols:
async data gopher https mmst rtmps srtp tls
cache ffrtmphttp hls icecast pipe rtmpt subfile udp
concat file http md5 prompeg rtmpts tcp udplite
crypto ftp httpproxy mmsh rtmp rtp tee
Enabled filters:
abench anull chromakey earwax hqdn3d nlmeans scale stereowiden
abitscope anullsink ciescope ebur128 hqx nnedi scale2ref streamselect
acompressor anullsrc codecview edgedetect hstack noformat select super2xsai
acontrast apad color elbg hue noise selectivecolor superequalizer
acopy aperms colorbalance entropy hwdownload normalize sendcmd surround
acrossfade aphasemeter colorchannelmixer eq hwmap null separatefields swaprect
acrossover aphaser colorkey equalizer hwupload nullsink setdar swapuv
acrusher apulsator colorlevels erosion hysteresis nullsrc setfield tblend
acue arealtime colormatrix extractplanes idet oscilloscope setparams telecine
adeclick aresample colorspace extrastereo il overlay setpts testsrc
adeclip areverse compand fade inflate owdenoise setrange testsrc2
adelay aselect compensationdelay fftdnoiz interlace pad setsar threshold
aderivative asendcmd concat fftfilt interleave pal100bars settb thumbnail
adrawgraph asetnsamples convolution field join pal75bars showcqt tile
aecho asetpts convolve fieldhint kerndeint palettegen showfreqs tinterlace
aemphasis asetrate copy fieldmatch lenscorrection paletteuse showinfo tlut2
aeval asettb cover_rect fieldorder life pan showpalette tmix
aevalsrc ashowinfo crop fifo limiter perms showspectrum tonemap
afade asidedata cropdetect fillborders loop perspective showspectrumpic transpose
afftdn asplit crossfeed find_rect loudnorm phase showvolume treble
afftfilt astats crystalizer firequalizer lowpass pixdesctest showwaves tremolo
afifo astreamselect cue flanger lowshelf pixscope showwavespic trim
afir atadenoise curves floodfill lumakey pp shuffleframes unpremultiply
aformat atempo datascope format lut pp7 shuffleplanes unsharp
agate atrim dcshift fps lut1d premultiply sidechaincompress uspp
agraphmonitor avectorscope dctdnoiz framepack lut2 prewitt sidechaingate vaguedenoiser
ahistogram avgblur deband framerate lut3d pseudocolor sidedata vectorscope
aiir bandpass deblock framestep lutrgb psnr signalstats vflip
aintegral bandreject decimate fspp lutyuv pullup signature vfrdet
ainterleave bass deconvolve gblur mandelbrot qp silencedetect vibrance
alimiter bbox deflate geq maskedclamp random silenceremove vibrato
allpass bench deflicker gradfun maskedmerge readeia608 sinc vignette
allrgb biquad dejudder graphmonitor mcdeint readvitc sine vmafmotion
allyuv bitplanenoise delogo greyedge mcompand realtime smartblur volume
aloop blackdetect deshake haas mergeplanes remap smptebars volumedetect
alphaextract blackframe despill haldclut mestimate removegrain smptehdbars vstack
alphamerge blend detelecine haldclutsrc metadata removelogo sobel w3fdif
amerge bm3d dilation hdcd midequalizer repeatfields spectrumsynth waveform
ametadata boxblur displace headphone minterpolate replaygain split weave
amix bwdif doubleweave hflip mix reverse spp xbr
amovie cellauto drawbox highpass movie rgbtestsrc sr xstack
amplify channelmap drawgraph highshelf mpdecimate roberts ssim yadif
amultiply channelsplit drawgrid hilbert mptestsrc rotate stereo3d yuvtestsrc
anequalizer chorus drmeter histeq negate sab stereotools zoompan
anoisesrc chromahold dynaudnorm histogram
Enabled bsfs:
aac_adtstoasc dump_extradata h264_metadata hevc_metadata mjpega_dump_header mpeg4_unpack_bframes text2movsub vp9_raw_reorder
av1_metadata eac3_core h264_mp4toannexb hevc_mp4toannexb mov2textsub noise trace_headers vp9_superframe
chomp extract_extradata h264_redundant_pps imx_dump_header mp3_header_decompress null vp9_metadata vp9_superframe_split
dca_core filter_units hapqa_extract mjpeg2jpeg mpeg2_metadata remove_extradata
Enabled indevs:
dshow gdigrab lavfi vfwcap
Enabled outdevs:
License: GPL version 2 or later
WARNING: The --enable-yasm option is only provided for compatibility and will be
removed in the future. Use --enable-x86asm / --disable-x86asm instead.
WARNING: pkg-config not found, library detection may fail.
WARNING: using libx264 without pkg-config
-----
then run:
mingw32-make
$ mingw32-make
GEN libavutil/libavutil.version
GEN libswscale/libswscale.version
GEN libswresample/libswresample.version
GEN libpostproc/libpostproc.version
GEN libavcodec/libavcodec.version
GEN libavformat/libavformat.version
GEN libavfilter/libavfilter.version
GEN libavdevice/libavdevice.version
awk: cmd. line:1: /including/ { sub(/^.*file: */, ""); gsub(//, "/"); if (!match($0, / /)) print "libavdevice/alldevices.o:", $0 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: /including/ { sub(/^.*file: */, ""); gsub(//, "/"); if (!match($0, / /)) print "libavdevice/alldevices.o:", $0 }
awk: cmd. line:1: ^ unterminated string
to fix error above,
修改 ffbuild/common.mak,大约在第47行:
define COMPILE
$(call $(1)DEP,$(1)) # 把这行删掉
$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
endef
若出现下面错误:
ibavcodec/xwdenc.o libavcodec/xxan.o libavcodec/y41pdec.o libavcodec/y41penc.o libavcodec/ylc.o libavcodec/yop.o libavcodec/yuv4dec.o libavcodec/yuv4enc.o > libavcodec/avcodec-58.def
Object does not exist: libavcod
mingw32-make: *** [ffbuild/library.mak:102: libavcodec/avcodec-58.dll] Error 1
将ffbuild/library.mak第52行的$(SLIB_CREATE_DEF_CMD)打印出来后,然后注释掉52行,手动执行52行所代表的命令,然后恢复52行。libavcodec,libavformat,libavfilter模块由于文件过多,这行在脚本里会执行失败,所以要手动执行。同时$$(LD)替换成 ./compat/windows/mslink
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD) #手动执行,删掉,make,加回来,make,删掉,make,加回来。。。。,如此循环执行
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) #$$(LD)替换成 ./compat/windows/mslink
$(SLIB_EXTRA_CMD)