This project has moved and is read-only. For the latest updates, please go here.

MPEG Encoding

Feb 26 at 11:38 PM
Edited Feb 26 at 11:41 PM

I am developing an app that uses SharpAvi. I am trying to get a MPeg4 codec working reliably.
If people see an option in my app, try to use it and it pops up an error message then people will blame my app.

I have tried X263 and Xvid. Both of them are detected and I add them to a dropdownlist.

I had X263 working, but for some reason its now stopped again.

No compatiable MPEG-4 encoder found.

I have tried compiling my app to x86 (32bit) only.
Tried installing only the 32bit X263 driver, reinstalling, rebooting.

I have never gotten Xvid to work properly.

Encoder operation returned an error: - 100.

Tried DivX but it was not detected. Not sure I picked the correct download.

My code just in case its that.

using (AviWriter writer = new AviWriter(videoParams.FileName))
                writer.FramesPerSecond = videoParams.FrameRate;
                writer.EmitIndex1 = true;

                IAviVideoStream stream = writer.AddMpeg4VideoStream(
                    quality: videoParams.Quality,
                    codec: videoParams.Codec,
                    forceSingleThreadedAccess: true);

                byte[] frameData = new byte[stream.Width * stream.Height * 4];

                for (int index = 0; index <= numberOfFrames; index++)
                    // Take a screenshot
                    GetScreenshot(frameData, videoParams);

                    // write frame to the video
                    stream.WriteFrame(true, frameData, 0, frameData.Length);

Is there any mpeg4 brand and version of codec that works reliably?
Apr 15 at 2:55 AM
Edited Apr 15 at 2:56 AM

I got this working by downloading the source code and compiling to x86. The x264 codec then worked properly.

My Moving Images app is now in the windows store.