secile / OpenH264Lib.NET

Cisco's openh264 wrapper library for .NET Framework.
MIT License
110 stars 34 forks source link

Decode method returns null image #9

Closed PhilJenson closed 4 years ago

PhilJenson commented 4 years ago

I followed the readme instructions and I can encode an image to an AVI file using the sample program. This avi file plays ok in media player.

When I use the sample program to decode the avi file, decoder.Decode(...) always returns a null bitmap. This is on Windows 10.

secile commented 4 years ago

Hello, thank you for your question. (1) Does AVI file is created by sample program "Encode" function? or your own AVI file? (2) Always returns null? decoder.Decode(...) may return null if there is not enough data to build the Bitmap. (3) How many bitmaps you use in encode? If less than three or four, it is too less.

PhilJenson commented 4 years ago
  1. AVI created by Encode function in sample app AND my own AVI
  2. Yes, always.
  3. I used the Encode button on the sample application and selected a single picture. This created an avi file. I then selected the Decode button on the sample application and selected this AVI. A null bitmap was returned.

I am now using FFMPEG so wont be pursuing this further. But thanks for getting back to me.

secile commented 4 years ago

Please select a lot of bitmaps, not single file. You can multi select bitmap files in encode dialog. Decord requires a lot of data.