|
Location: Desktop development - C/C++ License: The Intelliproject Open License (IPOL) How to compile Xvid with Microsoft Visual C++Posted by Silviu CarageaDescribes how to compile Xvid with Microsoft Visual C++ |
Skill: AdvancedPosted: 22/11/2008Views: 3649Rating: 5.00 /5Popularity: 0.00 |
| Sign Up to vote for this article |
With some time ago I had to use Xvid in an intelligent mobile video real-time surveillance system, to compress frames before sending them over the sockets.
I spend over two hours to compile the sources because Xvid depends on a number of libraries and programs that do not come with Microsoft Visual Studio.
In this tutorial I will use Microsoft Visual Studio 2003 but in large part the instructions are the same.
1.NASM
The Netwide Assembler, NASM, is an 80x86 and x86-64
assembler designed for portability and modularity. It supports a range of
object file formats, including Linux and *BSD
a.out, ELF, COFF,
Mach-O, Microsoft 16-bit OBJ, Win32
and Win64. It will also output
plain binary files. Its syntax is designed to be simple and easy to understand,
similar to Intel's but less complex. It supports all currently known x86
architectural extensions, and has strong support for macros.
Xvid use NASM to compile the code written in assembly language (*.asm files).
You can download Win32 NASM binary files from http://sourceforge.net/projects/nasm/
2.DirectX 9.0 SDK
Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, and so forth. DirectX, then, was the generic term for all of these APIs and became the name of the collection.
You need DirectX to build the DirectShow filters used in Xvid.
Download Microsoft Directx from: here
3. Pthreads for Win32 (optional)
You will need the pthreads library if you want to build the SMP version of the Xvid. SMP version of the XVid is used when you have dual processing systems.
1. Installing and configuring NASM
2) Installing and Configuring the DirectX SDK
The DirectX SDK comes with an installer very easy to use. Next... Next... finish and you are ready to use it .
To configure the DirectX SDK:
Click on the workspace file, and make sure you build the xvidcore first.
You might be surprise that you have some fatal errors like those:
libxvidcore_static error: more than one input
file specified
libxvidcore_static error PRJ0019: A tool
returned an error code from "Assembling c:\Documents and Settings\...\mem_transfer_mmx.asm"
libxvidcore error: more than one input file
specified
libxvidcore error PRJ0019: A tool returned an
error code from "Assembling c:\Documents and Settings\...\mem_transfer_mmx.asm"
xvid_decraw fatal error LNK1181: cannot open
input file 'xvidcore.dll.a'
xvid_bench fatal error LNK1181: cannot open
input file 'libxvidcore.lib'
xvid_decraw_static fatal error LNK1181: cannot
open input file 'libxvidcore.lib'
xvid_encraw fatal error LNK1181: cannot open
input file 'xvidcore.dll.a'
xvid_encraw_static fatal error LNK1181: cannot
open input file 'libxvidcore.lib'
Now let's solve these issues.
The command lines that XVID uses for invoking NASM aren't quoted, making it fail on any path that has spaces. Thus you must compile the project from a path that doesn't have spaces.
For example remove the Xvid sources to c:\ xvid and open again the workspace.
For each asm file in workspace follow the next steps:
nasm -f win32 -DPREFIX -I$(InputDir) -o "$(IntDir)\$(InputName).obj" "$(InputPath)"Thant's it!
We have compiled Xvid in Visual Studio 2003.
This article, along with any associated source code and files, is licensed under The Intelliproject Open License (IPOL)
| Silviu Caragea
| Silviu Caragea is the Founder, Administrator and Chief Editor who wrote and runs The IntelliProject. He's been programming since 2000 and now he's student at The Faculty of Economic Cybernetics, Statistics and Informatics from Bucharest. In the same time he's working as software developer at Cratima Software, a Romanian software and web design company that activates both on the local and foreign market, providing its customers with software development services, internet and intranet solutions, web design, graphic design and IT consultancy. His programming experience includes: - C,C++, Visual C++(Win32 API, MFC, ADO, STL, DAO, ODBC, ATL, COM, DirectShow, DirectDraw, WTL) - Open Source libraries :CURL & Boost - HTML, CSS - Java (SE,ME) - JavaScript, Ajax, Google Web Toolkit (GWT) - Php, MySQL -Oracle, PL SQL - C# .NET -Objective C, IPhone SDK, Cocoa Location: |
Sign up to post message on the article message board!