From d60caea5590109f4716fd2d0db7276cbe99c5734 Mon Sep 17 00:00:00 2001
From: Vadim Pisarevsky <no@email>
Date: Fri, 27 Apr 2012 12:07:56 +0000
Subject: [PATCH] added test to check #1737

---
 modules/highgui/test/test_ffmpeg.cpp | 31 +++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/modules/highgui/test/test_ffmpeg.cpp b/modules/highgui/test/test_ffmpeg.cpp
index 6de296066e..518ff79f3e 100644
--- a/modules/highgui/test/test_ffmpeg.cpp
+++ b/modules/highgui/test/test_ffmpeg.cpp
@@ -142,6 +142,35 @@ public:
     }
 };
 
-TEST(Highgui_Video, ffmpeg_writebig) { CV_FFmpegWriteBigVideoTest      test; test.safe_run(); }
+TEST(Highgui_Video, ffmpeg_writebig) { CV_FFmpegWriteBigVideoTest test; test.safe_run(); }
+
+class CV_FFmpegReadImageTest : public cvtest::BaseTest
+{
+public:
+    void run(int)
+    {
+        try
+        {
+            string filename = ts->get_data_path() + "../cv/features2d/tsukuba.png";
+            VideoCapture cap(filename);
+            Mat img0 = imread(filename, 1);
+            Mat img, img_next;
+            cap >> img;
+            cap >> img_next;
+            
+            CV_Assert( !img0.empty() && !img.empty() && img_next.empty() );
+            
+            double diff = norm(img0, img, CV_C);
+            CV_Assert( diff == 0 );
+        }
+        catch(...)
+        {
+            ts->set_failed_test_info(ts->FAIL_INVALID_OUTPUT);
+        }
+        ts->set_failed_test_info(cvtest::TS::OK);
+    }
+};
+
+TEST(Highgui_Video, ffmpeg_image) { CV_FFmpegReadImageTest test; test.safe_run(); }
 
 #endif