Compile and modify xvid1.3.1 in Ubuntu 10.04
Compile
Download the xvid source code http://www.xvid.org/from the xvid official website /.
Decompress the source code to the home directory:
Tar zxvf xvidcore-1.3.1.tar.gz
Go to the decompressed directory and you will see a build directory.
$ Cd/build/generic
Make directly, and automatically configure after xvid
$ Make
Generate after make:
Www.bkjia.com @ bkjia :~ /Xvidcore/build/generic $ make
L: libxvidcore.
L: libxvidcore. so.4.3
---------------------------------------------------------------
Xvid has been successfully built.
* Binaries are currently located in the '= built' directory
* To install them on your system, you can run '# make install'
As root.
---------------------------------------------------------------
The system will prompt that the generated library file is stored in the = build directory.
Enter the = build directory:
Www.bkjia.com @ bkjia :~ /Xvidcore/build/generic $ cd \ = build/
Www.bkjia.com @ bkjia :~ /Xvidcore/build/generic/= build $ ls
Bitstream libxvidcore. a motion quant xvid. h
Dct libxvidcore. def my_sh.sh utils xvid. o
Decoder. o libxvidcore. ld my_sh.sh ~ Xvid_de
Encoder. o libxvidcore. so.4.3 plugins xvid_decraw.c
Image mobile_cif.mp4 prediction xvid_decraw.c ~
The generated library file is displayed.
Note: If you want to install the generated library, you can use either of the following methods:
(1) Use make directly, and manually copy the generated lib file and header file to/usr/lib and/usr/include respectively.
(2) First./configure -- prefix =/usr, and then make and make install to automatically install the library file.
Export and modify
Because I want to obtain mv information from the decoding process during decoding, I need to manually modify the source code, but there is a small problem after the modification to export the global array.
The global array can be exported normally in the static library, but not in the dynamic library. An error will be reported during compilation, which takes a moment.
Solution:
Modify libxvidcore. ld in the build/generic Directory and add the global array or function to be exported. Make it again!