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 With YouTube Live #16

Closed
jbwps opened this issue May 23, 2019 · 7 comments
Closed

Error With YouTube Live #16

jbwps opened this issue May 23, 2019 · 7 comments
Labels
BUG 🐛 Vidgear api's error, flaw or fault SOLVED 🏁 This issue/PR is resolved now. Goal Achieved!
Milestone

Comments

@jbwps
Copy link

jbwps commented May 23, 2019

I'm running the example code to use a live YouTube stream as a video source, but am receiving an error:

"YouTube Mode is enabled and the input YouTube Url is invalid!"

I'm using the sample code verbatim, and only changed the YouTube URL to a live stream (https://youtu.be/Nk4HAS-HOr4) instead of the Rick Roll video.

I'm pretty sure all of my packages are up to date, including youtube-dl

@abhiTronix abhiTronix added the BUG 🐛 Vidgear api's error, flaw or fault label May 24, 2019
@abhiTronix
Copy link
Owner

abhiTronix commented May 24, 2019

@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!!

@abhiTronix
Copy link
Owner

abhiTronix commented May 24, 2019

@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.

@abhiTronix abhiTronix added the WAITING TO TEST ⏲️ Asked user to test the suggested example/binary/solution label May 24, 2019
@abhiTronix abhiTronix added this to the v0.1.5 milestone May 24, 2019
@abhiTronix
Copy link
Owner

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

@imranilyas
Copy link

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

@abhiTronix
Copy link
Owner

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

@imranilyas
Copy link

imranilyas commented Nov 25, 2020 via email

@abhiTronix
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG 🐛 Vidgear api's error, flaw or fault SOLVED 🏁 This issue/PR is resolved now. Goal Achieved!
Projects
None yet
Development

No branches or pull requests

3 participants