VideoLan에서 제공하는 x264를 사용하기 위해 컴파일과정 정리
1. MinGW 설치
https://blog.naver.com/ppusarida/40166426679
blog.naver.com
2. x264 다운로드
https://www.videolan.org/developers/x264.html
x264, the best H.264/AVC encoder - VideoLAN
VideoLAN VLC Projects Contribute Support x264 Features Overview Provides best-in-class performance, compression, and features. Achieves dramatic performance, encoding 4 or more 1080p streams in realtime on a single consumer-level computer. Gives the best q
www.videolan.org
최신 소스코드 레포지토리
# git clone https://code.videolan.org/videolan/x264.git
VideoLAN / x264
x264, the best and fastest H.264 encoder
code.videolan.org
소스코드 다운로드는 MinGW\msys\1.0\home
아래에 위치하게 다운로드 한다.
3. msys shell 실행
설치된 MinGW의 msys shell 을 실행한다.
쉘 프롬프트 상태에서
$ ./configure --disable-asm --disable-cli --enable-shared --extra-ldflags=-Wl,--output-def=libx264.def
설정에 오류가 없으면
$ make
정상적으로 완료되면 libx264-159.dll 생성
'-' 뒤의 숫자는 빌드번호이므로 그때그때 달라짐
어셈블리 사용법은 좀더 찾아봐야함
nasm 실행파일을 아래 사이트에서 다운로드 받아서
MinGW\bin 에 카피하면 asm 설정을 활성화하여 컴파일 하는 것이 가능함
NASM
Latest version For users of RPM-based Linux distributions (e.g. Fedora, Red Hat, SUSE, ...), you can download the official NASM builds using dnf or yum by installing nasm.repo in your /etc/yum/yum.repos.d directory.
www.nasm.us
4. 컴파일용 libx264.lib 생성
MSVC에서 프로젝트에 포함시킬 libx264.lib를 생성하려면
Visual Studio 의 Visual C++에 들어있는 vcvars32.bat 를 실행하여 컴파일 링크 환경 설정
위에 설정했던 .def 파일을 이용해 DLL링크 컴파일용 lib 생성
> lib /DEF:libx264.def
여기까지 완료하면 libx264.lib 생성됨
5. 프로젝트에 라이브러리 포함시켜 컴파일 및 사용
기본 참조
'Tip' 카테고리의 다른 글
무료 음원 제공 사이트 (0) | 2021.10.24 |
---|---|
온라인 코드 연습 사이트 (0) | 2020.05.20 |
BACNET 개발에 필요한 사항들 (3) | 2018.10.18 |
윈도우에서 계정암호없이 원격접속 설정하기 (0) | 2017.06.10 |
Mysql Insert 시 max 지정 방법 (0) | 2016.04.22 |