gpt4 book ai didi

php - ffmpeg shell 输出到 php 头文件?

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

我正在尝试使用 php 脚本中的 ffmpeg,例如:

exec('ffmpeg -i input.mp4 -f ogg -y output.ogv >out.txt')

让我们假设它有效,它实际上并没有出于多种原因,但它将由托管服务提供商解决,因为我无法更改任何配置左右。

奇怪的是 out.txt 一直是 0kb,而是在 php 脚本完成工作后得到如下输出:
Malformed header from CGI script:
ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers built on May 10 2013 16:31:05 with gcc 4.8.0 (GCC) 20130502 (prerelease) configurati
(......)
Press [q] to stop, [?] for help
[vp8 @ 0x13e8d00] alloc_buffer: av_image_alloc() failed
[vp8 @ 0x13e8d00] get_buffer() failed!
sh: line 1: 1540 Segmentation fault ffmpeg -i ../uploads/videomod_m_7/433c3f8b9b0cc0f6cbdebba5263ff71809811c20o.webm -f ogg -y ../uploads/videomod_m_7/test2.ogv > out.txt
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

最佳答案

可能ffmpeg在标准错误上输出,试试

exec('ffmpeg -i input.mp4 -f ogg -y output.ogv &>out.txt')

还将 stderr 重定向到 out.txt。

关于php - ffmpeg shell 输出到 php 头文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26000962/

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