を使用するときにOpenCVのではなく、FPSのTBRを報告私は、Mac OS 10.6.8(Snow Leopardは)上のOpenCVとQt 4.7.4を使用して処理しようとしているいくつかのビデオを持っています。私はcv::VideoCapture
オブジェクトを作成し、ビデオに関連するフレームレートを問い合わせる場合は、私が戻って取得することはTBRはないFPSです。例えばcapture.get(CV_CAP_PROP_FPS)
私は何を得るの使用ffprobe Video1.mp4
がある場合:
>> ffprobe Video1.mp4
ffprobe version 0.7.8, Copyright (c) 2007-2011 the FFmpeg developers
built on Nov 24 2011 14:31:00 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --
enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-
libdirac --enable-libschroedinger --enable-libopenjpeg --enable-libxvid --enable-libx264
--enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --
enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm
libavutil 50. 43. 0/50. 43. 0
libavcodec 52.123. 0/52.123. 0
libavformat 52.111. 0/52.111. 0
libavdevice 52. 5. 0/52. 5. 0
libavfilter 1. 80. 0/1. 80. 0
libswscale 0. 14. 1/0. 14. 1
libpostproc 51. 2. 0/51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Video1.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: mp41avc1qt
creation_time : 2012-01-09 23:09:43
encoder : vlc 1.1.3 stream output
encoder-eng : vlc 1.1.3 stream output
Duration: 00:10:10.22, start: 0.000000, bitrate: 800 kb/s
Stream #0.0(eng): Video: h264 (Baseline), yuvj420p, 704x480 [PAR 10:11 DAR 4:3], 798
kb/s, 27.71 fps, 1001 tbr, 1001 tbn, 2002 tbc
Metadata:
creation_time : 2012-01-09 23:09:43
:
QString filename = QFileDialog::getOpenFileName(this,
"Open Video",
"Video Files (*.mp4, *.mpg)");
capture.release();
capture.open(filename.toAscii().data());
if (!capture.isOpened()){
qDebug() <<"Error when opening the video!";
return;
}
qDebug() << "Frame Rate:" << capture.get(CV_CAP_PROP_FPS);
qDebug() << "Num of Frames:" << capture.get(CV_CAP_PROP_FRAME_COUNT);
qDebug() << "OpenCV Version" << CV_VERSION;
私が手出力は次のようになります。代わりにTBRを報告
Frame Rate: 1001
Num of Frames: 610832
OpenCV Version 2.3.1
FPSのこの動作は、異なるビデオを開くときに一貫しています。
私はOpenCVのbug trackerをチェックしましたが、thisというスタックオーバーフローの問題は、同様の問題だとは言えませんが、私は次に何をするのか迷っています。私はたくさんのことを試して、どこにもいないように見えるので、ヒントやアイデアは大歓迎です。
ビデオを再エンコード、なんとかものの、面倒になります。それらはネットワークカメラから生成されます。しかし、あなたの答えは、なぜFPSの代わりにTBRを得るのか明確な説明を与えました。ありがとう! – Malife