简体   繁体   English

使用什么MPEG4编码器库?

[英]What MPEG4 encoder library to use?

So I have a WIN32 app that records videos using DirectShow. 因此,我有一个使用DirectShow录制视频的WIN32应用程序。 Now I want to convert the .AVI files to .MP4. 现在,我想将.AVI文件转换为.MP4​​。

I rather not use a custom filter in the source, since I don't want to have to register filters(admin needed). 我不想在源代码中使用自定义过滤器,因为我不想注册过滤器(需要管理员)。 I also dont want to use a standalone application since it should be automatised. 我也不想使用独立的应用程序,因为它应该被自动化。 Preferbly I just want a library with a well documented API since im rather new to this. 最好是我只想拥有一个具有完善文档库的API的库,因为这对我来说还很新。 Then I can use it from my app to convert the .AVI files when they are done being recorded. 然后,当我录制完.AVI文件时,就可以从我的应用程序中使用它来转换它们。 Anyone can point me in a direction? 有人可以指出我的方向吗? Or have comments on my method of choice? 或对我的选择方法有意见?

I'd be outmost grateful for any help and thanks in advance! 我将非常感谢您的任何帮助,并在此先感谢您!

Because MPEG-4 codecs are not royalty free, finding suitable encoder might be not as easy as you could think of it. 由于MPEG-4编解码器不是免版税的,因此找到合适的编码器可能并不像您想象的那样容易。 Microsoft does not provide Windows with the encoder, except H.264 (MPEG-4 Part 10) encoder in some editions of Windows 7, and only within Media Foundation (as opposed to DirectShow). Microsoft在Windows 7的某些版本中不提供Windows编码器,但H.264(MPEG-4 Part 10)编码器除外,并且仅在Media Foundation中提供(与DirectShow相对)。 If you are OK to be limited to those Windows 7 versions, Media Foundation might be a good option, MSDN offers samples to transcode file into file and it is reasonably easy and well documented. 如果可以只限于Windows 7版本,则可以选择Media Foundation,MSDN提供了一些示例,可以将文件转码为文件,并且相当容易且有据可查。

There are third party solutions, there half made libraries you can leverage to encoder, there is FFmpeg which offers MPEG-4 Part 2 video encoder under LGPL, and MPEG-4 Part 10 through libx264 under GPL. 有第三方解决方案,有一半可以用作编码器的库,有FFmpeg,它在LGPL下提供MPEG-4 Part 2视频编码器,在GPL下通过libx264提供MPEG-4 Part 10。 And my understanding you might still be expected to pay royalties to MPEG-LA. 根据我的理解,您可能仍会希望向MPEG-LA支付版权费。 FFmpeg might still be a good option to convert file to file because its command lnie interface is well documented (as opposed to libavformat/libavcodec API which are not so well documented on the contrary). FFmpeg可能仍然是将文件转换为文件的好选择,因为它的命令lnie接口已被很好地证明(与libavformat / libavcodec API相对,后者没有那么被很好地证明)。

Another option is to use Windows Media codecs and compress into ASF/WMV files. 另一个选择是使用Windows Media编解码器并将其压缩为ASF / WMV文件。

Libavcodec和libffmpeg-万能的媒体转换器(包括库和命令行应用程序): http : //ffmpeg.org/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM