ffmpeginteropx / FFmpegInteropX

FFmpeg decoding library for Windows 10 UWP and WinUI 3 Apps
Apache License 2.0
211 stars 53 forks source link

Allow late-initialization of video pixel format #215

Closed lukasf closed 4 years ago

lukasf commented 4 years ago

This will fix video playback of the 4.07GB sample provided in #214. FFmpeg will report PIX_FMT_NONE for the video stream.

In #91, I added a check for PIX_FMT_NONE and reject stream creation for such files. However, we do already delay-init the sws scaler. So we can wait until the first frame is decoded, and use the pixel format from that frame to initialize the scaler. If a frame can be decoded, it will have a correct pixel format.

brabebhin commented 4 years ago

Ironic, i had most of the changes in the hw accel PR but undid them lol.

lukasf commented 4 years ago

Yeah I know :)