Code Monkey home page Code Monkey logo

Comments (7)

abhiTronix avatar abhiTronix commented on May 18, 2024 1

@imranilyas Bug in FFmpeg, see Issue #133. Being worked on in issue #160

from vidgear.

abhiTronix avatar abhiTronix commented on May 18, 2024

@jbwps Thanks for pointing this out, A bug is discovered as follows:

Bug Summary:

https://youtu.be/Nk4HAS-HOr4 is a live stream video which do not support video only streams therefore resulted in NoneType video object from pafy and finally "YouTube Mode is enabled and the input YouTube Url is invalid!" returned in vidgear.

I'm working on a fix, Kindly wait!!

from vidgear.

abhiTronix avatar abhiTronix commented on May 18, 2024

@jbwps Fixed! Kindly test testing branch by strictly following steps:


⚠️ This requires latest opencv-python or opencv-contrib-python binaries ( i.e. 4.1.1.26+)
installed on your machine. Install it from pypi as follows:

sudo pip3 install -U opencv-python  

For more info., see issue #14 ⚠️


 

  1. Firstly, Kindly clone and install the testing branch as follows:
git clone https://github.com/abhiTronix/vidgear.git
cd vidgear
git checkout testing
sudo pip install .
cd
  1. Then rerun the same algorithm with your URL (https://youtu.be/Nk4HAS-HOr4) as follows:
# import libraries
from vidgear.gears import CamGear
import cv2

stream = CamGear(source='https://youtu.be/Nk4HAS-HOr4', y_tube =True,  time_delay=1, logging=True).start() # YouTube Video URL as input

# infinite loop
while True:
	
	frame = stream.read()
	# read frames

	# check if frame is None
	if frame is None:
		#if True break the infinite loop
		break
	
	# do something with frame here
	
	cv2.imshow("Output Frame", frame)
	# Show output window

	key = cv2.waitKey(1) & 0xFF
	# check for 'q' key-press
	if key == ord("q"):
		#if 'q' key-pressed break out
		break

cv2.destroyAllWindows()
# close output window

stream.stop()
# safely close video stream.

from vidgear.

abhiTronix avatar abhiTronix commented on May 18, 2024

Resolved in 03ec554 . Feel free to reopen, if something doesn't works for you.

from vidgear.

imranilyas avatar imranilyas commented on May 18, 2024

I'm using CamGear and the following live youtube url: https://www.youtube.com/watch?v=ZWcV3g23c8Y&ab_channel=CNN-News18

After about 40 seconds, the livestream terminates and I get the following errors:
[tls @ 000001835c367600] Unable to read from socket
[tls @ 000001835c398580] Failed to send close message
[tls @ 000001835c394e40] Unable to read from socket
[tls @ 000001835c394ac0] Failed to send close message

from vidgear.

imranilyas avatar imranilyas commented on May 18, 2024

from vidgear.

abhiTronix avatar abhiTronix commented on May 18, 2024

Since GStreamer isn't available, what can I use as a substitute for the
backend parameter in the CamGear function?

@imranilyas Nothing else works for now, you have to wait for #160 to be resolved.

from vidgear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.