女扮男装之倾城九皇子:php调用ffmpeg

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 21:35:51
Seems that stream 1 comes from film source: 1000.00 (1000/1) -> 38.00 (38/1)
Input #0, flv, from '../record/streams/_definst_/123.flv':
Duration: N/A, bitrate: N/A
Stream #0.0: Audio: 0x0006, 44100 Hz, mono
Stream #0.1: Video: flv, 350x270, 1000.00 fps
Output #0, image2, to '../videoimage/123.jpg':
Stream #0.0: Video: mjpeg, 160x120, 1.00 fps, q=2-31, 200 kb/s
Stream mapping:
Stream #0.1 -> #0.0
[mjpeg @ 0x6cd740]removing common factors from framerate
Press [q] to stop encoding
frame= 1 q=0.0 Lsize= 0kB time=1.0 bitrate= 0.0kbits/s
video:2kB audio:0kB global headers:0kB muxing overhead -100.000000%
Status: 302
X-Powered-By: PHP/5.1.2
location:../videosave.asp?flvname=123
Content-type: text/html
页面执行了ffmpeg.exe和后面的参数,也生成了要截取的图片,但是
header("location:../videosave.asp?flvname={$flvname}");没有起到作用。附上本页代码:
<?php
set_time_limit(0);
$flvname=escapeshellcmd($_GET["flvname"]);
$streamPath="../record/streams/_definst_/{$flvname}.flv";
$imgW ="160";
$imgY = "120";
$imgQuality = "70";
$ss=$i+3;
$newName = "../videoimage/{$flvname}.jpg";
exec ("ffmpeg.exe -i \"{$streamPath}\" -ss {$ss} -vframes 1 -r 1 -ac 1 -ab 2 -s $imgW*$imgY -f image2 \"{$newName}\"");
header("location:../videosave.asp?flvname={$flvname}");
?>