Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava authored Jul 20, 2016
1 parent 9882334 commit df9dd73
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ You can download Xamarin.Android.FFmpeg package from Nuget Package manager or ru

}

public File ConvertFile(Context contex,
/**
* This method must be called from UI thread.
***/
public Task<File> ConvertFileAsync(Context context,
File inputFile,
Action<string> logger = null,
Action<int,int> onProgress = null)
Expand Down Expand Up @@ -83,21 +86,21 @@ You can download Xamarin.Android.FFmpeg package from Nuget Package manager or ru
int total = 0;
int current = 0;

await FFMpeg.Xamarin.FFMpegLibrary.Run(
context,
cmdParams
, (s) => {
logger?.Invoke(s);
int n = Extract(s, "Duration:", ",");
if (n != -1) {
total = n;
}
n = Extract(s, "time=", " bitrate=");
if (n != -1) {
current = n;
onProgress?.Invoke(current, total);
}
});
await FFMpeg.Xamarin.FFMpegLibrary.Run(
context,
cmdParams
, (s) => {
logger?.Invoke(s);
int n = Extract(s, "Duration:", ",");
if (n != -1) {
total = n;
}
n = Extract(s, "time=", " bitrate=");
if (n != -1) {
current = n;
onProgress?.Invoke(current, total);
}
});

return ouputFile;
}
Expand Down

0 comments on commit df9dd73

Please sign in to comment.