web/remux: add speed to progress info
This commit is contained in:
parent
4c2acc595e
commit
1493762ce9
1 changed files with 14 additions and 5 deletions
|
@ -11,13 +11,18 @@
|
||||||
|
|
||||||
let totalDuration: number | undefined;
|
let totalDuration: number | undefined;
|
||||||
let processedDuration: number | undefined;
|
let processedDuration: number | undefined;
|
||||||
|
let speed: number | undefined;
|
||||||
let progress = '';
|
let progress = '';
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if (totalDuration && processedDuration && processing) {
|
if (totalDuration && processedDuration) {
|
||||||
const percentage = ((processedDuration / totalDuration) * 100).toFixed(2);
|
const percentage = Math.min(100, (processedDuration / totalDuration) * 100).toFixed(2);
|
||||||
progress = `(${percentage}%)`;
|
progress = `${percentage}%, ${speed}x`;
|
||||||
} else progress = '';
|
} else if (processing) {
|
||||||
|
progress = 'getting video metadata';
|
||||||
|
} else {
|
||||||
|
progress = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let processing = false;
|
let processing = false;
|
||||||
|
@ -26,6 +31,10 @@
|
||||||
if (progress.out_time_sec) {
|
if (progress.out_time_sec) {
|
||||||
processedDuration = progress.out_time_sec;
|
processedDuration = progress.out_time_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (progress.speed) {
|
||||||
|
speed = progress.speed;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ff.init();
|
ff.init();
|
||||||
|
@ -83,7 +92,7 @@
|
||||||
|
|
||||||
<div id="remux-processing" class:processing>
|
<div id="remux-processing" class:processing>
|
||||||
{#if processing}
|
{#if processing}
|
||||||
processing... {progress}
|
processing{progress ? ` (${(progress)})` : ''}...
|
||||||
{:else}
|
{:else}
|
||||||
done!
|
done!
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Reference in a new issue