UWP_ZZMpeg 1.0.1

dotnet add package UWP_ZZMpeg --version 1.0.1
NuGet\Install-Package UWP_ZZMpeg -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UWP_ZZMpeg" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UWP_ZZMpeg --version 1.0.1
#r "nuget: UWP_ZZMpeg, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install UWP_ZZMpeg as a Cake Addin
#addin nuget:?package=UWP_ZZMpeg&version=1.0.1

// Install UWP_ZZMpeg as a Cake Tool
#tool nuget:?package=UWP_ZZMpeg&version=1.0.1

UWP_ZZMpeg- highlevel wrapper for FFMpeg libraries (not ffmpeg binary) for UWP(x86 only). Basic usage:

  1. Create an object FFMpeg
  2. Call FFMpeg.ExtractVideoFrame to get preview image from video
  3. Call FFMpeg.ConvertMediaFile to asynchronously convert video to other format
  4. Call FFMpeg.AssembleMediaFiles to asynchronously concat multiple input files into single output. They are concatinated in the same order they are specified in inputFiles array
  5. Call FFMpeg.SplitMediaFile to asynchronously split source media file into specified number of lesser files of equal duartion
  6. Call FFmpeg.SplitMediaFileWithTS to asynchronously split source media file into several lesser files based on specified timestamps array
  7. Call FFMpeg.ExtractMediaInfo to get media info from file

Example converting video:

public class ConvertOperation : INotifyPropertyChanged{ 

      public enum ConvertionState
  {
    Idle,
    Converting,
    Cancelling,
    Cancelled,
    Error,
    Done
}

 #region INPC implementation

    public event PropertyChangedEventHandler PropertyChanged;
    protected void SetMyProperty([CallerMemberName] string propertyName = "")
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));

    }

    #endregion
    
    private bool _isEnableInterface = true;
    private string path;
    private string outFolderPath;
    private string format;
    private CancelTaskToken cTokenSource;
    private ConvertionState state;

    public string Name => Path.GetFileName(path);
    public BindableProgress<double> Progress { get; private set; }

    public ConvertionState State
    {
        get => state;
        set
        {
            state = value;
            SetMyProperty();
        }
    }

  public bool IsEnableInterface
    {
        get
        {
            return _isEnableInterface;
        }
        set
        {
            if (value != _isEnableInterface)
            {
                _isEnableInterface = value;
               
                SetMyProperty();
            }
        }
    }

    public ConvertOperation(string filePath, string outFolderPath,string destFormat)
    {

        path = filePath;
        this.outFolderPath = outFolderPath;
        format = destFormat;
        Progress = new BindableProgress<double>();
        cTokenSource = new CancelTaskToken();
        State = ConvertionState.Idle;
    }

  protected async Task LockInterface(Func<Task> p)
    {
        bool value = IsEnableInterface;
        IsEnableInterface = false;
        try
        {
            await p.Invoke();
        }
        catch (Exception ex)
        {
        }
        IsEnableInterface = value;
    }
   

    public async Task Start(CancelTaskToken cToken )
    {
        await LockInterface(async () => {
            State = ConvertionState.Converting;
            string name = Path.GetFileNameWithoutExtension(path);
            string outPath = Path.Combine(outFolderPath, $"converted_{name}.{format}");

            try
            {
                EncoderParameters parameters = new EncoderParameters();
                FFMpeg ffmpeg = new FFMpeg();
                ffmpeg.EncoderParametersInit(parameters);
                parameters.AudioEncoder = AudioCodec.AAC.StringValue();
                var result = ffmpeg.ConvertMediaFile(path, outPath, parameters, cTokenSource);
                result.Progress = (IAsyncActionWithProgress<double> info, double value) => {
                    Progress.ProgressChangedHandler(null, value * 100);

                };
                await result;
                State = ConvertionState.Done;
            }
            catch (TaskCanceledException)
            {
                State = ConvertionState.Cancelled;
            }
            catch (Exception ex)
            {
                State = ConvertionState.Error;
                System.Diagnostics.Debug.WriteLine($"Error converting file: {ex.Message}");
            }
        });
       
    }

    public void Cancel()
    {
        if (State != ConvertionState.Converting)
            return;
        State = ConvertionState.Cancelling;
        cTokenSource.Cancel();
    }
}
Product Compatible and additional computed target framework versions.
native native is compatible. 
Universal Windows Platform uap was computed.  uap10.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 1,250 2/1/2018
1.0.0 1,246 1/29/2018