private void Start()
    {
        float temp = Time.realtimeSinceStartup;

        qt = new QTTexture1();
        if (load)
        {
            qt.LoadTexture(Application.persistentDataPath + "/" + filename + ".qtimg");
        }
        else
        {
            qt.LoadTexture(inImg, tolerance);
        }
        //Debug.Log("Compression Time: " + (Time.realtimeSinceStartup - temp));
        //temp = Time.realtimeSinceStartup;
        if (!load)
        {
            qt.SaveToFile(Application.persistentDataPath + "/" + filename + ".qtimg");
        }
        //Debug.Log(Application.dataPath);
        //Debug.Log("Save Time: " + (Time.realtimeSinceStartup - temp));

        textureOutput = qt.ToTexture2D();
        mat.SetTexture(Shader.PropertyToID("_MainTex"), textureOutput);

        //Debug.Log(Application.persistentDataPath);
        Debug.Log("Done Compress");
    }
    private void Start()
    {
        //float temp = Time.realtimeSinceStartup;
        QTTexture1 qt = Compress();

        //Debug.Log("Compression Time: " + (Time.realtimeSinceStartup - temp));
        //temp = Time.realtimeSinceStartup;
        //qt.SaveToFile(Application.persistentDataPath + "/" + filename + ".qtimg");
        //Debug.Log("Save Time: " + (Time.realtimeSinceStartup - temp));
        textureOutput = qt.ToTexture2D();
        mat.SetTexture(Shader.PropertyToID("_MainTex"), textureOutput);
        //Debug.Log(Application.persistentDataPath);
    }
 void FixedUpdate()
 {
     counter += Time.fixedDeltaTime;
     if (counter >= limit)
     {
         Debug.Log("Compressing incremental");
         counter    = 0;
         tolerance += 1f;
         QTTexture1 qt = Compress();
         //qt.SaveToFile(Application.persistentDataPath + "/video" + (index++) + ".qtimg");
         textureOutput = qt.ToTexture2D();
         mat.SetTexture(Shader.PropertyToID("_MainTex"), textureOutput);
     }
 }