Video Help (MP4)

So, our company decided to port our project over to unity which everybody was all gun-ho and happy to do. However, this project requires MP4 playback (from a local file.) We have a catalouge of around 6,000+ MP4 files and it would seem that Unity cannot play them. I converted one to OGV and it played like a champ. Am I missing here or is this platform (Unity) really unable to play one of the most popular video formats in existence? Sample code below:

        try
        {
            var mov = GameObject.Find("MoviePlayer");

            var url = @"file:///C:/myfile.mp4";
            var www = new WWW(url);

            var movieTexture = www.movie;

            mov.renderer.material.mainTexture = movieTexture;
            movieTexture.Play();

        }
        catch (Exception er)
        {
            print("Fatal Exception: " + er.ToString());
        }

My understanding is that the only video format Unity natively supports is OGG Theora. When you import a (local) MP4/MOV/AVI file into your Unity project, Unity uses Quicktime to convert it to OGV behind-the-scenes, and that’s how the resource is bundled with your published game.

But, if you’re trying to access a video at runtime via WWW, that offline conversion obviously isn’t available, which is why “WWW.movie data must be a movie in Ogg Theora format.” (Unity - Scripting API: WWW.movie)

Here is a guide to help you convert MP4 to OGV.