diff --git a/OpenCVVideoParser.sln b/OpenCVVideoParser.sln new file mode 100644 index 0000000..6eed1a9 --- /dev/null +++ b/OpenCVVideoParser.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenCVVideoParser", "OpenCVVideoParser\OpenCVVideoParser.vcxproj", "{F62B7B71-0349-475C-AECA-5161913BF22E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x64.ActiveCfg = Debug|x64 + {F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x64.Build.0 = Debug|x64 + {F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x86.ActiveCfg = Debug|Win32 + {F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x86.Build.0 = Debug|Win32 + {F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x64.ActiveCfg = Release|x64 + {F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x64.Build.0 = Release|x64 + {F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x86.ActiveCfg = Release|Win32 + {F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0A9D7E8C-D348-4871-9F72-337FA37110DA} + EndGlobalSection +EndGlobal diff --git a/OpenCVVideoParser/OpenCVVideoParser.vcxproj b/OpenCVVideoParser/OpenCVVideoParser.vcxproj new file mode 100644 index 0000000..3c64285 --- /dev/null +++ b/OpenCVVideoParser/OpenCVVideoParser.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {f62b7b71-0349-475c-aeca-5161913bf22e} + OpenCVVideoParser + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories) + + + Console + true + C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\bin\Debug;C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Debug;%(AdditionalLibraryDirectories) + opencv_imgcodecs480d.lib;opencv_videoio480d.lib;opencv_video480d.lib;opencv_imgproc480d.lib;opencv_core480d.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + + + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Release;%(AdditionalLibraryDirectories) + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories) + + + Console + true + C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\bin\Debug;C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Debug;%(AdditionalLibraryDirectories) + opencv_imgcodecs480d.lib;opencv_videoio480d.lib;opencv_video480d.lib;opencv_imgproc480d.lib;opencv_core480d.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + + + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Release;%(AdditionalLibraryDirectories) + + + + + + + + + \ No newline at end of file diff --git a/OpenCVVideoParser/OpenCVVideoParser.vcxproj.filters b/OpenCVVideoParser/OpenCVVideoParser.vcxproj.filters new file mode 100644 index 0000000..ce0c35c --- /dev/null +++ b/OpenCVVideoParser/OpenCVVideoParser.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/OpenCVVideoParser/lib/opencv_calib3d480d.exp b/OpenCVVideoParser/lib/opencv_calib3d480d.exp new file mode 100644 index 0000000..4fe7617 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_calib3d480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_calib3d480d.lib b/OpenCVVideoParser/lib/opencv_calib3d480d.lib new file mode 100644 index 0000000..811b7ba Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_calib3d480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_core480d.exp b/OpenCVVideoParser/lib/opencv_core480d.exp new file mode 100644 index 0000000..99f68f1 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_core480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_core480d.lib b/OpenCVVideoParser/lib/opencv_core480d.lib new file mode 100644 index 0000000..190e558 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_core480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_dnn480d.exp b/OpenCVVideoParser/lib/opencv_dnn480d.exp new file mode 100644 index 0000000..9b5dff6 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_dnn480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_dnn480d.lib b/OpenCVVideoParser/lib/opencv_dnn480d.lib new file mode 100644 index 0000000..900bc92 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_dnn480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_features2d480d.exp b/OpenCVVideoParser/lib/opencv_features2d480d.exp new file mode 100644 index 0000000..ca5e903 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_features2d480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_features2d480d.lib b/OpenCVVideoParser/lib/opencv_features2d480d.lib new file mode 100644 index 0000000..e77f9ef Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_features2d480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_flann480d.exp b/OpenCVVideoParser/lib/opencv_flann480d.exp new file mode 100644 index 0000000..aec8aa5 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_flann480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_flann480d.lib b/OpenCVVideoParser/lib/opencv_flann480d.lib new file mode 100644 index 0000000..740a27e Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_flann480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_gapi480d.exp b/OpenCVVideoParser/lib/opencv_gapi480d.exp new file mode 100644 index 0000000..8eedd0c Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_gapi480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_gapi480d.lib b/OpenCVVideoParser/lib/opencv_gapi480d.lib new file mode 100644 index 0000000..750a96c Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_gapi480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_highgui480d.exp b/OpenCVVideoParser/lib/opencv_highgui480d.exp new file mode 100644 index 0000000..afe4af0 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_highgui480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_highgui480d.lib b/OpenCVVideoParser/lib/opencv_highgui480d.lib new file mode 100644 index 0000000..bce79af Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_highgui480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_imgcodecs480d.exp b/OpenCVVideoParser/lib/opencv_imgcodecs480d.exp new file mode 100644 index 0000000..948a2c3 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_imgcodecs480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_imgcodecs480d.lib b/OpenCVVideoParser/lib/opencv_imgcodecs480d.lib new file mode 100644 index 0000000..113b6b6 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_imgcodecs480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_imgproc480d.exp b/OpenCVVideoParser/lib/opencv_imgproc480d.exp new file mode 100644 index 0000000..4c5abc1 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_imgproc480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_imgproc480d.lib b/OpenCVVideoParser/lib/opencv_imgproc480d.lib new file mode 100644 index 0000000..961ffd0 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_imgproc480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_java480.dll b/OpenCVVideoParser/lib/opencv_java480.dll new file mode 100644 index 0000000..2213c36 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_java480.dll differ diff --git a/OpenCVVideoParser/lib/opencv_java480.exp b/OpenCVVideoParser/lib/opencv_java480.exp new file mode 100644 index 0000000..b42fc90 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_java480.exp differ diff --git a/OpenCVVideoParser/lib/opencv_java480.lib b/OpenCVVideoParser/lib/opencv_java480.lib new file mode 100644 index 0000000..3044cbb Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_java480.lib differ diff --git a/OpenCVVideoParser/lib/opencv_ml480d.exp b/OpenCVVideoParser/lib/opencv_ml480d.exp new file mode 100644 index 0000000..f4eabc2 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_ml480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_ml480d.lib b/OpenCVVideoParser/lib/opencv_ml480d.lib new file mode 100644 index 0000000..367687b Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_ml480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_objdetect480d.exp b/OpenCVVideoParser/lib/opencv_objdetect480d.exp new file mode 100644 index 0000000..982298e Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_objdetect480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_objdetect480d.lib b/OpenCVVideoParser/lib/opencv_objdetect480d.lib new file mode 100644 index 0000000..baf16fa Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_objdetect480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_photo480d.exp b/OpenCVVideoParser/lib/opencv_photo480d.exp new file mode 100644 index 0000000..21d9713 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_photo480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_photo480d.lib b/OpenCVVideoParser/lib/opencv_photo480d.lib new file mode 100644 index 0000000..26eaf28 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_photo480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_stitching480d.exp b/OpenCVVideoParser/lib/opencv_stitching480d.exp new file mode 100644 index 0000000..78af6d0 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_stitching480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_stitching480d.lib b/OpenCVVideoParser/lib/opencv_stitching480d.lib new file mode 100644 index 0000000..f7ff415 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_stitching480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_ts480d.lib b/OpenCVVideoParser/lib/opencv_ts480d.lib new file mode 100644 index 0000000..d130ab5 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_ts480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_video480d.exp b/OpenCVVideoParser/lib/opencv_video480d.exp new file mode 100644 index 0000000..7fbab11 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_video480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_video480d.lib b/OpenCVVideoParser/lib/opencv_video480d.lib new file mode 100644 index 0000000..a82ee5a Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_video480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_videoio480d.exp b/OpenCVVideoParser/lib/opencv_videoio480d.exp new file mode 100644 index 0000000..8d3af64 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_videoio480d.exp differ diff --git a/OpenCVVideoParser/lib/opencv_videoio480d.lib b/OpenCVVideoParser/lib/opencv_videoio480d.lib new file mode 100644 index 0000000..ef70c49 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_videoio480d.lib differ diff --git a/OpenCVVideoParser/lib/opencv_world480.lib b/OpenCVVideoParser/lib/opencv_world480.lib new file mode 100644 index 0000000..8c54fe7 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_world480.lib differ diff --git a/OpenCVVideoParser/lib/opencv_world480d.lib b/OpenCVVideoParser/lib/opencv_world480d.lib new file mode 100644 index 0000000..0dfff77 Binary files /dev/null and b/OpenCVVideoParser/lib/opencv_world480d.lib differ diff --git a/OpenCVVideoParser/main.cpp b/OpenCVVideoParser/main.cpp new file mode 100644 index 0000000..7f598d3 --- /dev/null +++ b/OpenCVVideoParser/main.cpp @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +/* +This functions opens a video file and extracts the frames and put them into a vector of Mat(its the class for representing an img) +*/ +void extract_frames(const std::string &videoFilePath,std::vector& frames){ + + try{ + //open the video file + cv::VideoCapture cap(videoFilePath); // open the video file + if(!cap.isOpened()) // check if we succeeded + cv::error(CV_StsError,"Can not open Video file",__FUNCTION__,"C:\\Users\\sigon\\source\\repos\\OpenCVVideoParser\\OpenCVVideoParser\\main.cpp",14); + + //cap.get(CV_CAP_PROP_FRAME_COUNT) contains the number of frames in the video; + for(int frameNum = 0; frameNum < cap.get(cv::CAP_PROP_FRAME_COUNT);frameNum++) + { + cv::Mat frame; + cap >> frame; // get the next frame from video + frames.push_back(frame); + } + } + catch( cv::Exception& e ){ + std::cerr << e.msg << std::endl; + exit(1); + } + +} + +/* +It saves a vector of frames into jpg images into the outputDir as 1.jpg,2.jpg etc where 1,2 etc represents the frame number +*/ +void save_frames(std::vector& frames, const std::string& outputDir){ + std::vector compression_params; + compression_params.push_back(cv::IMWRITE_JPEG_QUALITY); + compression_params.push_back(100); + int frameNumber=0; + for(std::vector::iterator frame = frames.begin(); frame != frames.end(); ++frame){ + std::string filePath = outputDir + std::to_string(static_cast(frameNumber))+ ".jpg"; + imwrite(filePath,*frame,compression_params); + frameNumber++; + } + + +} + +int main(){ + std::vectorframeData; + extract_frames("C:/Users/sigon/Videos/test.mp4",frameData); + +} \ No newline at end of file diff --git a/OpenCVVideoParser/opencv_calib3d480d.dll b/OpenCVVideoParser/opencv_calib3d480d.dll new file mode 100644 index 0000000..73a3f68 Binary files /dev/null and b/OpenCVVideoParser/opencv_calib3d480d.dll differ diff --git a/OpenCVVideoParser/opencv_core480d.dll b/OpenCVVideoParser/opencv_core480d.dll new file mode 100644 index 0000000..f7905e9 Binary files /dev/null and b/OpenCVVideoParser/opencv_core480d.dll differ diff --git a/OpenCVVideoParser/opencv_dnn480d.dll b/OpenCVVideoParser/opencv_dnn480d.dll new file mode 100644 index 0000000..60c79f2 Binary files /dev/null and b/OpenCVVideoParser/opencv_dnn480d.dll differ diff --git a/OpenCVVideoParser/opencv_features2d480d.dll b/OpenCVVideoParser/opencv_features2d480d.dll new file mode 100644 index 0000000..0e6cc20 Binary files /dev/null and b/OpenCVVideoParser/opencv_features2d480d.dll differ diff --git a/OpenCVVideoParser/opencv_flann480d.dll b/OpenCVVideoParser/opencv_flann480d.dll new file mode 100644 index 0000000..7820190 Binary files /dev/null and b/OpenCVVideoParser/opencv_flann480d.dll differ diff --git a/OpenCVVideoParser/opencv_gapi480d.dll b/OpenCVVideoParser/opencv_gapi480d.dll new file mode 100644 index 0000000..4d40e42 Binary files /dev/null and b/OpenCVVideoParser/opencv_gapi480d.dll differ diff --git a/OpenCVVideoParser/opencv_highgui480d.dll b/OpenCVVideoParser/opencv_highgui480d.dll new file mode 100644 index 0000000..46bc042 Binary files /dev/null and b/OpenCVVideoParser/opencv_highgui480d.dll differ diff --git a/OpenCVVideoParser/opencv_imgcodecs480d.dll b/OpenCVVideoParser/opencv_imgcodecs480d.dll new file mode 100644 index 0000000..90d6de7 Binary files /dev/null and b/OpenCVVideoParser/opencv_imgcodecs480d.dll differ diff --git a/OpenCVVideoParser/opencv_imgproc480d.dll b/OpenCVVideoParser/opencv_imgproc480d.dll new file mode 100644 index 0000000..8f3d86f Binary files /dev/null and b/OpenCVVideoParser/opencv_imgproc480d.dll differ diff --git a/OpenCVVideoParser/opencv_ml480d.dll b/OpenCVVideoParser/opencv_ml480d.dll new file mode 100644 index 0000000..e63aa2c Binary files /dev/null and b/OpenCVVideoParser/opencv_ml480d.dll differ diff --git a/OpenCVVideoParser/opencv_objdetect480d.dll b/OpenCVVideoParser/opencv_objdetect480d.dll new file mode 100644 index 0000000..ec38ac4 Binary files /dev/null and b/OpenCVVideoParser/opencv_objdetect480d.dll differ diff --git a/OpenCVVideoParser/opencv_photo480d.dll b/OpenCVVideoParser/opencv_photo480d.dll new file mode 100644 index 0000000..cf1e8b6 Binary files /dev/null and b/OpenCVVideoParser/opencv_photo480d.dll differ diff --git a/OpenCVVideoParser/opencv_stitching480d.dll b/OpenCVVideoParser/opencv_stitching480d.dll new file mode 100644 index 0000000..25601f9 Binary files /dev/null and b/OpenCVVideoParser/opencv_stitching480d.dll differ diff --git a/OpenCVVideoParser/opencv_video480d.dll b/OpenCVVideoParser/opencv_video480d.dll new file mode 100644 index 0000000..2397797 Binary files /dev/null and b/OpenCVVideoParser/opencv_video480d.dll differ diff --git a/OpenCVVideoParser/opencv_videoio480d.dll b/OpenCVVideoParser/opencv_videoio480d.dll new file mode 100644 index 0000000..28ff772 Binary files /dev/null and b/OpenCVVideoParser/opencv_videoio480d.dll differ diff --git a/OpenCVVideoParser/opencv_videoio_ffmpeg480_64.dll b/OpenCVVideoParser/opencv_videoio_ffmpeg480_64.dll new file mode 100644 index 0000000..22c3b9e Binary files /dev/null and b/OpenCVVideoParser/opencv_videoio_ffmpeg480_64.dll differ