Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
ParaEncode
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
ParaEncode
Commits
e476a00e
Commit
e476a00e
authored
May 17, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add framerate parameter to muxer.
parent
8b1268bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
encWW.js
resources/workers/encWW.js
+0
-2
muxWW.js
resources/workers/muxWW.js
+6
-1
encGroup.js
src/encGroup.js
+3
-3
muxer.c
src/wasms/muxer.c
+2
-1
No files found.
resources/workers/encWW.js
View file @
e476a00e
...
@@ -100,8 +100,6 @@ async function init(msg) {
...
@@ -100,8 +100,6 @@ async function init(msg) {
height_
=
info
.
height
;
height_
=
info
.
height
;
frameRate_
=
info
.
fps
;
frameRate_
=
info
.
fps
;
RGBFrameSize
=
width_
*
height_
*
4
;
RGBFrameSize
=
width_
*
height_
*
4
;
console
.
log
(
width_
,
height_
,
frameRate_
);
}
}
// Wait encoder init
// Wait encoder init
...
...
resources/workers/muxWW.js
View file @
e476a00e
// Muxer Parameters
let
fps
=
30
;
// Status
// Status
let
ident
=
undefined
;
let
ident
=
undefined
;
let
isInited
=
false
;
let
isInited
=
false
;
...
@@ -74,9 +77,11 @@ async function init(msg) {
...
@@ -74,9 +77,11 @@ async function init(msg) {
MUX_BUFFER_SIZE
=
info
.
wasmBufSize
;
MUX_BUFFER_SIZE
=
info
.
wasmBufSize
;
if
(
'numOfEncs'
in
info
)
if
(
'numOfEncs'
in
info
)
numOfEncs
=
info
.
numOfEncs
;
numOfEncs
=
info
.
numOfEncs
;
if
(
'fps'
in
info
)
fps
=
info
.
fps
;
/* Init Muxer */
/* Init Muxer */
muxer
.
_muxInit
(
numOfEncs
);
muxer
.
_muxInit
(
numOfEncs
,
fps
);
eof
=
[...
Array
(
numOfEncs
).
keys
()].
map
(()
=>
false
);
eof
=
[...
Array
(
numOfEncs
).
keys
()].
map
(()
=>
false
);
postMessage
(
makeMsg
(
MESSAGE_TYPE
.
INIT
,
{}));
postMessage
(
makeMsg
(
MESSAGE_TYPE
.
INIT
,
{}));
...
...
src/encGroup.js
View file @
e476a00e
...
@@ -119,7 +119,7 @@ export class H264EncWWGroup extends WWGroup {
...
@@ -119,7 +119,7 @@ export class H264EncWWGroup extends WWGroup {
await
this
.
#
muxWorker
.
start
(
async
ww
=>
{
await
this
.
#
muxWorker
.
start
(
async
ww
=>
{
return
await
initStrategies
(
muxInit
,
INIT_FLAGS
.
NONE
,
ww
,
return
await
initStrategies
(
muxInit
,
INIT_FLAGS
.
NONE
,
ww
,
// muxInit parameters
// muxInit parameters
this
.
#
numOfEncWorker
,
Math
.
pow
(
2
,
22
),
ww
)
this
.
#
numOfEncWorker
,
Math
.
pow
(
2
,
22
),
ww
,
this
.
#
fps
)
});
});
for
(
let
i
=
0
;
i
<
this
.
#
numOfEncWorker
;
++
i
)
{
for
(
let
i
=
0
;
i
<
this
.
#
numOfEncWorker
;
++
i
)
{
...
@@ -311,9 +311,9 @@ async function encInit(chnls, size, ww, blockSize, width, height, fps) {
...
@@ -311,9 +311,9 @@ async function encInit(chnls, size, ww, blockSize, width, height, fps) {
return
true
;
return
true
;
}
}
async
function
muxInit
(
numOfEncs
,
size
,
ww
)
{
async
function
muxInit
(
numOfEncs
,
size
,
ww
,
fps_
)
{
ww
.
postMessage
(
ww
.
postMessage
(
makeMsg
(
MESSAGE_TYPE
.
INIT
,
{
wasmBufSize
:
size
,
numOfEncs
:
numOfEncs
}));
makeMsg
(
MESSAGE_TYPE
.
INIT
,
{
wasmBufSize
:
size
,
numOfEncs
:
numOfEncs
,
fps
:
fps_
}));
}
}
async
function
encMuxBridge
(
bridge
,
size
,
enc
,
mux
)
{
async
function
encMuxBridge
(
bridge
,
size
,
enc
,
mux
)
{
...
...
src/wasms/muxer.c
View file @
e476a00e
...
@@ -52,8 +52,9 @@ void ctxNodeDestr(void *v) {
...
@@ -52,8 +52,9 @@ void ctxNodeDestr(void *v) {
}
}
EM_PORT_API
(
int
)
muxInit
(
int
numOfStreams_
)
{
EM_PORT_API
(
int
)
muxInit
(
int
numOfStreams_
,
int
framerate_
)
{
framerate
=
framerate_
;
tb
=
av_make_q
(
1
,
timescale
);
tb
=
av_make_q
(
1
,
timescale
);
duration
=
timescale
/
framerate
;
duration
=
timescale
/
framerate
;
...
...
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