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
8c4cf7f6
Commit
8c4cf7f6
authored
Nov 01, 2020
by
Jerome Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor wasm/tests
parent
2811f758
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
21 deletions
+20
-21
fdk-aac.test.js
wasm/tests/fdk-aac.test.js
+2
-2
lame.test.js
wasm/tests/lame.test.js
+2
-2
libvpx.test.js
wasm/tests/libvpx.test.js
+4
-4
theora.test.js
wasm/tests/theora.test.js
+2
-2
vorbis.test.js
wasm/tests/vorbis.test.js
+2
-2
wv.test.js
wasm/tests/wv.test.js
+2
-2
x264.test.js
wasm/tests/x264.test.js
+2
-2
x265.test.js
wasm/tests/x265.test.js
+4
-5
No files found.
wasm/tests/fdk-aac.test.js
View file @
8c4cf7f6
...
...
@@ -4,7 +4,7 @@ const { TIMEOUT } = require('./config');
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
IN_FILE_NAME
=
'audio-1s.wav'
;
const
OUT_FILE_NAME
=
'audio.aac'
;
const
AAC
_SIZE
=
4239
;
const
FILE
_SIZE
=
4239
;
let
wavData
=
null
;
beforeAll
(()
=>
{
...
...
@@ -14,5 +14,5 @@ beforeAll(() => {
test
(
'convert wav to aac'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
'-c:a'
,
'libfdk_aac'
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
wavData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
).
toBe
(
AAC
_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_SIZE
);
},
TIMEOUT
);
wasm/tests/lame.test.js
View file @
8c4cf7f6
...
...
@@ -4,7 +4,7 @@ const { TIMEOUT } = require('./config');
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
IN_FILE_NAME
=
'audio-1s.wav'
;
const
OUT_FILE_NAME
=
'audio.mp3'
;
const
MP3
_SIZE
=
4039
;
const
FILE
_SIZE
=
4039
;
let
wavData
=
null
;
beforeAll
(()
=>
{
...
...
@@ -14,5 +14,5 @@ beforeAll(() => {
test
(
'convert wav to mp3'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
wavData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
).
toBe
(
MP3
_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_SIZE
);
},
TIMEOUT
);
wasm/tests/libvpx.test.js
View file @
8c4cf7f6
...
...
@@ -5,8 +5,8 @@ const { runFFmpeg } = require('./utils');
const
aviFilePath
=
path
.
join
(
__dirname
,
'data'
,
'video-1s.avi'
);
const
IN_FILE_NAME
=
'video-1s.avi'
;
const
OUT_FILE_NAME
=
'video.webm'
;
const
WEBM
_SIZE
=
41904
;
const
WEBM_SIZE_MT
=
41878
;
const
FILE
_SIZE
=
41904
;
const
FILE_MT_SIZE
=
41878
;
let
aviData
=
null
;
let
BASELINE_TIME
=
0
;
...
...
@@ -19,7 +19,7 @@ test('transcode avi to vp9 webm', async () => {
const
start
=
Date
.
now
();
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
aviData
,
args
,
OUT_FILE_NAME
);
BASELINE_TIME
=
Date
.
now
()
-
start
;
expect
(
fileSize
).
toBe
(
WEBM
_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_SIZE
);
},
TIMEOUT
);
test
(
'transcode avi to vp9 webm with multithread'
,
async
()
=>
{
...
...
@@ -27,6 +27,6 @@ test('transcode avi to vp9 webm with multithread', async () => {
const
start
=
Date
.
now
();
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
aviData
,
args
,
OUT_FILE_NAME
);
const
timediff
=
Date
.
now
()
-
start
;
expect
(
fileSize
).
toBe
(
WEBM_SIZE_MT
);
expect
(
fileSize
).
toBe
(
FILE_MT_SIZE
);
expect
(
timediff
<
BASELINE_TIME
).
toBe
(
true
);
},
TIMEOUT
);
wasm/tests/theora.test.js
View file @
8c4cf7f6
...
...
@@ -4,7 +4,7 @@ const { TIMEOUT } = require('./config');
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
IN_FILE_NAME
=
'video-1s.avi'
;
const
OUT_FILE_NAME
=
'video.ogv'
;
const
OGV
_SIZE
=
29561
;
const
FILE
_SIZE
=
29561
;
let
aviData
=
null
;
beforeAll
(()
=>
{
...
...
@@ -14,5 +14,5 @@ beforeAll(() => {
test
(
'convert avi to ogv'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
'-c:v'
,
'libtheora'
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
aviData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
).
toBe
(
OGV
_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_SIZE
);
},
TIMEOUT
);
wasm/tests/vorbis.test.js
View file @
8c4cf7f6
...
...
@@ -4,7 +4,7 @@ const { TIMEOUT } = require('./config');
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
IN_FILE_NAME
=
'audio-1s.wav'
;
const
OUT_FILE_NAME
=
'audio.ogg'
;
const
OGG
_SIZE
=
7712
;
const
FILE
_SIZE
=
7712
;
let
wavData
=
null
;
beforeAll
(()
=>
{
...
...
@@ -14,5 +14,5 @@ beforeAll(() => {
test
(
'convert wav to aac'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
'-c:a'
,
'libvorbis'
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
wavData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
).
toBe
(
OGG
_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_SIZE
);
},
TIMEOUT
);
wasm/tests/wv.test.js
View file @
8c4cf7f6
...
...
@@ -4,7 +4,7 @@ const { TIMEOUT } = require('./config');
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
IN_FILE_NAME
=
'audio-1s.wav'
;
const
OUT_FILE_NAME
=
'audio.wv'
;
const
WV
_SIZE
=
23502
;
const
FILE
_SIZE
=
23502
;
let
wavData
=
null
;
beforeAll
(()
=>
{
...
...
@@ -14,5 +14,5 @@ beforeAll(() => {
test
(
'convert wav to wv'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
wavData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
).
toBe
(
WV
_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_SIZE
);
},
TIMEOUT
);
wasm/tests/x264.test.js
View file @
8c4cf7f6
...
...
@@ -4,7 +4,7 @@ const { TIMEOUT } = require('./config');
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
IN_FILE_NAME
=
'video-1s.avi'
;
const
OUT_FILE_NAME
=
'video.mp4'
;
const
MP4
_SIZE
=
38372
;
const
FILE
_SIZE
=
38372
;
let
aviData
=
null
;
beforeAll
(()
=>
{
...
...
@@ -14,5 +14,5 @@ beforeAll(() => {
test
(
'transcode avi to x264 mp4'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
aviData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
).
toBe
(
MP4
_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_SIZE
);
},
TIMEOUT
);
wasm/tests/x265.test.js
View file @
8c4cf7f6
...
...
@@ -4,9 +4,8 @@ const { TIMEOUT } = require('./config');
const
{
runFFmpeg
}
=
require
(
'./utils'
);
const
IN_FILE_NAME
=
'video-1s.avi'
;
const
OUT_FILE_NAME
=
'video.mp4'
;
const
MP4_10BIT_SIZE1
=
22507
;
const
MP4_10BIT_SIZE2
=
22520
;
const
MP4_12BIT_SIZE
=
22718
;
const
FILE_10BIT_SIZES
=
[
22507
,
22520
];
const
FILE_12BIT_SIZE
=
22718
;
let
aviData
=
null
;
beforeAll
(()
=>
{
...
...
@@ -16,11 +15,11 @@ beforeAll(() => {
test
(
'transcode avi to x265 10bit mp4'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
'-c:v'
,
'libx265'
,
'-pix_fmt'
,
'yuv420p10le'
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
aviData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
===
MP4_10BIT_SIZE1
||
fileSize
===
MP4_10BIT_SIZE2
).
toBe
(
true
);
expect
(
FILE_10BIT_SIZES
.
includes
(
fileSize
)
).
toBe
(
true
);
},
TIMEOUT
);
test
(
'transcode avi to x265 12bit mp4'
,
async
()
=>
{
const
args
=
[
'-i'
,
IN_FILE_NAME
,
'-c:v'
,
'libx265'
,
'-pix_fmt'
,
'yuv420p12le'
,
OUT_FILE_NAME
];
const
{
fileSize
}
=
await
runFFmpeg
(
IN_FILE_NAME
,
aviData
,
args
,
OUT_FILE_NAME
);
expect
(
fileSize
).
toBe
(
MP4
_12BIT_SIZE
);
expect
(
fileSize
).
toBe
(
FILE
_12BIT_SIZE
);
},
TIMEOUT
);
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