将avifil32.dll与大文件一起使用 [英] Using avifil32.dll with large files

查看:229
本文介绍了将avifil32.dll与大文件一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我正在使用avifil32.dll为我的视频添加声音。首先,我创建了一个AVIWriter并添加了我的所有图片(MyAviFile.avi)。然后我为avifil32.dll创建了Api并尝试创建管理器

hello, I am using avifil32.dll to add sound to my video. First of all, I created an AVIWriter and add all my pictures (MyAviFile.avi). Then I created Api for avifil32.dll and try to create manager

var manager = new AviManager(fileName, true);
public AviManager(String fileName, bool open){
			Avi.AVIFileInit();
			int result;

			if(open){ //open existing file
				
				result = Avi.AVIFileOpen(
					ref aviFile, fileName,
					Avi.OF_READWRITE, 0);

			}else{ //create empty file
				
				result = Avi.AVIFileOpen(
					ref aviFile, fileName, 
					Avi.OF_WRITE | Avi.OF_CREATE, 0);
			}

			if(result != 0) {
				throw new Exception("Exception in AVIFileOpen: "+result.ToString());
			}
		}





,结果为-214567 ......



我尝试了什么:



我读过那是因为我的avi文件大小(它是靠近4G)。以及如何处理它。

当我将我的avi转换为flv时,它的大小接近20 Mb。为什么我的原始avi太大?



and the result was -214567...

What I have tried:

I have read that that is because of my avi file size (it's near 4G). And what to do with it.
And when I convert my avi to flv the size became near 20 Mb. Why my original avi is too large?

推荐答案

您使用的是存储未压缩视频的普通AVI格式。这就是文件大小如此之大的原因。 AVI本身限制为4 GB,因为它使用32位指针。但VfW(Video for Windows)的限制为2 GB。当使用DirectShow而不是VfW时,限制是AVI的4 GB限制。



您可能会考虑使用比旧的AVI格式更近的视频格式或当所有未压缩文件小于4 GB时,使用DirectShow而不是VfW。
You are using the plain AVI format which stores video uncompressed. That is why the file size is so large. AVI itself is limited to 4 GB because it uses 32-bit pointers. But VfW (Video for Windows) has a limitation of 2 GB. When using DirectShow instead of VfW, the limit is the 4 GB limit of AVI.

You might think about using a more recent video format than the quite old AVI format or use DirectShow instead of VfW when all of your uncompressed files are smaller than 4 GB.


这篇关于将avifil32.dll与大文件一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆