takuya-takeuchi / OpenPoseDotNet

OpenPose wrapper written in C++ and C# for Windows
MIT License
66 stars 25 forks source link

How to Play Video? #7

Open malhosary opened 5 years ago

malhosary commented 5 years ago

I am trying to work with a video (video.avi that is included in the OpenPose project source) in the sample project 1_CustomPostProcessing but i get the following error:

at OpenPoseDotNet.NativeMethods.op_wrapper_exec(DataType dataType, IntPtr wrapper) at OpenPoseDotNet.Wrapper`1.Exec() in E:\Work\OpenPoseDotNet\src\OpenPoseDotNet\Wrapper\Wrapper.cs:line 139 at CustomPostProcessing.Program.TutorialAddModule1() in E:\Work\OpenPoseDotNet\examples\TutorialAddModule\1_CustomPostProcessing\Program.cs:line 192

FYI: Web Camera & Image file are working fine. and I just changed added the following line of code: Flags.Video = @"E:\Work\Videos\video.avi"; I have copied all required DLLs & the OpenPoseDemo.exe (that is included in the OpenPose) is working with the same video without issues.

OS: Windows 10 64 bit CUDA: 9.2

takuya-takeuchi commented 5 years ago

image

// Applying user defined configuration - GFlags to program variables
// producerType
Flags.Video = "video.avi";
 var tie = OpenPose.FlagsToProducer(Flags.ImageDir, Flags.Video, Flags.IpCamera, Flags.Camera, Flags.FlirCamera, Flags.FlirCameraIndex);
 var producerType = tie.Item1;

It works fine while running from IDE.

But running from command line, it output error. It loos like not recognizing video file path.

D:\Works\OpenSource\OpenPoseDotNet\examples\TutorialAddModule\1_CustomPostProcessing>dotnet run -c Debug
Starting OpenPose demo...
Configuring OpenPose...
Configuring OpenPose...
Starting thread(s)...

Error:
VideoCapture (IP camera/video) could not be opened for path: 'I:\video.avi'. If it is a video path, is the path correct?

Coming from:
- D:\Works\OpenSource\OpenPoseDotNet\openpose\src\openpose\producer\videoCaptureReader.cpp:op::VideoCaptureReader::VideoCaptureReader():38
- D:\Works\OpenSource\OpenPoseDotNet\openpose\src\openpose\producer\videoCaptureReader.cpp:op::VideoCaptureReader::VideoCaptureReader():42
- D:\Works\OpenSource\OpenPoseDotNet\openpose\src\openpose\producer\producer.cpp:op::createProducer():471
- D:\Works\OpenSource\OpenPoseDotNet\openpose\include\openpose/wrapper/wrapperAuxiliary.hpp:op::configureThreadManager():1127
- D:\Works\OpenSource\OpenPoseDotNet\openpose\include\openpose/wrapper/wrapper.hpp:op::WrapperT<class CustomDatum,class std::vector<class std::shared_ptr<class CustomDatum>,class std::allocator<class std::shared_ptr<class CustomDatum> > >,class std::shared_ptr<class std::vector<class std::shared_ptr<class CustomDatum>,class std::allocator<class std::shared_ptr<class CustomDatum> > > >,class std::shared_ptr<class op::Worker<class std::shared_ptr<class std::vector<class std::shared_ptr<class CustomDatum>,class std::allocator<class std::shared_ptr<class CustomDatum> > > > > > >::exec():424
takuya-takeuchi commented 4 years ago

const char* path should be const char* path, const int32_t path_len