ValueError: cannot reshape array of size 1024 into shape (1920,1080,newaxis) #5912
-
Descriptionobjectivewrite output in python API trial using vidgear writersteps
result
trial using ffmpegcv writersteps code
result
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 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), np.uint8).reshape(1920, 1080, -1) which as you can see, is totally unrelated to Streamlink, and even if it were, it doesn't make any sense in terms of media streams. What you want is to demux the stream data first, then decode (one of) the video stream(s) and get the pixel data of a specific frame. This is out of the scope of this discussion forum and you'll have to ask somewhere else. Good luck. |
Beta Was this translation helpful? Give feedback.
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