简体   繁体   English

从 C++ 程序调用 ffmpeg

[英]Calling ffmpeg from a C++ program

I have seen a similar question here How to wrap H264 into a mp4 container?我在这里看到了一个类似的问题How to wrap H264 into a mp4 container? and Calling a C++ function from a C program but i still need some examples to understand.从 C 程序调用 C++ 函数,但我仍然需要一些例子来理解。

  1. How can ffmpeg command line be launched from a c++ program to for instance convert a video?如何从 C++ 程序启动 ffmpeg 命令行以转换视频?

  2. Is it possible to use it in a loop for instance where there are a couple of videos in a directory which need to be converted?是否可以在循环中使用它,例如目录中有几个视频需要转换?

I intend converting raw videos in a folder to mp4 but i want to do so using the command line.Relevant link or sample code will be most helpful.我打算将文件夹中的原始视频转换为 mp4,但我想使用命令行来这样做。相关链接或示例代码将是最有帮助的。

Thanks in advance提前致谢

  1. The same way you would launch any other external program using C++ program.与使用 C++ 程序启动任何其他外部程序的方式相同。
  2. Yes.是的。 Enumerate the videos you need, parse accordingly.枚举您需要的视频,并进行相应的解析。

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

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