编译参考xvid源代码中的doc/INSTALL文件,针对其中遇到的问题:

下载NASM

http://sourceforge.net/projects/nasm  (Win32版本)

解压缩后得到nasmw.exe, ndisasmw.exe,将nasmw.exe改为nasm.exe后将这两个文件拷到Microsoft Visual Studio/VC98/Bin下。

编译有可能出现以下错误: error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64

如果你的VC是SP5,可以下载 Visual C++ 6.0 Processor Pack - http://msdn.microsoft.com/vstudio/downloads/tools/ppack/default.aspx 解决。

可是Visual C++ 6.0 Processor Pack 却没有针对SP6的,没有办法安装。那么就需要改xvid的源代码了。

在src/portab.h和vfw/src/status.h中

# define uint64_t unsigned __int64 
改为:
# define uint64_t __int64

【不知道这样有后患吗】

网上流传的比较全面的编译版本:

MPEG-4 Xvid VC6.0编译指南

作者: David Carroll,Peter Lee   
2006-01-09

OK, you've got your copy of Microsoft Visual C++ 6.0. You should be able to just download the source code, click on the project file, and a few second later, you'll have the Xvid Binary. Right? Well, unfortunately, it's not that easy. However, it's not that hard either.

I. Downloading Necessary Files

Xvid depends on a number of libraries and programs that do not come standard with Microsoft Visual C++ 6.0.

You need:

1) Service Pack 5 for Visual Studio 6 - http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp
The service pack contains all the latest bug fixes for Visual C++ 6.0 as well as updates to essential libraries. You can download the service pack or order it on CD from the Microsoft Developers Network (MSDN) by clicking the link above.
vc6补丁,所选的语言和VC的语言一致就可以了

2) Visual C++ 6.0 Processor Pack - http://msdn.microsoft.com/vstudio/downloads/tools/ppack/default.aspx
The processors pack adds support for Intel's SSE, SEE2 and AMD's 3DNow! instructions.
支持处理器多媒体汇编指令的补丁

3) NASM - the famous Netwide Assembler - http://sourceforge.net/projects/nasm/
Xvid uses NASM to "compile" the code written in assembly language (the *.asm files). Download the Win32 binary.

4) DirectX 9.0 SDK - http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp
To build the DirectShow filter, you need the DirectX SDK (Software Development Kit). Unfortunately for dial-up users, the ~200MB DirectX SDK is no longer available on CD.

5) (optional) Pthreads for Win32 - http://sources.redhat.com/pthreads-win32/
You will need the pthreads library if you want to build the SMP version of the xvid.dll. This is not needed for most users since most users don't have dual processing systems.

II. Configuring the Compiler

1) Installing Service Pack 5

The Service Pack is easy to install since it comes with an installer. The installer's filename is "setupsp5.exe". Just find the file and double-click it.
自解压后,运行setupsp5.exe

2) Installing Visual C++ Processor PackDouble-click "vcpp5.exe" to install.

3) Installing and Configuring NASM

a) Unzip the file to an easy to remember directory of your choosing (i.e., "C:/DEVELOP/NASM")
b) Xvid expects the filename to be "nasm.exe" (probably because all other versions except the Win32 version has that name). For some reason, the Win32 version NASM has a filename of "nasmw.exe." I recommend making a copy of "nasmw.exe" and renaming it "nasm.exe."
c) Load up Microsoft Visual C++.

i) Click on the "Tools" menu and select "Options."
ii) Click on the "Directories" tab.
iii) Select "Executable Files" from the "Show Directories For" dropdown box.
iv) Add the path to NASM (e.g., "C:/DEVELOP/NASM")

文件名一定要改成nasm.exe ,拷贝到Microsoft Visual Studio6/vc98/bin下即可

4) Installing and Configuring the DirectX SDK

The DirectX SDK comes with an installer. Just double-click on the "setup.exe" file and follow the prompts.

To configure the DirectX SDK:

a) Load up Microsoft Visual C++.
b) Click on the "Tools" menu and select "Options."
c) Click on the "Directories" tab.
d) Select "Include Files" from the "Show Directories For" dropdown box.
e) Add the following entry: "<path to DirectX SDK>/SAMPLES/C++/DIRECTSHOW/BASECLASSES" where you replace <path to DirectX SDK> with the actual path to the DirectX SDK (i.e., "C:/DEVELOP/DXSDK").
f) Use the little up arrow icon to move the entries to the top of the list.

III. Compiling XVID

Now you can download the source code, click on the workspace file, and a few second later, you'll have the Xvid Binary. Just make sure you build the xvidcore first.

IV. Installing XVID

For Windows users, there are really only three files you have to be concerned with:

1) xvid.dll and xvid.inf - both of these files are in the "<path to Xvid source code>/vfw/bin/" directory. The "xvid.dll" file is the Xvid Video for Windows codec. This file is necessary if you wish to encode any videos using a Video for Windows compliant program (i.e., almost every video editor out there). In theory, you should be able to play back Xvid files in the Windows Media Player using this file as well although this functionality appears to be broken at this point. Therefore, if you wish to play back files in a media player, install the "xvid.ax" file (see below). The "xvid.inf" file is the setup information file. Basically, this file tells Windows how to install "xvid.dll".

To install the Xvid Video for Windows codec (aka xvid.dll)

a) Simply right-click the "xvid.inf" and select "Install" from the context menu.

That's it, you're done. To verify that the file has been installed correctly, go to the Control Panel and select "Multimedia", then click on the "Devices" tab and finally see if "XVID" is listed under the "Video Compression Codecs" section. If you wish to uninstall the Xvid codec, select "XVID MPEG-4 CODEC" from the "Add/Remove Program" list in the Control Panel.
控制面板》声音与多媒体,选择硬件tab,...

2) xvid.ax -This file is in the "<path to Xvid source code>/dshow/bin/" directory. The "xvid.ax" file is the Xvid DirectShow filter. Microsoft has decreed that DirectShow shall replace Video for Windows, so in theory you won't need "xvid.dll". However, this isn't true. Instead, the DirectShow filter is used mostly for playback by newer media players. Most video programs still depend on the Video for Windows codec for encoding.
解码,作播放用

To install the Xvid DirectShow filter (aka xvid.ax)

a) First copy the "xvid.ax" file to a safe place (i.e., "C:/Program Files/xvid"). The Video for Windows codec is automatically copied to the Windows system directory when you install it. The DirectShow filter is not. Therefore, if you delete the source code directory, you lose your DirectShow filter.
b) Once you have copied the "xvid.ax" file to a safe place, go to the Start Menu and select "Run." Type "<path to Windows>/system/regsvr32 <path to xvid.ax>/xvid.ax" (i.e, C:/windows/system/regsvr32 C:/Program Files/xvid.ax).
xvid.ax拷贝某个目录后,然后开始》运行》regsvr32 xvid.ax所在的目录

That's it, you're done. There really is no easy way to verify that the DirectShow filter was properly installed other than to play a Xvid encoded video. To uninstall the DirectShow filter, go to the Start Menu and select "Run." Type "<path to Windows>/system/regsvr32 /u <path to xvid.ax>/xvid.ax"

V. Troubleshooting FAQ

Q. Why do I get the following error message:

Assembling ../../src/utils/x86_asm/mem_transfer_mmx.asm
Bad command or file name

A. You did not correctly install NASM.

Q. What causes this error: "CXvidDecoder.obj : error LNK2001: unresolved external symbol _MEDIASUBTYPE_IYUV"?

A. This is caused by an outdated strmbase.lib. You need to build a new one. The path to the project file is <path to DirectX SDK>/Samples/C++/DirectShow/BaseClasses/baseclasses.dsw. After you build the library, I recommend you copy the strmbase.lib file to <path to DirectX SDK>/lib.

Q. I have ffdshow, do I need to install the XviD DirectShow filter?

A. No, not really.

Q. When trying to open a workspace file (.dsw), I get an "empty" workspace (i.e., there are no source files listed) and/or
     When trying to open a project file (.dsp), I get a"This makefile was not generated by Developer Studio" error.

A. Often, this can be caused by having UNIX line breaks (LF) in the .dsw and .dsp files, as opposed to Windows line breaks (CR/LF). It is interesting to note that .dsw and .dsp files are just text files; you can open them up in any text editor. If you open the .dsw and .dsp files in a text editor that can't handle UNIX line breaks (namely Notepad) you will probably see big, black squares at the end of lines. You can "fix" this error by following this procedure.

a) Do NOT let Microsoft Visual C++ attempt to fix the problem! Press "No" when prompted.
b) Open the .dsw and .dsp files in a text editor that understands UNIX line breaks. WordPad is one and it is available with most copies of Windows.
c) Once open, simply re-save the file (In WordPad, make sure you set the save as type to "Text Document"). All UNIX line breaks should be converted to Windows line breaks.

Also, I have noticed that some "archive" utilities like Winzip will perform the UNIX -> Windows line break conversion automatically so I recommend you use those utilities. At the time of writing, archive utilities that don't perform this conversion include PowerArchiver and WinRAR.

Q. I get lots of error messages similar to the following:

../../src/quant/x86_asm/quantize_mmx.asm:429: parser: instruction expected
../../src/quant/x86_asm/quantize_mmx.asm:430: symbol `movdqa' redefined

A. You are using an old version of NASM, download a newer version from http://sourceforge.net/projects/nasm/

Q. I get a few "fatal: unable to open include file `colorspace_mmx.inc'" errors.

A. This is apparently caused by versions of NASM newer than 0.98.37. For whatever reason, NASM seems to have trouble dealing with relative paths. To fix the problem:

a) Open up the project settings by pressing ALT-F7 or selecting "Settings" from the "Project" menu.
b) Find the following three files under "xvidcore/image/image_asm":

1) colorspace_rgb_mmx.asm
2) colorspace_yuy_mmx.asm
3) colorspace_yuyv_mmx.asm

For each of the files, click on the "Custom Build" tab and change the line in the "Commands" box to read:

"nasm -f win32 -DPREFIX -I"$(InputDir)"/ -o $(IntDir)/$(InputName).obj $(InputPath)"

Instead of:

"nasm -f win32 -DPREFIX -I"$(InputDir)" -o $(IntDir)/$(InputName).obj $(InputPath)"

Notice the extra "/" between the "(InputDir)" and "-o".

Alternately, you could just downgrade back to NASM 0.98.36.

Q. What does "error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64" mean?

A. It means you need to install the Visual C++ Processor Pack.

Q. I have Visual C++ 6.0 Standard. Microsoft says I need the Professional or Enterprise edition in order to install the Processor Pack. Does this mean I am out of luck?

A. No. But it does mean you can't use the installer. Instead, you have to manually install the Processor Pack. Bascially, you have to:

a) Extract the files to a temporary directory using your favorite archive utilitly (i.e., Winzip).
b) Find the "vcpp.inf" file in the temporary directory and open it. Inside that file is all the information you need to install the processor pack manually.

Hint: An entry like:

[CopyToMsdev98Bin]
EnableSIMD.reg,Enabl__1.reg,32

means you should rename "Enable__1.reg" to "EnableSIMD.reg" and copy it to the <path to Visual C++>/MsDev98/bin directory.

c) Using the information in "vcpp.inf", copy the files from the temporary directory to the proper directories, renaming if necessary.

Q. What causes this error: "C:/xvid/src/image/qpel.c(84) : fatal error C1083: Cannot open include file: 'C://xvid//src//image//qpel.c': No such file or directory."

A. Not exactly sure why that happens - it should work. A quick fix is to open "qpel.c" and replace every instance of

#include __FILE__

with

#include "qpel.c"

xvid开放源码xvidcore-1.1.3.zip在VC下成功编译的方法相关推荐

  1. mysql解压rar至指定文件夹_PHP解压ZIP文件到指定文件夹的方法

    本文实例讲述了PHP解压ZIP文件到指定文件夹的方法.分享给大家供大家参考,具体如下: /** * function: 解压zip 格式的文件 * author:friker * date:2015- ...

  2. python读取压缩文件的大小_python查看zip包中文件及大小的方法

    python查看zip包中文件及大小的方法 本文实例讲述了python查看zip包中文件及大小的方法.分享给大家供大家参考.具体实现方法如下: #!/usr/bin/env python import ...

  3. ZIP/RAR压缩包加密原理和解密方法

    ZIP/RAR压缩包加密原理和解密方法 1.压缩包的概念 一般我们看到的压缩格式有.rar,.zip,等等有许多格式但主要压缩的作用就是让某一个文件占用空间小点.比如原来是50MB,可以压缩到30多M ...

  4. Python之列表表达式及高阶函数lamda、zip、enumerate、map和filter方法

    一.列表表达式[List Comprehension] 顾名思义,这个表达式作用是以一个快捷的方法对列表进行操作或运算,返回新的列表.其使用方式为[表达式 for 变量 in 列表] 或者 [表达式 ...

  5. linux命令zip打包,linux下zip命令打包与解包

    linux zip命令的基本用法是: zip [参数] [打包后的文件名] [打包的目录路径] linux zip命令参数列表: -a 将文件转成ASCII模式 -F 尝试修复损坏的压缩文件 -h 显 ...

  6. window php 安装zip扩展,Windows下安装php_rar 扩展,让php实现rar文件的读取和解压

    PHP Rar Archiving 模块 (php_rar) 是一个读取和解压rar文件的模块,但不提供RAR压缩(打包)的功能. 1.首先要到PECL的RAR页面下载DLL. 根据自己的情况选择下载 ...

  7. php 解压zip到目录下,php 解压zip压缩包内容到指定目录的实例

    目录结构: test test/index.php test/test_zip.zip test/test_zip <?php header('Content-type:text/html;ch ...

  8. zip命令通过yum安装和使用方法

    安装 yum install -y unzip zip 解压 unzip filename.zip 不解压,之查看压缩文件的内容 unzip -v filename.zip 压缩文件 zip -r f ...

  9. 破解Zip加密文件常用的几种方法

    前言 在互联网的浪潮中,大家也许碰到过这种情况: 从网络上下载了一个zip文件,最后却发现它是用密码保护的,或者自己用密码加密了一个很重要zip文件,但是一段时间后忘记了密码,无法打开.这个时候,我们 ...

  10. 微信支付商户证书cert.zip中缺少rootca.pem文件解决方法

    要设置微信支付功能,按照操作手册,进行到API证书下载,解压cert.zip后,文件夹中没有rootca.pem文件,什么原因?该怎么处理? 微信支付在配置过程中少不了要做API证书配置,不管是单独上 ...

最新文章

  1. DNS主从类型的架设
  2. C语言函数集(十六)
  3. 文件,文件夹基本操作
  4. 【集训心得】在真哥强迫下不得不写的总结
  5. Java集成PageOffice在线打开编辑word文件 - Spring Boot
  6. 模拟Spring Security上下文进行单元测试
  7. hdfs java读写hdfs demo
  8. scanf 在uefi中调用_BIOS、UEFI、Boot Loader都是些什么
  9. 数组模拟栈解决括号匹配
  10. 欧几里得空间与希尔伯特空间
  11. XML shema 约束入门 (2 ) 约束文件加入与说明
  12. 如何把C盘下用户的中文用户名改成英文用户名
  13. ABBYY FineReader OCR图文识别软件如何快速将纸质文档转为电子档教程
  14. javabeans的运用
  15. Gorilla源码分析之gorilla/mux源码分析
  16. 上海东华计算机分数线,2020年东华大学上海分专业录取分数线
  17. ARM 开发板安装Alpine Linux (英)
  18. C++——字符串处理题——万能遥控器
  19. java适配器模式例子_java适配器模式实例解析
  20. vector 删除元素的几种方法

热门文章

  1. linux appium 安装教程,Ubuntu 系统安装 Appium 及样例运行教程
  2. 软件开发需求分析规范
  3. 【软件工程】需求分析文档——需求规格说明书
  4. 修复win7便签功能
  5. python卸载指令_如何卸载python插件
  6. idea快捷键失效,快捷键不能用
  7. psftp的简单使用
  8. LVS 同网段搭建keeplive+lvs
  9. Confluence 会议记录(Meeting Notes)蓝图
  10. cad刷新快捷键_掌握了这些实用的CAD技巧,比别人出图快一小时不止