Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iGEM.org Backend
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iGEM HQ Tech
iGEM.org Backend
Commits
60f00178
Commit
60f00178
authored
4 months ago
by
Fabio Maschi
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
c6c1c247
No related branches found
Branches containing commit
No related tags found
1 merge request
!562
Resolve SD-235 "Feat/ booth screen video"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/videos/tests/videos.service.spec.ts
+18
-18
18 additions, 18 deletions
src/modules/videos/tests/videos.service.spec.ts
src/modules/videos/videos.service.ts
+3
-3
3 additions, 3 deletions
src/modules/videos/videos.service.ts
with
21 additions
and
21 deletions
src/modules/videos/tests/videos.service.spec.ts
+
18
−
18
View file @
60f00178
...
...
@@ -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
)
})
})
This diff is collapsed.
Click to expand it.
src/modules/videos/videos.service.ts
+
3
−
3
View file @
60f00178
...
...
@@ -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`
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment