Skip to content
Snippets Groups Projects
Commit 60f00178 authored by Fabio Maschi's avatar Fabio Maschi
Browse files

fix

parent c6c1c247
No related branches found
No related tags found
1 merge request!562Resolve SD-235 "Feat/ booth screen video"
......@@ -169,47 +169,47 @@ describe('VideosService', () => {
await service.downloadFile(
`https://static-igem-dev.s3.eu-west-3.amazonaws.com/${videoFileKey}`,
`./tmp/${teamID}-${slug}.mp4`,
`./tmp/${teamID}-original.mp4`,
)
await service.downloadFile(
`https://static-igem-dev.s3.eu-west-3.amazonaws.com/${mainCaptionFileKey}`,
`./tmp/${teamID}-${slug}.vtt`,
`./tmp/${teamID}-en.vtt`,
)
await service.embedCaption(teamID, slug).then(async () => {
fs.unlinkSync(`./tmp/${teamID}-${slug}.mp4`)
fs.unlinkSync(`./tmp/${teamID}-${slug}.vtt`)
await service.embedCaption(teamID).then(async () => {
fs.unlinkSync(`./tmp/${teamID}-original.mp4`)
fs.unlinkSync(`./tmp/${teamID}-en.vtt`)
})
await service.downloadFile(
`https://static.igem.org/websites/jamboree/2024/overlays/${teamID}-${slug}.png`,
`./tmp/${teamID}-${slug}-overlay.png`,
`https://static.igem.org/websites/jamboree/2024/overlays/${teamID}-${slug}-overlay.png`,
`./tmp/${teamID}-overlay.png`,
)
await service
.embedOverlay(teamID, slug)
.embedOverlay(teamID)
.then(async () => {
// upload to s3
// await this.s3
// .uploadObject({
// key: `websites/jamboree/2024/videos/${teamID}-${slug}.mp4`,
// body: fs.readFileSync(`./tmp/overlayed-${teamID}-${slug}.mp4`),
// body: fs.readFileSync(`./tmp/${teamID}-overlay.mp4`),
// contentType: 'video/mp4',
// })
// .then(async () => {
// fs.unlinkSync(`./tmp/overlayed-${teamID}-${slug}.mp4`)
// fs.unlinkSync(`./tmp/${teamID}-overlay.mp4`)
// })
fs.unlinkSync(`./tmp/overlayed-${teamID}-${slug}.mp4`)
fs.unlinkSync(`./tmp/${teamID}-overlay.mp4`)
})
.finally(() => {
fs.unlinkSync(`./tmp/${teamID}-${slug}-overlay.png`)
fs.unlinkSync(`./tmp/captioned-${teamID}-${slug}.mp4`)
fs.unlinkSync(`./tmp/${teamID}-overlay.png`)
fs.unlinkSync(`./tmp/${teamID}-caption.mp4`)
})
expect(fs.existsSync(`./tmp/overlayed-${teamID}-${slug}.mp4`)).toBe(false)
expect(fs.existsSync(`./tmp/captioned-${teamID}-${slug}.mp4`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-${slug}-overlay.png`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-${slug}.mp4`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-${slug}.vtt`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-overlay.mp4`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-captioned.mp4`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-overlay.png`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-original.mp4`)).toBe(false)
expect(fs.existsSync(`./tmp/${teamID}-en.vtt`)).toBe(false)
}, 120000)
})
})
......@@ -385,7 +385,7 @@ export class VideosService {
return videoFileKey
}
private async downloadFile(
async downloadFile(
fileUrl: string,
outputLocationPath: string,
): Promise<void> {
......@@ -401,7 +401,7 @@ export class VideosService {
})
}
private async embedCaption(teamID: number): Promise<void> {
async embedCaption(teamID: number): Promise<void> {
await new Promise<void>((resolve, reject) => {
ffmpeg(`./tmp/${teamID}-original.mp4`)
.input(`./tmp/${teamID}-en.vtt`)
......@@ -420,7 +420,7 @@ export class VideosService {
})
}
private async embedOverlay(teamID: number): Promise<void> {
async embedOverlay(teamID: number): Promise<void> {
await new Promise<void>((resolve, reject) => {
ffmpeg(`./tmp/${teamID}-overlay.png`)
.input(`./tmp/${teamID}-captioned.mp4`)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment