snavas / GECCO

Gesture-Enabled Remote Communication and Collaboration
MIT License
5 stars 0 forks source link

Error in compression_param when updating from vidgear 0.1.8 to 0.1.9 #4

Closed snavas closed 3 years ago

snavas commented 3 years ago
AttributeError: module 'cv2.cv2' has no attribute 'compression_param'
Helper :: CRITICAL :: `compression_param` is not a valid OpenCV property!

AttributeError: module 'cv2.cv2' has no attribute 'compression_format'
Helper :: CRITICAL :: `compression_format` is not a valid OpenCV property!

vidgear version= 0.1.9 opencv version= 4.2.0.34

abhiTronix commented 3 years ago

@snavas There's no parameters like c_option or s_option in NetGear_Async, and you must use its option parameter only. Therefore, Just replace

https://github.com/snavas/GECCO/blob/d6d69c3cdb6a9388cb83ce04334681f14ee73265/start.py#L71-L79

with

 # define and launch Client with `receive_mode = True` 
 options = {'compression_param': cv2.IMREAD_COLOR} 
 client = NetGear_Async( 
     port = HostPort, pattern=1, receive_mode=True, **options 
 ).launch() 
 options = {'compression_format': '.jpg', 'compression_param': [cv2.IMWRITE_JPEG_QUALITY, 50]} 
 server = NetGear_Async( 
     address = PeerAddress, port = PeerPort, pattern=1, **options 
 ) 

to solve this problem.

Also switch to new vidgear==0.2.0 for faster and bug-free performance than v0.1.9. Goodluck.

snavas commented 3 years ago

Thank you for your suggestion @abhiTronix! I have applied the changes you mentioned but sadly the error remains. I also tried to update vidgear to 'v0.2.0' and cv2 to '4.5.1.48' and try again but still no luck. However, I will keep the changes in order to have a more correct syntax when using vidgear.

PaulaScharf commented 3 years ago

There is no bug anymore but also no video, if we try send and receive frames between two separate machines.

abhiTronix commented 3 years ago

Hey @PaulaScharf, What is the terminal output on both client and server end? Can you please paste it along with logging enabled(i.e. logging=True).

abhiTronix commented 3 years ago

Also, see if input frame at server end is valid by placing:

    # Show output window
    cv2.imshow("Output", frame)
    key = cv2.waitKey(1) & 0xFF

lines to watch frames.

PaulaScharf commented 3 years ago

Hi @abhiTronix, amazing how fast you are to reply :) Currently I think the problem is not in the vidgear library but in our setup. Because I checked again with the new version of vidgear and now it works again (I think). It behaves really inconsistently. But I will also check the logs and the input frame. Thank you

abhiTronix commented 3 years ago

@PaulaScharf lol, I got this issue notification while replying on another issue. So, I thought to drop a reply here as well. 😃 NVM.