【问题标题】:Using libav without command line?在没有命令行的情况下使用 libav?
【发布时间】:2012-07-15 01:53:02
【问题描述】:

我使用下面这个命令来转换文件

./avconv -i inputFile -vcodec libx264 -trellis 2 -crf 23 -tune psnr -vf crop='trunc(iw/2)*2:trunc(ih/2)*2' -y outputFile

但是,我不想用这个命令,我想做一个类似的函数

convert(char *inputFile, char *outputFile). (The option of my function like option in command line)

然后我会从我的主函数中调用它 例如

int main(){ 
    convert(in01, out01); 
    convert(in02, out02); 
    convert(in03, out03); 
    return 0; 
} 

我还阅读了this post。但我不清楚。
谁能告诉我如何解决这个问题?我用谷歌搜索了很多次,但没有找到解决方案。

【问题讨论】:

    标签: ffmpeg command libav


    【解决方案1】:

    假设您使用的是 Linux 操作系统 ...

    您的问题的解决方案更多是关于如何在 C 中执行进程。因此,与 ffmpeg 无关,而是与 Linux C 中的编程有关。

    基本上,您需要首先从 C 函数中“分叉”一个进程,然后将分叉的进程与“avconv”交换(执行)并将参数传递给该进程。

    http://www.yolinux.com/TUTORIALS/ForkExecProcesses.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-31
      • 2021-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-09
      相关资源
      最近更新 更多