How to load an image2 format from FFMPEG? #1512
-
I'm creating thumbnails from video using FFMPEG pipes. When piped the image is returned an image2 format which i believe to be a YUV file of some kind. In .NET 47 I can do the following to load the image for subsequent processing:
and the conversion is automatically handled but in ImageSharp it fails:
Does anyone know if there is something simple i can do to resolve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
ImageSharp only has builtin support for the formats listed in the error message. Maybe you can use FFMediaToolkit to load the stream and get the frame as Then convert it to an ImageSharp image like this: |
Beta Was this translation helpful? Give feedback.
-
I’m curious... were you originally using System.Drawing? If so, I’m wondering if it could simply be a stream position issue? |
Beta Was this translation helpful? Give feedback.
ImageSharp only has builtin support for the formats listed in the error message.
Maybe you can use FFMediaToolkit to load the stream and get the frame as
ImageData
as described here:https://github.com/radek-k/FFMediaToolkit#code-samples
Then convert it to an ImageSharp image like this:
https://github.com/radek-k/FFMediaToolkit#usage-details