티스토리 뷰

728x90

출처

MSYS2 설치

https://www.msys2.org/ 설치본 다운로드

git 설치

$ pacman -S git

컴파일 도구 설치

$ pacman -S diffutils make pkg-config yasm mingw-w64-x86_64-autotools

x64 Native Tools Command Prompt for VS 2022 실행(msvc 환경)후 mingw 환경 실행

C:\Program Files\Microsoft Visual Studio\2022\Enterprise>D:\msys64\msys2_shell.cmd -msys -use-full-path

소스 다운로드

nv-codec-headers 소스 다운로드

$ git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git

ffmpeg 소스 다운로드

$ git clone https://git.ffmpeg.org/ffmpeg.git

PREFIX 경로 /usr 설정

$ make install PREFIX=/usr
sed 's#@@PREFIX@@#D:/msys64/usr#' ffnvcodec.pc.in > ffnvcodec.pc
install -m 0755 -d '/usr/include/ffnvcodec'
install -m 0644 include/ffnvcodec/*.h '/usr/include/ffnvcodec'
install -m 0755 -d '/usr/lib/pkgconfig'
install -m 0644 ffnvcodec.pc '/usr/lib/pkgconfig'

환경 설정(.bash_profile 마지막에 추가)

export LIB=/C/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Tools/MSVC/14.36.32532/lib/x64:/C/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/SDK/ScopeCppSDK/vc15/SDK/lib
export LIBPATH=/C/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Tools/MSVC/14.36.32532/lib/x64:/C/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/SDK/ScopeCppSDK/vc15/SDK/lib

configure 실행

$ ./configure --enable-nonfree --disable-shared --enable-cuda-nvcc --enable-libnpp --toolchain=msvc --extra-cflags=-I../nv_sdk --extra-cflags=-I../nv_sdk/include/ --extra-ldflags=-libpath:../nv_sdk --extra-ldflags=-libpath:../nv_sdk/lib/x64 --arch=x86_64

ffmpeg 컴파일

$ make -j$(nproc)

확인

$ ffmpeg -version
ffmpeg version N-111746-gd53acf452f Copyright (c) 2000-2023 the FFmpeg developers
built with Microsoft (R) C/C++ 최적화 컴파일러 버전 19.36.32537(x64)
configuration: --enable-nonfree --disable-shared --enable-cuda-nvcc --enable-libnpp --toolchain=ms
vc --enable-filter=drawtext --extra-cflags=-I../nv_sdk --extra-cflags=-I../nv_sdk/include/ --extra
-ldflags='-libpath:../nv_sdk' --extra-ldflags='-libpath:../nv_sdk/lib/x64' --arch=x86_64
libavutil      58. 16.101 / 58. 16.101
libavcodec     60. 23.100 / 60. 23.100
libavformat    60. 10.100 / 60. 10.100
libavdevice    60.  2.101 / 60.  2.101
libavfilter     9. 10.100 /  9. 10.100
libswscale      7.  3.100 /  7.  3.100
libswresample   4. 11.100 /  4. 11.100

ffmpeg 설치

bluesanta@DESKTOP-PJENQJG MSYS ~/ffmpeg
$ make install
INSTALL doc/ffmpeg.1
INSTALL doc/ffprobe.1
INSTALL doc/ffmpeg-all.1
INSTALL doc/ffprobe-all.1
INSTALL doc/ffmpeg-utils.1
INSTALL doc/ffmpeg-scaler.1
INSTALL doc/ffmpeg-resampler.1
INSTALL doc/ffmpeg-codecs.1
INSTALL doc/ffmpeg-bitstream-filters.1
INSTALL doc/ffmpeg-formats.1
INSTALL doc/ffmpeg-protocols.1
INSTALL doc/ffmpeg-devices.1
INSTALL doc/ffmpeg-filters.1
INSTALL doc/libavutil.3
INSTALL doc/libswscale.3
INSTALL doc/libswresample.3
INSTALL doc/libavcodec.3
INSTALL doc/libavformat.3
INSTALL doc/libavdevice.3
INSTALL doc/libavfilter.3
INSTALL doc/ffmpeg.1
INSTALL doc/ffprobe.1
INSTALL doc/ffmpeg-all.1
INSTALL doc/ffprobe-all.1
INSTALL doc/ffmpeg-utils.1
INSTALL doc/ffmpeg-scaler.1
INSTALL doc/ffmpeg-resampler.1
INSTALL doc/ffmpeg-codecs.1
INSTALL doc/ffmpeg-bitstream-filters.1
INSTALL doc/ffmpeg-formats.1
INSTALL doc/ffmpeg-protocols.1
INSTALL doc/ffmpeg-devices.1
INSTALL doc/ffmpeg-filters.1
INSTALL doc/libavutil.3
INSTALL doc/libswscale.3
INSTALL doc/libswresample.3
INSTALL doc/libavcodec.3
INSTALL doc/libavformat.3
INSTALL doc/libavdevice.3
INSTALL doc/libavfilter.3
INSTALL install-progs-yes
INSTALL ffmpeg.exe
INSTALL ffprobe.exe
INSTALL presets/libvpx-1080p.ffpreset
INSTALL presets/libvpx-1080p50_60.ffpreset
INSTALL presets/libvpx-360p.ffpreset
INSTALL presets/libvpx-720p.ffpreset
INSTALL presets/libvpx-720p50_60.ffpreset
INSTALL doc/ffprobe.xsd
INSTALL doc/examples/avio_http_serve_files.c
INSTALL doc/examples/avio_list_dir.c
INSTALL doc/examples/avio_read_callback.c
INSTALL doc/examples/decode_audio.c
INSTALL doc/examples/decode_filter_audio.c
INSTALL doc/examples/decode_filter_video.c
INSTALL doc/examples/decode_video.c
INSTALL doc/examples/demux_decode.c
INSTALL doc/examples/encode_audio.c
INSTALL doc/examples/encode_video.c
INSTALL doc/examples/extract_mvs.c
INSTALL doc/examples/filter_audio.c
INSTALL doc/examples/hw_decode.c
INSTALL doc/examples/mux.c
INSTALL doc/examples/qsv_decode.c
INSTALL doc/examples/qsv_transcode.c
INSTALL doc/examples/remux.c
INSTALL doc/examples/resample_audio.c
INSTALL doc/examples/scale_video.c
INSTALL doc/examples/show_metadata.c
INSTALL doc/examples/transcode.c
INSTALL doc/examples/transcode_aac.c
INSTALL doc/examples/vaapi_encode.c
INSTALL doc/examples/vaapi_transcode.c
INSTALL doc/examples/README
INSTALL doc/examples/Makefile
INSTALL doc/examples/avio_http_serve_files.c
INSTALL doc/examples/avio_list_dir.c
INSTALL doc/examples/avio_read_callback.c
INSTALL doc/examples/decode_audio.c
INSTALL doc/examples/decode_filter_audio.c
INSTALL doc/examples/decode_filter_video.c
INSTALL doc/examples/decode_video.c
INSTALL doc/examples/demux_decode.c
INSTALL doc/examples/encode_audio.c
INSTALL doc/examples/encode_video.c
INSTALL doc/examples/extract_mvs.c
INSTALL doc/examples/filter_audio.c
INSTALL doc/examples/hw_decode.c
INSTALL doc/examples/mux.c
INSTALL doc/examples/qsv_decode.c
INSTALL doc/examples/qsv_transcode.c
INSTALL doc/examples/remux.c
INSTALL doc/examples/resample_audio.c
INSTALL doc/examples/scale_video.c
INSTALL doc/examples/show_metadata.c
INSTALL doc/examples/transcode.c
INSTALL doc/examples/transcode_aac.c
INSTALL doc/examples/vaapi_encode.c
INSTALL doc/examples/vaapi_transcode.c
INSTALL doc/examples/README
INSTALL doc/examples/Makefile
INSTALL libavdevice/libavdevice.a
INSTALL libavfilter/libavfilter.a
INSTALL libavformat/libavformat.a
INSTALL libavcodec/libavcodec.a
INSTALL libswresample/libswresample.a
INSTALL libswscale/libswscale.a
INSTALL libavutil/libavutil.a
INSTALL libavdevice/avdevice.h
INSTALL libavdevice/version.h
INSTALL libavdevice/version_major.h
INSTALL libavdevice/libavdevice.pc
INSTALL libavfilter/avfilter.h
INSTALL libavfilter/buffersink.h
INSTALL libavfilter/buffersrc.h
INSTALL libavfilter/version.h
INSTALL libavfilter/version_major.h
INSTALL libavfilter/libavfilter.pc
INSTALL libavformat/avformat.h
INSTALL libavformat/avio.h
INSTALL libavformat/version.h
INSTALL libavformat/version_major.h
INSTALL libavformat/libavformat.pc
INSTALL libavcodec/ac3_parser.h
INSTALL libavcodec/adts_parser.h
INSTALL libavcodec/avcodec.h
INSTALL libavcodec/avdct.h
INSTALL libavcodec/avfft.h
INSTALL libavcodec/bsf.h
INSTALL libavcodec/codec.h
INSTALL libavcodec/codec_desc.h
INSTALL libavcodec/codec_id.h
INSTALL libavcodec/codec_par.h
INSTALL libavcodec/d3d11va.h
INSTALL libavcodec/defs.h
INSTALL libavcodec/dirac.h
INSTALL libavcodec/dv_profile.h
INSTALL libavcodec/dxva2.h
INSTALL libavcodec/jni.h
INSTALL libavcodec/mediacodec.h
INSTALL libavcodec/packet.h
INSTALL libavcodec/qsv.h
INSTALL libavcodec/vdpau.h
INSTALL libavcodec/version.h
INSTALL libavcodec/version_major.h
INSTALL libavcodec/videotoolbox.h
INSTALL libavcodec/vorbis_parser.h
INSTALL libavcodec/xvmc.h
INSTALL libavcodec/libavcodec.pc
INSTALL libswresample/swresample.h
INSTALL libswresample/version.h
INSTALL libswresample/version_major.h
INSTALL libswresample/libswresample.pc
INSTALL libswscale/swscale.h
INSTALL libswscale/version.h
INSTALL libswscale/version_major.h
INSTALL libswscale/libswscale.pc
INSTALL libavutil/adler32.h
INSTALL libavutil/aes.h
INSTALL libavutil/aes_ctr.h
INSTALL libavutil/ambient_viewing_environment.h
INSTALL libavutil/attributes.h
INSTALL libavutil/audio_fifo.h
INSTALL libavutil/avassert.h
INSTALL libavutil/avstring.h
INSTALL libavutil/avutil.h
INSTALL libavutil/base64.h
INSTALL libavutil/blowfish.h
INSTALL libavutil/bprint.h
INSTALL libavutil/bswap.h
INSTALL libavutil/buffer.h
INSTALL libavutil/cast5.h
INSTALL libavutil/camellia.h
INSTALL libavutil/channel_layout.h
INSTALL libavutil/common.h
INSTALL libavutil/cpu.h
INSTALL libavutil/crc.h
INSTALL libavutil/csp.h
INSTALL libavutil/des.h
INSTALL libavutil/detection_bbox.h
INSTALL libavutil/dict.h
INSTALL libavutil/display.h
INSTALL libavutil/dovi_meta.h
INSTALL libavutil/downmix_info.h
INSTALL libavutil/encryption_info.h
INSTALL libavutil/error.h
INSTALL libavutil/eval.h
INSTALL libavutil/fifo.h
INSTALL libavutil/file.h
INSTALL libavutil/frame.h
INSTALL libavutil/hash.h
INSTALL libavutil/hdr_dynamic_metadata.h
INSTALL libavutil/hdr_dynamic_vivid_metadata.h
INSTALL libavutil/hmac.h
INSTALL libavutil/hwcontext.h
INSTALL libavutil/hwcontext_cuda.h
INSTALL libavutil/hwcontext_d3d11va.h
INSTALL libavutil/hwcontext_drm.h
INSTALL libavutil/hwcontext_dxva2.h
INSTALL libavutil/hwcontext_qsv.h
INSTALL libavutil/hwcontext_mediacodec.h
INSTALL libavutil/hwcontext_opencl.h
INSTALL libavutil/hwcontext_vaapi.h
INSTALL libavutil/hwcontext_videotoolbox.h
INSTALL libavutil/hwcontext_vdpau.h
INSTALL libavutil/hwcontext_vulkan.h
INSTALL libavutil/imgutils.h
INSTALL libavutil/intfloat.h
INSTALL libavutil/intreadwrite.h
INSTALL libavutil/lfg.h
INSTALL libavutil/log.h
INSTALL libavutil/lzo.h
INSTALL libavutil/macros.h
INSTALL libavutil/mathematics.h
INSTALL libavutil/mastering_display_metadata.h
INSTALL libavutil/md5.h
INSTALL libavutil/mem.h
INSTALL libavutil/motion_vector.h
INSTALL libavutil/murmur3.h
INSTALL libavutil/opt.h
INSTALL libavutil/parseutils.h
INSTALL libavutil/pixdesc.h
INSTALL libavutil/pixelutils.h
INSTALL libavutil/pixfmt.h
INSTALL libavutil/random_seed.h
INSTALL libavutil/rc4.h
INSTALL libavutil/rational.h
INSTALL libavutil/replaygain.h
INSTALL libavutil/ripemd.h
INSTALL libavutil/samplefmt.h
INSTALL libavutil/sha.h
INSTALL libavutil/sha512.h
INSTALL libavutil/spherical.h
INSTALL libavutil/stereo3d.h
INSTALL libavutil/threadmessage.h
INSTALL libavutil/time.h
INSTALL libavutil/timecode.h
INSTALL libavutil/timestamp.h
INSTALL libavutil/tree.h
INSTALL libavutil/twofish.h
INSTALL libavutil/uuid.h
INSTALL libavutil/version.h
INSTALL libavutil/video_enc_params.h
INSTALL libavutil/xtea.h
INSTALL libavutil/tea.h
INSTALL libavutil/tx.h
INSTALL libavutil/film_grain_params.h
INSTALL libavutil/video_hint.h
INSTALL libavutil/avconfig.h
INSTALL libavutil/ffversion.h
INSTALL libavutil/libavutil.pc

lame 빌드 실패 이력

$ export AR=lib.exe
$ export LD=link.exe
$ export MP3LAME_VERSION=3.100
$ export MP3LAME_URL="https://sourceforge.net/projects/lame/files/lame/$MP3LAME_VERSION/lame-$MP3LAME_VERSION.tar.gz/download"
$ export MP3LAME_SHA256=ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e
$ wget -O lame.tar.gz "$MP3LAME_URL" && echo "$MP3LAME_SHA256 lame.tar.gz" | sha256sum --status -c -
$ tar xfz lame.tar.gz
$ cd lame-3.100/
$ ./configure --prefix=/mingw64 --disable-shared --enable-static
$ make
make  all-recursive
make[1]: Entering directory '/home/bluesanta/ffmpeg_sources/lame-3.100'
Making all in mpglib
make[2]: Entering directory '/home/bluesanta/ffmpeg_sources/lame-3.100/mpglib'
/bin/sh ../libtool  --tag=CC   --mode=link /home/bluesanta/ffmpeg_sources/lame-3.100/compile cl.exe     -o libmpgdecoder.la  common.lo dct64_i386.lo decode_i386.lo interface.lo layer1.lo layer2.lo layer3.lo tabinit.lo
libtool: link: lib.exe cru .libs/libmpgdecoder.a  common.obj dct64_i386.obj decode_i386.obj interface.obj layer1.obj layer2.obj layer3.obj tabinit.obj
Microsoft (R) Library Manager Version 14.36.32537.0
Copyright (C) Microsoft Corporation.  All rights reserved.
 
LINK : fatal error LNK1181: 'cru' 입력 파일을 열 수 없습니다.
make[2]: *** [Makefile:411: libmpgdecoder.la] Error 157
make[2]: Leaving directory '/home/bluesanta/ffmpeg_sources/lame-3.100/mpglib'
make[1]: *** [Makefile:452: all-recursive] Error 1
make[1]: Leaving directory '/home/bluesanta/ffmpeg_sources/lame-3.100'
make: *** [Makefile:381: all] Error 2
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함