Get thumbnail as byte array from stdout#62
Conversation
| } while (lastRead > 0); | ||
|
|
||
| this.thumbnailByteArray = ms.ToArray(); | ||
| } |
There was a problem hiding this comment.
Why not try reading from baseStream all in one go?
byte[] buffer = new byte[baseStream.Length];
baseStream.Read(buffer, 0, buffer.Length);
this.thumbnailByteArray = buffer;
Only reason I could think as to why it wouldn't work is if baseStream.CanSeek is false.
There was a problem hiding this comment.
I'd copied a code snippet. In light of your comments I've changed how the file stream is copied to the memory stream. Thanks.
|
Correct me if I'm wrong, but according to your change, the image file will still be created on hard drive. |
No, a file isn't created on the hard drive. |
|
This can resolve the issue #110 |
I've added a method GetThumbnail that doesn't have an outputFile parameter but instead returns a byte array. This byte array is the result of the thumbnail being piped out from FFmpeg.