编辑 avi 文件的帧速率

发布于 2024-07-28 22:28:06 字数 280 浏览 1 评论 0原文

是否可以使用 Windows 视频库更改 avi 文件的帧速率? 我尝试了以下步骤但没有成功。

  1. AviFileInit
  2. AviFileOpen(OF_READWRITE)
  3. pavi1 = AviFileGetStream
  4. avi_info = AviStreamInfo
  5. avi_info.dwrate = 15
  6. EditStreamSetInfo(dwrate) 返回 -2147467262。

Is it possible to change the frame rate of an avi file using the Video for windows library? I tried the following steps but did not succeed.

  1. AviFileInit
  2. AviFileOpen(OF_READWRITE)
  3. pavi1 = AviFileGetStream
  4. avi_info = AviStreamInfo
  5. avi_info.dwrate = 15
  6. EditStreamSetInfo(dwrate) returns -2147467262.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

月下凄凉 2024-08-04 22:28:06

我很确定 AVIFile* API 不支持此功能。 (免责声明:我是定义这些 API 的人,但那已经是 15 年前的事了……)

您不能只在普通 AVIStream 上调用 EditStreamSetInfo,因为只有一个是从 CreateEditableStream 返回的。

那么,您可以使用 AVISave,但这显然会重新复制整个文件。

所以,是的,您可能希望通过充分解析 AVI 文件头来找到您想要更改的 DWORD 来完成此操作。 有很多关于 RIFF 和 AVI 文件格式的文档,例如 http:// /www.opennet.ru/docs/formats/avi.txt

I'm pretty sure the AVIFile* APIs don't support this. (Disclaimer: I was the one who defined those APIs, but it was over 15 years ago...)

You can't just call EditStreamSetInfo on an plain AVIStream, only one returned from CreateEditableStream.

You could use AVISave, then, but that would obviously re-copy the whole file.

So, yes, you would probably want to do this by parsing the AVI file header enough to find the one DWORD you want to change. There are lots of documents on the RIFF and AVI file formats out there, such as http://www.opennet.ru/docs/formats/avi.txt.

放血 2024-08-04 22:28:06

我对 VfW 一无所知,但您始终可以尝试对文件进行十六进制编辑。 帧速率可能是 AVI 文件标头中某处的字段。

否则,您可以编写一些工具(如 mencoder[1])的脚本,以将流复制到不同帧速率下的新文件。

[1] http://www.mplayerhq.hu/

I don't know anything about VfW, but you could always try hex-editing the file. The framerate is probably a field somewhere in the header of the AVI file.

Otherwise, you can script some tool like mencoder[1] to copy the stream to a new file under a different framerate.

[1] http://www.mplayerhq.hu/
獨角戲 2024-08-04 22:28:06

HRESULT:0x80004002(2147500034)
名称:E_NOINTERFACE
所请求的 COM 接口不可用
严重性代码:失败
设施代码:FACILITY_NULL (0)
错误代码:0x4002 (16386)

如果您不调用 EditStreamSetInfo,它会起作用吗?

您可以发布用于设置流信息的代码吗?

HRESULT: 0x80004002 (2147500034)
Name: E_NOINTERFACE
Description: The requested COM interface is not available
Severity code: Failed
Facility Code: FACILITY_NULL (0)
Error Code: 0x4002 (16386)

Does it work if you DON'T call EditStreamSetInfo?

Can you post up the code you use to set the stream info?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文