Skip to content

ValueError: cannot reshape array of size 1024 into shape (1920,1080,newaxis) #5912

Closed Locked Answered by bastimeyer
sugizo asked this question in Q&A
Discussion options

You must be logged in to vote

What you're trying to do doesn't make any sense.

You're reading 1024 bytes of Streamlink's output, which could be any kind of data like MPEG-2 transport stream data, MPEG-4 stream data or literally anything else, and then you're trying to put these 1024 bytes into a numpy.ndarray which you're then trying to reshape into a multi-dimensional array with dimension values which resemble the numbers of a common video resolution.

This is not how video data works. This is also very much unrelated to Streamlink. Not to mention that you're not even asking a question and just posting random code and the error message.

What you're doing is essentially this

import numpy as np
np.frombuffer(bytes(1024), 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bastimeyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants