Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion never takes place #20

Open
NVentimiglia opened this issue Apr 29, 2018 · 1 comment
Open

Conversion never takes place #20

NVentimiglia opened this issue Apr 29, 2018 · 1 comment

Comments

@NVentimiglia
Copy link

NVentimiglia commented Apr 29, 2018

package id="Xamarin.Android.MP4Transcoder" version="1.0.9" targetFramework="monoandroid60"

    public class VideoUtilityAndroid
    {
        public async Task<string> ConvertFileAsync(
            string inputPath,
            Action<int, int> onProgress = null)
        {

            File inputFile = new File(inputPath);

            if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
            {
                try
                {
                    File ouputFile = new File(inputFile.CanonicalPath.Replace(".mp4", "_min.mp4"));

                    double percent = 0;

                    await Xamarin.MP4Transcoder.Transcoder.For960x540Format().ConvertAsync(
                          inputFile,
                          ouputFile, f =>
                          {
                             // this is never called
                              percent = f;
                              onProgress?.Invoke((int)(f * (double)100), 100);
                          });


                    // file is empty at this point
                    return ouputFile.Path;
                }
                catch (Exception ex)
                {
                    LogController.LogError(ex);
                }
            }

            return inputFile.Path;
        }
    }
@ackava
Copy link
Contributor

ackava commented Feb 25, 2019

Could you please add some log?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants