Skip to content

Commit 72de03d

Browse files
committed
Merge pull request opencv#10243 from berak:dnn_fix_mobilenet_sample
2 parents 0be1bf5 + 159ea22 commit 72de03d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

samples/dnn/ssd_mobilenet_object_detection.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ int main(int argc, char** argv)
115115
(inVideoSize.height - cropSize.height) / 2),
116116
cropSize);
117117

118+
double fps = cap.get(CV_CAP_PROP_FPS);
119+
int fourcc = static_cast<int>(cap.get(CV_CAP_PROP_FOURCC));
118120
VideoWriter outputVideo;
119121
outputVideo.open(parser.get<String>("out") ,
120-
static_cast<int>(cap.get(CV_CAP_PROP_FOURCC)),
121-
cap.get(CV_CAP_PROP_FPS), cropSize, true);
122+
(fourcc != 0 ? fourcc : VideoWriter::fourcc('M','J','P','G')),
123+
(fps != 0 ? fps : 10.0), cropSize, true);
122124

123125
for(;;)
124126
{

0 commit comments

Comments
 (0)