Comments (8)
Thank you for your reply. I modify it now, but I meet some other errors:
1).when I use NetGear frist demo, using sever and client in same container, I got this error:
AttributeError: 'NetGear' object has no attribute 'id' (this error raise in client)
2).when I use NetGear second demo, using server and client in differ container, using tcp connect, I got follow error:
zmq.error.ZMQError: Cannot assign requested address
ValueError: Failed to bind address: tcp://192.168.1.xxx: xxxx and pattern: 0! Kindly recheck all parameters.(this also raise in client)
it tell me my address is error, I can't connect my server ,what can I do to solve this problem?
from vidgear.
@abhiTronix Thank you vary much, I have solved this problem
from vidgear.
@Julius-ZCJ Thanks for reporting this bug. As temporary workaround Kindly remove flag
attribute for now (as it's useless in current scenario) from **options
dict which then becomes:
options = {'copy': False, 'track': False} //without `flag`
Also, I'm push fix for this bug in development branch shortly. Stay tuned.
from vidgear.
1).when I use NetGear frist demo, using sever and client in same container, I got this error:
AttributeError: 'NetGear' object has no attribute 'id' (this error raise in client)
@Julius-ZCJ This bug is already been fixed in the development branch, I'm posting related instructions shortly. As a workaround, you can enable logging=True
in Netgear Class as follows:
client = NetGear(receive_mode = True, logging = True)
2).when I use NetGear second demo, using server and client in differ container, using tcp connect, I got follow error:
zmq.error.ZMQError: Cannot assign requested address
ValueError: Failed to bind address: tcp://192.168.1.xxx: xxxx and pattern: 0! Kindly recheck all parameters.(this also raise in client)
@Julius-ZCJ Kindly change address
and port
parameter to your Client's IP Address, you can use: hostname -I
terminal command to know client's IP address and assign a unique Port address also.
from vidgear.
@abhiTronix I have successed in first demo ,but I'm failed in second demo.
I run server in container, which ip is 172.17.0.8. And the container host ip is 192.169.1.149,
I mount port is 5454->5454, and my pc ip is 192.168.1.189
I run client in my pc, my pc ip is 192.168.1.189. So, what ip i could used in server, what ip i could used in client? I first use 172.17.0.8, and run client in same container with same ip, and I successed.
But when I run server in container with ip 172.17.0.8, and run client in my pc with ip 192.169.1.149
I always failed. I have tried to using container ip in client but it also failed. what can I do to make container can connect my pc?
from vidgear.
but I'm failed in second demo.
I run server in container, which ip is 172.17.0.8. And the container host ip is 192.169.1.149,
I mount port is 5454->5454, and my pc ip is 192.168.1.189I run client in my pc, my pc ip is 192.168.1.189. So, what ip i could used in server, what ip i could used in client? I first use 172.17.0.8, and run client in same container with same ip, and I successed.
But when I run server in container with ip 172.17.0.8, and run client in my pc with ip 192.169.1.149
I always failed. I have tried to using container ip in client but it also failed. what can I do to make container can connect my pc?
@Julius-ZCJ You have to use the Client's IP address on both client and server end, i.e 192.168.1.189
in your case since you are using this pc as a client.
from vidgear.
@Julius-ZCJ Kindly test development branch by strictly following steps and post your results here:
- Firstly, Kindly clone and install the
testing
branch as follows:
git clone git clone https://github.com/abhiTronix/vidgear.git
cd vidgear
git checkout testing
sudo pip install .
cd
- Then rerun the following updated algorithm for testing, but remember to change the IP address and port address with yours :
A. Server End:
Open the terminal on System-1 (Server) and execute the following python code. **Also, remember to write down the IP-address of Server by executing the command: 'hostname -I
' and replace it in the following code:
# import libraries
from vidgear.gears import NetGear
import cv2
stream = cv2.VideoCapture('test.mp4') #Open any video stream
options = {flag : 0, copy : False, track : False}
#change following IP address '192.168.1.xxx' with yours
server = NetGear(address = '192.168.1.xxx', port = '5454', protocol = 'tcp', pattern = 0, receive_mode = False, logging = True, **options) #Define netgear server at your system IP address.
# infinite loop until [Ctrl+C] is pressed
while True:
try:
(grabbed, frame) = stream.read()
# read frames
# check if frame is not grabbed
if not grabbed:
#if True break the infinite loop
break
# do something with frame here
# send frame to server
server.send(frame)
except KeyboardInterrupt:
#break the infinite loop
break
# safely close video stream
stream.release()
# safely close server
writer.close()
B. Client End:
Then open a terminal on the System-2(Client) and replace the IP address with Server's IP address and execute the following python code and see the output:
# import libraries
from vidgear.gears import NetGear
import cv2
options = {flag : 0, copy : False, track : False}
#change following IP address '192.168.1.xxx' with yours
client = NetGear(address = '192.168.1.xxx', port = '5454', protocol = 'tcp', pattern = 0, receive_mode = True, logging = True, **options) #Define netgear client at Server IP address.
# infinite loop
while True:
# receive frames from network
frame = client.recv()
# check if frame is None
if frame is None:
#if True break the infinite loop
break
# do something with frame here
# Show output window
cv2.imshow("Output Frame", frame)
key = cv2.waitKey(1) & 0xFF
# check for 'q' key-press
if key == ord("q"):
#if 'q' key-pressed break out
break
# close output window
cv2.destroyAllWindows()
# safely close client
client.close()
from vidgear.
Successfully Resolved & Merged in commit: 48c6a69
from vidgear.
Related Issues (20)
- [Question]: Failed to start the camera with CamGear (source=self. source). start () in celery's task HOT 3
- [Docs]: Update the chunk size parameter in docs HOT 3
- [Bug]: frame_size_reduction does not allow value of 0 HOT 4
- [Bug]: NetGear graceful close doesn't work for pattern=2 HOT 5
- [Question]: Change default video path in WebGear HOT 3
- [Question]: Transforms size keep growing. HOT 3
- [Question]: I edit individual frames, but the original unearthly video still ends up on YouTube. Why? HOT 15
- [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
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.