开发者

PHP MediaInfo CLI Help

<?php
$source_video = 'demo.ts';

$mediaInfoDur_log = 'MEDIAINFO-DURATION-LOG.log';
$mediaInfoDur_cmd_log = 'MEDIAINFO-DURATION-CMD.log';
$mediaInfoDur_cmd = 'mediainfo "--Inform=Video;%Duration%" ' . $source_video;
$mediaInfoDur_cmd = $mediaInfoDur_cmd . ' > ' . $mediaInfoDur_log . ' 2>&1';
$duration = exec($mediaInfoDur_cmd, $output);
print_r($output);
?>

How we can send the result of exec into the file and in the array $output开发者_JAVA技巧 ? The Above method save only in the file nothing shows up in the array Thanks Sascha


You can use the MediaInfo --output=xml parameter to have the output created into an xml file. Set the file path with --logfile=/path/to/output/output.xml.

Note that the xml output option is only available on the UNIX version of MediaInfo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜