サムネイル画像 «
Main »
冗長と繰り返し。
ffmpegの出力から動画情報データを取得
Point 1:コマンドに 2>&1をつけてエラー出力も標準出力へ^-^。
Point 2:exec関数で標準出力を配列へ取得^-^。
++++++++++++++++++++++++++++++++++++++++++++++
$cmd ="ffmpeg -i out2.3gp 2>&1";
exec($cmd,$out);
echo "===================================
\n";
print_r ($out);
echo "===================================
\n";
++++++++++++++++++++++++++++++++++++++++++++++
# php -f vdata.php
===================================
Array
(
[0] => Input #0, mov,mp4,m4a,3gp, from 'out2.3gp':
[1] => Duration: 00:00:05.0, bitrate: 109 kb/s
[2] => Stream #0.0: Video: mpeg4, 176x144, 15.00 fps
[3] => Must supply at least one output file
[4] => ffmpeg version 0.4.9-pre1, build 4718, Copyright (c) 2000-2004 Fabrice Bellard
[5] => built on Mar 14 2006 13:03:57, gcc: 3.4.5
)
===================================
あとは
[1] => Duration: 00:00:05.0, bitrate: 109 kb/s
[2] => Stream #0.0: Video: mpeg4, 176x144, 15.00 fps
この2行から時間、ビットレート、動画形式、サイズ、フレームレートを取得。
2006/03/22 12:36:30 - junichi
サムネイル画像 «
動画関連メモ Unix-Linux PHP