gpt4 book ai didi

php - ffmpeg 将 mov 转换为 mp4

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

试图将 .mov 转换为 .mp4。在 stackoverflow 上尝试了各种建议代码,但似乎没有任何效果。

`...muxer does not support non seekable output [48] => Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument [49] => Error initializing output stream 0:0 -- [50] => Conversion failed! ) 1`

我尝试了各种编解码器属性,例如 ac3、aac、libvo_aacenc
exec('
/usr/local/bin/ffmpeg -y -i https://***.***.com/assets/regions/region-1/input.mov' .
' -c:a ac3 '
. 'https://***.***.com/assets/regions/region-1/output.mp4'
. ' 2>&1', $out, $res);

$modx->log(modX::LOG_LEVEL_ERROR, print_r($out));
$modx->log(modX::LOG_LEVEL_ERROR, $res);

return true;

最佳答案

这是我的自定义批处理,通过保留文件创建日期将我的 mov 无损转换为 mp4:

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION

for /d %%D in (*) do (
for %%B in ("%%D\*.mov") do (
echo %%B
if not exist "%%B.mp4" (
ECHO Last-Modified Date : %%~tB
ffmpeg -y -i "%%B" -vcodec copy -acodec copy "%%D\%%~nB.mp4"
powershell -Command "& { (Get-ChildItem %%D\%%~nB.mp4).LastWriteTime = (Get-ChildItem %%B).LastWriteTime ;}"
)
)
)

关于php - ffmpeg 将 mov 转换为 mp4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53955071/

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