gpt4 book ai didi

php - 如何在 PHP 中使用 ffmpeg

转载 作者:行者123 更新时间:2023-12-04 23:35:32 24 4
gpt4 key购买 nike

这个问题在这里已经有了答案:




10年前关闭。




Possible Duplicate:
how to convert the videos with ffmpeg



我必须通过提供一些输入参数和输出文件参数来使用 PHP 执行一些 ffmpeg 命令。我会怎么做。我是一个asp.net 人,对php 不太了解。

帮助将不胜感激。

最佳答案

<?php //linux

$commands = array(
'-i file.mpg',
'-vcodec copy',
'-acodec ac3',
'-ab 384k test.mpg',
'-acodec mp2',
'-ab 192k',
'-newaudio'
};

shell_exec("ffmpeg".implode(' ',$commands);

?>

<?php //windows

$commands = array(
'-i file.mpg',
'-vcodec copy',
'-acodec ac3',
'-ab 384k test.mpg',
'-acodec mp2',
'-ab 192k',
'-newaudio'
};

exec ('c:\\path\\to\\ffmpeg.exe \\'
.implode(' ',$commands),
$output );
?>

关于php - 如何在 PHP 中使用 ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8437716/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com