Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
5dc21ead
Commit
5dc21ead
authored
Oct 28, 2020
by
Jerome Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize test scripts
parent
12c768d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
21 deletions
+34
-21
config.js
wasm/tests/config.js
+3
-0
data
wasm/tests/data
+1
-1
transcode-mp4.test.js
wasm/tests/transcode-mp4.test.js
+27
-0
transcode-webm.test.js
wasm/tests/transcode-webm.test.js
+3
-20
No files found.
wasm/tests/config.js
0 → 100644
View file @
5dc21ead
module
.
exports
=
{
TIMEOUT
:
30000
,
};
data
@
96cca2e2
Subproject commit
e5e817520bcba4b56b394989ba3d136d9f110b1c
Subproject commit
96cca2e2666bd1a82c9bc46b95e50e195f438c23
wasm/tests/transcode-mp4.test.js
0 → 100644
View file @
5dc21ead
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
{
TIMEOUT
}
=
require
(
'./config'
);
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
aviFilePath
=
path
.
join
(
__dirname
,
'data'
,
'video-1s.avi'
);
const
MP4_SIZE
=
38372
;
let
aviData
=
null
;
beforeAll
(
async
()
=>
{
aviData
=
Uint8Array
.
from
(
fs
.
readFileSync
(
aviFilePath
));
});
test
(
'transcode avi to x264 mp4'
,
async
()
=>
{
const
Core
=
await
runFFmpeg
(
'video.avi'
,
aviData
,
[
'-i'
,
'video.avi'
,
'video.mp4'
]);
const
fileSize
=
Core
.
FS
.
readFile
(
'video.mp4'
).
length
;
Core
.
FS
.
unlink
(
'video.mp4'
);
expect
(
fileSize
).
toBe
(
MP4_SIZE
);
},
TIMEOUT
);
test
(
'transcode avi to x264 mp4 twice'
,
async
()
=>
{
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
const
Core
=
await
runFFmpeg
(
'video.avi'
,
aviData
,
[
'-i'
,
'video.avi'
,
'video.mp4'
]);
const
fileSize
=
Core
.
FS
.
readFile
(
'video.mp4'
).
length
;
Core
.
FS
.
unlink
(
'video.mp4'
);
expect
(
fileSize
).
toBe
(
MP4_SIZE
);
}
},
TIMEOUT
);
wasm/tests/transcode.test.js
→
wasm/tests/transcode
-webm
.test.js
View file @
5dc21ead
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
{
TIMEOUT
}
=
require
(
'./config'
);
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
aviFilePath
=
path
.
join
(
__dirname
,
'data'
,
'video-3s.avi'
);
const
TIMEOUT
=
120000
;
const
MP4_SIZE
=
98326
;
const
WEBM_SIZE
=
114591
;
const
aviFilePath
=
path
.
join
(
__dirname
,
'data'
,
'video-1s.avi'
);
const
WEBM_SIZE
=
41878
;
let
aviData
=
null
;
beforeAll
(
async
()
=>
{
aviData
=
Uint8Array
.
from
(
fs
.
readFileSync
(
aviFilePath
));
});
test
(
'transcode avi to x264 mp4'
,
async
()
=>
{
const
Core
=
await
runFFmpeg
(
'video.avi'
,
aviData
,
[
'-i'
,
'video.avi'
,
'video.mp4'
]);
const
fileSize
=
Core
.
FS
.
readFile
(
'video.mp4'
).
length
;
Core
.
FS
.
unlink
(
'video.mp4'
);
expect
(
fileSize
).
toBe
(
MP4_SIZE
);
},
TIMEOUT
);
test
(
'transcode avi to x264 mp4 twice'
,
async
()
=>
{
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
const
Core
=
await
runFFmpeg
(
'video.avi'
,
aviData
,
[
'-i'
,
'video.avi'
,
'video.mp4'
]);
const
fileSize
=
Core
.
FS
.
readFile
(
'video.mp4'
).
length
;
Core
.
FS
.
unlink
(
'video.mp4'
);
expect
(
fileSize
).
toBe
(
MP4_SIZE
);
}
},
TIMEOUT
);
test
(
'transcode avi to webm'
,
async
()
=>
{
const
Core
=
await
runFFmpeg
(
'video.avi'
,
aviData
,
[
'-i'
,
'video.avi'
,
'-row-mt'
,
'1'
,
'video.webm'
]);
const
fileSize
=
Core
.
FS
.
readFile
(
'video.webm'
).
length
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment