⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cygwin-compile.txt

📁 这是一个很好的文档
💻 TXT
📖 第 1 页 / 共 4 页
字号:
Create a new text document with 2 following lines:

"C:\Program Files\Subversion\bin\svn" checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg-trunk
pause

Save as filename in your "scripts" folder at your download/install location:

update-ffmpeg.bat

Copy the script file into your Cygwin "home directory":

C:\cygwin\home\Administrator


5.3      "Checking out" the latest source code from SVN
=======================================================

Double click the following batch file in your home folder:

update-vlc.bat          (example)

This will download the current "subversion trunk" (latest code) into your
home directory into the directory specified in the batchfile:

C:\cygwin\home\Administrator\vlc-trunk          (example)

The pause line in the batchfile will make sure the result like "Checked out
revision 15916" is shown on the screen.

The vlc-trunk folder will get over-written/updated the next time you run the
.bat file. If you want to save a so called "snapshot" of the existing
vlc-trunk, rename or copy the current directory into something desired (like
20050624-vlc-trunk).

NOTE: Updating the source code for additional libraries such as x264, FFmpeg
etc. is done by running their corresponding .bat files.


5.4      Extracting the source from a "snapshot"
================================================

If you are not using SVN to obtain the latest source code but are using a daily
"snapshot" then copy that source package from your download/install location to
the Cygwin home directory:

C:\cygwin\home\Administrator

Start Cygwin and enter the following command in your shell:

tar xvf vlc-snapshot-20060616.tar.gz          (example)

Replace with your version of the source package.

This will extract the contents of the file into a subfolder within your
Cygwin environment with the naming convention something like:

vlc-0.8.6-svn        (example)


6        Installing the "contrib" package in Cygwin
===================================================

First the additional libraries have to be "installed" in Cygwin.


6.1      Extracting the "contrib" package
=========================================

Copy the "contrib" package from your download/install location to the home directory:

C:\cygwin\home\Administrator

Start Cygwin and enter the following command in your shell:

tar xjvf contrib-20060526-win32-bin-gcc-3.4.5-only.tar.bz2 -C /          (example)

Replace with your version of the "contrib" file and DON'T FORGET THE / (backslash)
at the end.

This will extract the contents of the file into usr/win32 folder within your Cygwin
environment.

NOTE: Make sure to DELETE your old version instead of extracting a new version on
top of it.


6.2      Keeping the "contrib" up-to-date
=========================================

For maintenance purposes periodically check:

http://download.videolan.org/pub/testing/win32/

to see if a newer "contrib" is available. If that is the case you should DELETE
the existing directory structure which is for the precompiled "contrib" package:

C:\cygwin\usr\win32          (example)

Download the newer file and follow the installation instructions the same as
before so you will end up with the most up-to-date version.

NOTE: Make sure to DELETE your old version instead of extracting a new version
on top of it.


7        Configure scripts
==========================

In order to make our lives just a bit easier the following section describes
what commandline options should be used for compiling and those commands will
then be put into a "script" that can be executed (rather than having to copy
and paste all the time).


7.1      Configure script for compiling VLC
===========================================

Create a new text document with the following lines:

  ./bootstrap && \
  CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
  LDFLAGS=-L/usr/win32/lib \
  PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig \
  CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" \
  ./configure \
      --enable-sdl --with-sdl-config-path=/usr/win32/bin --disable-gtk \
      --enable-nls \
      --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
      --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
      --with-wx-config-path=/usr/win32/bin \
      --with-freetype-config-path=/usr/win32/bin \
      --with-fribidi-config-path=/usr/win32/bin \
      --enable-live555 --with-live555-tree=/usr/win32/live.com \
      --enable-caca --with-caca-config-path=/usr/win32/bin \
      --with-xml2-config-path=/usr/win32/bin \
      --with-dvdnav-config-path=/usr/win32/bin \
      --disable-cddax --disable-vcdx --enable-goom \
      --enable-twolame --enable-dvdread \
      --disable-gnomevfs \
      --enable-dts \
      --enable-debug \

NOTE: The following option is added for DTS Coherent Acoustics streams
decoding support. The latest "contrib" package should already contain
libdca (formerly known as libdts) needed to compile this but at present
it's disabled by default:

--enable-dts

NOTE: The following option is added for debug purposes and makes the final
package a bit larger but the advantage is it's easier to debug in case of
crash reports:

--enable-debug

Save as filename in your "scripts" folder at your download/install location:

configure-vlc

NOTE: This file does not have an extension (save using "All files" and not 
"Text files" otherwise Windows might append the extension .txt)

Copy the file into your home directory:

C:\cygwin\home\Administrator  


7.1.1    POSIX emulation layer
==============================

VLC can be built with or without the so called POSIX emulation layer.
Without is the default and is usually better (and with hasn't been tested
for quite some time). If you do want to use the emulation layer, then just
leave out the line with the following options:

CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin"


7.1.2    VLC optional settings
==============================

The following option should be used when compiling using the GCC 3.4 version
with older "contrib" gcc-3.3.1-only:

--disable-mkv


7.2      Configure scripts for compiling additional libraries
=============================================================

The following section is optional. The "contrib" package contains precompiled
libraries but it is possible to update some of those libraries to the most
current versions such as x264 (used for H.264 encoding) and FFmpeg.


7.2.1    FFmpeg with AMR support
================================

The AMR (Adaptive Multi Rate) codec is designed to encode and decode speech
with acceptable quality for transmission over relatively low bandwidth
channels with minimal latency, typically used in mobile networks (3GP) or
voice message applications.

The AMR codec is usually referred to as:

- Narrow Band (AMR-NB, fourcc samr) for low quality
- Wide Band (AMR-WB, fourcc samw) for high quality

The sources for AMR are not compatible with the GPL (General Public License).
AMR support is disabled by default.


7.2.1.1  Getting the AMR reference codecs
=========================================

The AMR reference codecs can be found on the 3GPP site http://www.3gpp.org at
the following download location for zipped source code packages:

http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/

Download the following 3 packages to a subfolder in your download/install location:

C:\Downloads\VLC\src          (example)

1.  AMR - latest 26073 package:

http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26073-530.zip          (example)

3GPP TS 26.073 V5.3.0 (2004-03) ANSI-C code for the
Adaptive Multi Rate (AMR) speech codec (Release 5)

2.  AMR_FLOAT - latest 26104 package:

http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26104-540.zip          (example)

3GPP TS 26.104 V 5.4.0 (2004-03) ANSI-C code for the
Floating-point Adaptive Multi Rate (AMR) speech codec (Release 5)

3.  AMRWB_FLOAT - latest 26204 package:

http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26204-520.zip          (example)

3GPP TS 26.204 V5.2.0 (2003-09) ANSI-C code for
Floating-point Adaptive Multi Rate Wideband (AMR-WB) speech codec (Release 5)


7.2.1.2  Extracting the AMR reference codecs
============================================

The following AMR reference packages should now be in your download/install location:

26073-530.zip          (example)
26104-540.zip          (example)
26204-520.zip          (example)

Using your favourite unzipper (Windows internal extraction wizard, WinZIP,
WinRAR etc.) extract the zip files in the into the current folder (Windows
wizard would use "Extract All" and WinZIP or WinRAR would use "Extract to
'foldername' which is the same as the .zip package name").

This will create the following folders:

C:\Downloads\VLC\src\26073-530         
C:\Downloads\VLC\src\26104-540         
C:\Downloads\VLC\src\26204-520         

Within those folders another .zip package exists. Again unpack those zip files
into the current folder:

26073-530_ANSI_C_source_code      
26104-540_ANSI_C_source_code      
26204-520_ANSI-C_source_code      

Now each unpacked source code package has an individual folder named "c-code".

Rename the c-code subfolders within each package to amr, amr_float and amrwb_float:

C:\Downloads\VLC\src\26073-530\26073-530_ANSI_C_source_code\c-code to amr                  
C:\Downloads\VLC\src\26104-540\26104-540_ANSI_C_source_code\c-code to amr_float            
C:\Downloads\VLC\src\26204-520\26204-520_ANSI-C_source_code\c-code to amrwb_float          

NOTE: the 530, 540 to 520 order looks a bit confusing but those are actually
just version numbers and the folders are shown in the correct alphabetical order.

Copy each of the the following folders (including content, so just select the
whole folders itself):

amr                
amr_float         
amrwb_float       

to the Cygwin home directory in the libavcodec subfolder of where the FFmpeg
package resides:

C:\cygwin\home\Administrator\ffmpeg-trunk\libavcodec          (example)


7.2.2    FFmpeg configure script with "contrib" package
=======================================================

NOTE: This compile script assumes you are also using the same FFmpeg version
as is used in the "contrib" package (this is why the cflags and ldflags also
point to the win32 folder where the "contrib" package was extracted).

Create a new text document with the following lines:

./configure --enable-mingw32 --enable-memalign-hack \
    --extra-cflags=-I/usr/win32/include \
    --extra-ldflags=-L/usr/win32/lib \
    --prefix=/usr/win32 \
    --cc="gcc -mno-cygwin" \
    --enable-faac --enable-mp3lame --enable-pp --enable-gpl --log \

NOTE: For AMR encoding/decoding support also add the following options:

--enable-amr_nb --enable-amr_wb

NOTE: VLC uses the x264 lib directly and not through ffmpeg so there is
no need to add --enable-x264

Save as filename in your "scripts" folder at your download/install location:

configure-ffmpeg          (example)

NOTE: This file does not have an extension (save using "All files" and not 
"Text files" otherwise Windows might append the extension .txt)

Copy the file into your home directory:

C:\cygwin\home\Administrator 


7.2.3    FFmpeg configure script for FFmpeg "stand-alone"
=========================================================

This section is only if FFmpeg compiling is required as a stand-alone package
and not in comination with the precompiled "contrib" package.

In case of failure to compile VLC with different settings (added/updated
libraries to the "contrib") it is advisable to test if FFmpeg does compile
OK just in "stand-alone" mode.

Create a new text document at the download location with following lines:

./configure --enable-mingw32 --enable-memalign-hack \
    --cc="gcc -mno-cygwin" \
    --enable-pp --enable-gpl --log \

NOTE: When including libraries the following options should be added/changed,
pointing to the appropriate folder where does libraries are located (for VLC
"contrib" that would be /usr/win32 but in other situations it might be the
default /usr/local):

    --extra-cflags=-I/usr/local/include \
    --extra-ldflags=-L/usr/local/lib \
    --prefix=/usr/local \

Save as filename in your "scripts" folder at your download/install location:

configure-ffmpeg-svn          (example)


7.3      x264 configure script
==============================

Create a new text document with the following lines:

./configure \
    --prefix=/usr/win32 \
    
NOTE: for debugging purposes you can add the following option:

--enable-debug

Save as filename in your "scripts" folder at your download/install location:

configure-x264

NOTE: This file does not have an extension (save using "All files" and not 
"Text files" otherwise Windows might append the extension .txt)

Copy the file into your home directory:

C:\cygwin\home\Administrator  


8        Compiling source code
==============================

It's time to open your Cygwin shell...


8.1      Additional libraries
=============================

If any updated or additional libraries are used they need to be compiled first.
Since some of these are used indirectly through FFmpeg, FFmpeg should be compiled
last.


8.1.1    Compiling x264
=======================

This section is only required for x264 compiling where you want to compile x264
yourself in order to use the latest version.

Change to the appropriate x264 folder

cd x264-trunk          (example)

NOTE: the following lines make sure there are no traces of any previous compiles.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -