-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
222 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { test, expect, Page } from '@playwright/test'; | ||
import { VIDEO_EXTENSIONS, SUPPORTED_VIDEO_CONVERSIONS } from './fixtures'; | ||
|
||
// Annotate entire file as serial. | ||
test.describe.configure({ mode: 'serial' }); | ||
|
||
let page: Page; | ||
|
||
test.describe('FFmpeg basic file extension conversions', async () => { | ||
/** | ||
* Get index page and wait until ffmpeg is ready | ||
*/ | ||
test.beforeAll(async ({ browser }) => { | ||
page = await browser.newPage(); | ||
await page.goto('http://localhost:5173/'); | ||
|
||
const ready = await page.evaluate(async () => { | ||
if (!ffmpeg.isReady) { | ||
await new Promise<void>((resolve) => { | ||
ffmpeg.whenReady(resolve); | ||
}); | ||
} | ||
|
||
return ffmpeg.isReady; | ||
}); | ||
expect(ready).toBe(true); | ||
}); | ||
|
||
for (const format of VIDEO_EXTENSIONS) { | ||
test(`test converting ${format} into gif`, async () => { | ||
const length = await page.evaluate(async (ext) => { | ||
const result = await ffmpeg | ||
.input({ source: `http://localhost:5173/samples/video.${ext}` }) | ||
.ouput({ | ||
format: 'gif', | ||
video: { size: { width: 240, height: 135 }, framerate: 5 }, | ||
}) | ||
.export(); | ||
|
||
return result?.length; | ||
}, format); | ||
expect(length).toBeGreaterThan(0); | ||
}); | ||
} | ||
|
||
for (const formats of SUPPORTED_VIDEO_CONVERSIONS) { | ||
test(`test converting video from ${formats[0]} into ${formats[1]} with trim`, async () => { | ||
const length = await page.evaluate(async (ext) => { | ||
const result = await ffmpeg | ||
.input({ | ||
source: `http://localhost:5173/samples/video.${ext[0]}`, | ||
seek: 2, | ||
}) | ||
.ouput({ format: ext[1], duration: 3 }) | ||
.export(); | ||
|
||
return result?.length; | ||
}, formats); | ||
expect(length).toBeGreaterThan(0); | ||
}); | ||
} | ||
}); |
File renamed without changes.
Oops, something went wrong.