![]() ![]() However, the frames that I am encoding are very amenable to run-length encoding. I know that Video for Windows is an ancient legacy API. If I generate the file on Win7 and view on Win8 then the video displays as desired. If I generate a file on Win8 and view on Win7 then the file does not play correctly. But on Win8 the video just contains the first white frame. This happens as expected on Win7 and earlier. So the desired video transitions from white to black. And each frame selects a different one of those gray shades. Std::cout << "AVIFileRelease failed" << std::endl Std::cout << "AVIStreamRelease failed" << std::endl If (AVIStreamRelease(pCompressedStream) != 0 || AVIStreamRelease(pStream) != 0) Std::cout << "AVIStreamWrite failed" << std::endl If (AVIStreamWrite(pCompressedStream, frame, 1, bits, bmi->bmiHeader.biSizeImage, 0, NULL, NULL) != 0) ![]() If (AVIStreamSetFormat(pCompressedStream, 0, bmi, bmiSize) != 0)įor (int frame = 0 frame bmiHeader.biSizeImage) Std::cout bmiHeader.biSize = sizeof(BITMAPINFOHEADER) īmi->bmiHeader.biWidth = si.rcFrame.right īmi->bmiHeader.biHeight = si.rcFrame.bottom īmi->bmiHeader.biSizeImage = bmi->bmiHeader.biWidth*bmi->bmiHeader.biHeight If (AVIFileOpenA(&pFile, "out.avi", OF_CREATE | OF_WRITE, NULL) != 0) I've made an SSCCE to demonstrate the problem: #include ![]() avi file but when it is viewed in, for instance, Windows Media Player, the video plays for the correct duration but the first frame is shown the whole time. This has worked admirably for many years, but I've just discovered that my code does not behave correctly on Windows 8. I have an old application that provides videos inside. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |