Comments (5)
I want to use vidgear with for webcam and also the file loading.
For webcam or youtube run everything well problem is when I load the video.
My program is based on frame position so I use code like this:
video_pos =int(cap.get(cv2.CAP_PROP_POS_FRAMES))
but I get error
AttributeError: 'CamGear' object has no attribute 'get' how I can fix it?
Some question is how I can jump to specific frame.
Thanks for the answer
from vidgear.
My program is based on frame position so I use code like this:
video_pos =int(cap.get(cv2.CAP_PROP_POS_FRAMES))
but I get error
AttributeError: 'CamGear' object has no attribute 'get' how I can fix it?Some question is how I can jump to specific frame.
@TomasTrnkaPLC This is not a bug or issue with vidgear, you can easily access frame position with vidgear as follows:
from vidgear.gears import CamGear
import cv2
cap = CamGear(source='test.mp4').start()
video_pos =int(cap.stream.get(cv2.CAP_PROP_POS_FRAMES))
Why it is not advisable to use VidGear for jumping/seeking specific frame?
VidGear provides a high-level Threaded wrapper around OpenCV's API that targets only specific methods and classes related to Video Processing. It is possible to access other methods too but not advisable with VidGear as it uses Threads and Queue structure for capturing frame, which can result in undesired effects with those methods. Therefore you should refrain yourself from using frame jumping/seeking in VidGear but rather use OpenCV directly for this purpose.
Why it is not advisable to use Frame Jumping/Seeking in OpenCV at all?
OpenCV is still in beta stage, with many bugs that remain unsolved. The VideoCapture::set (CAP_PROP_POS_FRAMES, frameNumber)
method itself is not exact or reliable in OpenCV and can lead to wrong frame seeking at any instance. You can see this famous issue in OpenCV github repository related to this bug: opencv/opencv#9053 which is still unsolved.
Here is the comment from Alexander Alekhin(Lead developer at OpenCV):
OpenCV highly uses FFmpeg (in case of FFmpeg backend).
But FFmpeg itself doesn't work well with seeking on non "key" frames. There are many workarounds, but they are not very reliable. Sometimes seeking code works, sometimes doesn't.
If your have worked FFmpeg's code with accurate seeking, then we could try to integrate it into OpenCV.
Hence, Kindly refrain from using Frame Jumping/Seeking with OpenCV at all. Hope this helps good luck.
from vidgear.
from vidgear.
I have one more question
when I try run = cap.stream.set(cv2.CAP_PROP_POS_FRAMES,trackbarValue) I
get reply True but stream never jump there. I talking about the jump when
is file loaded.
@TomasTrnkaPLC I already told you that OpenCV is still buggy and cannot reliably seek/jump frame due to a inherit bug. You can see this issue in OpenCV Github repository related to this bug: opencv/opencv#9053 which is still unsolved.
on Windows 10 scripts only create
an empty .mp4 file and never record anything. Why?
@TomasTrnkaPLC Wrong, I tested all my VidGear scripts on Windows 10 x64 machine, There must a problem at your end. Kindly paste the terminal log here for further debugging the error which is causing this problem.
from vidgear.
from vidgear.
Related Issues (20)
- [Question]: Fetch Multiple Video from Youtube HOT 3
- [Proposal]: Dropped support for Python 3.7.x legacy HOT 2
- [Question]: How to get original video fps with VideoGear. HOT 8
- [Bug]: ScreenGear's options wrong names HOT 13
- [Bug]: CamGear - Error when loading first segment , while taking picture from youtube streaming HOT 2
- [Bug]: In NetGear client.recv() stucking in a some non returnable loop HOT 4
- [Proposal]: Add type annotations to the code or add stub files HOT 2
- [Proposal]: Add ffmpeg creationflag in Writegear API HOT 1
- [Bug]: frame desynchronization HOT 6
- [Question]: Does VidGear support downloading arbitrary frames and getting video sizes? HOT 4
- Putting a client IP into the Server code? HOT 2
- [Bug]: Stream gear imposes simplified aspect ratios, which does not seem necessary HOT 1
- [Bug]: no sound on output video with bare minimum code on google colab HOT 4
- [Bug]: No video shown on RTSP tested with VLC HOT 2
- [Question]: how to stream frames from opencv capture already in use? HOT 2
- Exception in thread NetGear, zmq.error.Again: Resource temporarily unavailable HOT 7
- [Question]: looping? HOT 2
- [Bug]: Freezes video thread when processing background thread? HOT 5
- [Bug]: Logging issue with yt-dlp HOT 2
- How to use nvdec/nvenc HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vidgear.