libx264 컴파일 compile

Tip 2020. 2. 21. 18:10

VideoLan에서 제공하는 x264를 사용하기 위해 컴파일과정 정리

 

1.  MinGW 설치

 

https://blog.naver.com/ppusarida/40166426679

 

Mingw / msys 설치

원도우에 Mingw 설치. 다운로드: http://sourceforge.net/projects/mingw/files/ - Looking for the late...

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 설정을 활성화하여 컴파일 하는 것이 가능함

 

https://www.nasm.us/

 

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. 프로젝트에 라이브러리 포함시켜 컴파일 및 사용

 

 

 

기본 참조

 

https://m.blog.naver.com/PostView.nhn?blogId=ppusarida&logNo=40166611473&proxyReferer=http%3A%2F%2Fwww.google.com%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3D%26esrc%3Ds%26source%3Dweb%26cd%3D2%26ved%3D2ahUKEwiw54zXhN_nAhUvy4sBHTv6CNoQFjABegQIAhAB%26url%3Dhttp%253A%252F%252Fm.blog.naver.com%252Fppusarida%252F40166611473%26usg%3DAOvVaw3SyKKW5unfU6zUGUi1Yl5k

Posted by 휘프노스
,