Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: VideoCapture::New - failed to open capture #48

Open
cherishman2005 opened this issue Jan 13, 2022 · 2 comments
Open

Error: VideoCapture::New - failed to open capture #48

cherishman2005 opened this issue Jan 13, 2022 · 2 comments

Comments

@cherishman2005
Copy link
Owner

cherishman2005 commented Jan 13, 2022

# node simpleTracking0.js 
Unable to stop the stream: Inappropriate ioctl for device
/home/nodejs/face_detection/examples/utils.js:12
  const cap = new cv.VideoCapture(videoFile);
              ^

Error: VideoCapture::New - failed to open capture
    at grabFrames (/home/nodejs/face_detection/examples/utils.js:12:15)
    at Object.<anonymous> (/home/nodejs/face_detection/examples/simpleTracking0.js:5:1)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
@cherishman2005
Copy link
Owner Author

cherishman2005 commented Jan 13, 2022

报错:Unable to stop the stream: Inappropriate ioctl for device

https://blog.csdn.net/qq_35630339/article/details/87937730

@cherishman2005
Copy link
Owner Author

cherishman2005 commented Jan 13, 2022

I have solved this issue on Ubuntu 16.04.3.

sudo apt-get install ffmpeg
sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev

Rebuild OpenCV 3.3.0 with the following commands:

cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local  -D WITH_FFMPEG=ON -D WITH_TBB=ON -D WITH_GTK=ON -D WITH_V4L=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON -DWITH_QT=OFF -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES" ..
make -j7
sudo make install

https://stackoverflow.com/questions/41200201/opencv-unable-to-stop-the-stream-inappropriate-ioctl-for-device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant