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
0413c382
Commit
0413c382
authored
Apr 30, 2022
by
NzSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f2d27d70
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
12 deletions
+63
-12
.gitmodules
.gitmodules
+3
-0
build-with-docker.sh
build-with-docker.sh
+17
-0
ffmpeg.protos
lib/ffmpeg.protos
+1
-1
ffmpeg.wasm-core
lib/ffmpeg.wasm-core
+1
-0
encWW.js
resources/workers/encWW.js
+1
-1
muxWW.js
resources/workers/muxWW.js
+1
-1
interfaces.cc
src/wasms/interfaces.cc
+2
-2
wasm-build.sh
wasm-build.sh
+37
-7
No files found.
.gitmodules
View file @
0413c382
[submodule "lib/ffmpeg.protos"]
[submodule "lib/ffmpeg.protos"]
path = lib/ffmpeg.protos
path = lib/ffmpeg.protos
url = git@gitlab.ilaihua.com:linshizhi/ffmpeg.sharedmemoryproto.git
url = git@gitlab.ilaihua.com:linshizhi/ffmpeg.sharedmemoryproto.git
[submodule "lib/ffmpeg.wasm-core"]
path = lib/ffmpeg.wasm-core
url = git@gitlab.ilaihua.com:linshizhi/ffmpeg.wasm-core.git
build-with-docker.sh
0 → 100755
View file @
0413c382
#!/bin/bash
set
-euo
pipefail
EM_VERSION
=
2.0.24
if
[[
"
$(
docker images
-q
emscripten/emsdk:2.0.24 2> /dev/null
)
"
==
""
]]
;
then
docker pull emscripten/emsdk:
$EM_VERSION
fi
docker run
\
--rm
\
-v
$PWD
:/src
\
-v
/etc/passwd:/etc/passwd:ro
\
-v
/etc/group:/etc/group:ro
\
emscripten/emsdk:
$EM_VERSION
\
bash ./wasm-build.sh
"
$(
id
-u
)
$(
id
-g
)
$@
"
ffmpeg.protos
@
851d6559
Subproject commit
50376482d7c9b580263ad9a2266de34d07b95a2f
Subproject commit
851d655949f1b42fe4e47785516117a0aa86e96d
ffmpeg.wasm-core
@
f5fb3d57
Subproject commit f5fb3d572a09f34731f164378ef43e92b1aee832
resources/workers/encWW.js
View file @
0413c382
...
@@ -22,7 +22,7 @@ self.importScripts('defs.js');
...
@@ -22,7 +22,7 @@ self.importScripts('defs.js');
// Load wasm encoder
// Load wasm encoder
self
.
importScripts
(
'mp4encoder.js'
);
self
.
importScripts
(
'mp4encoder.js'
);
create
MP4
Encoder
().
then
(
m
=>
{
create
Para
Encoder
().
then
(
m
=>
{
encoder
=
m
;
encoder
=
m
;
});
});
...
...
resources/workers/muxWW.js
View file @
0413c382
...
@@ -19,7 +19,7 @@ self.importScripts('defs.js');
...
@@ -19,7 +19,7 @@ self.importScripts('defs.js');
// Load wasm encoder
// Load wasm encoder
self
.
importScripts
(
'./mp4encoder.js'
);
self
.
importScripts
(
'./mp4encoder.js'
);
create
MP4
Encoder
().
then
(
m
=>
{
create
Para
Encoder
().
then
(
m
=>
{
muxer
=
m
;
muxer
=
m
;
});
});
...
...
src/wasms/interfaces.cc
View file @
0413c382
...
@@ -219,8 +219,8 @@ EM_PORT_API(int) getPackets(uint8_t *buffer, uint32_t size, uint32_t *osize) {
...
@@ -219,8 +219,8 @@ EM_PORT_API(int) getPackets(uint8_t *buffer, uint32_t size, uint32_t *osize) {
// Muxing Parts //
// Muxing Parts //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#include "
../protos/src/
ioctx.h"
#include "ioctx.h"
#include "
../protos/src/
proto/movMemProto.h"
#include "proto/movMemProto.h"
#include <vector>
#include <vector>
#include <queue>
#include <queue>
#include <memory>
#include <memory>
...
...
wasm-build.sh
View file @
0413c382
...
@@ -8,7 +8,7 @@ DEMO_PATH=$WORKPATH
...
@@ -8,7 +8,7 @@ DEMO_PATH=$WORKPATH
echo
"WORKPATH"
=
$WORKPATH
echo
"WORKPATH"
=
$WORKPATH
rm
-rf
${
DEMO_PATH
}
/
mp4encoder.js
${
DEMO_PATH
}
/mp4
encoder.wasm
rm
-rf
${
DEMO_PATH
}
/
resources/workers/paraencoder.js
${
DEMO_PATH
}
/resources/workers/para
encoder.wasm
FFMPEG_ST
=
yes
FFMPEG_ST
=
yes
...
@@ -23,10 +23,38 @@ WASM_DIR=${WORKPATH}/src/wasms
...
@@ -23,10 +23,38 @@ WASM_DIR=${WORKPATH}/src/wasms
DEBUG
=
"-O3"
DEBUG
=
"-O3"
#DEBUG="-O1 -g -fno-inline -gseparate-dwarf=/src/demo2/temp.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:5000/temp.debug.wasm"
#DEBUG="-O1 -g -fno-inline -gseparate-dwarf=/src/demo2/temp.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:5000/temp.debug.wasm"
BUILD_DIR
=
${
WORKPATH
}
/Build
if
[
!
-d
"
${
BUILD_DIR
}
"
]
;
then
mkdir
${
BUILD_DIR
}
fi
if
[
!
-d
"
${
BUILD_DIR
}
/include"
]
;
then
mkdir
${
BUILD_DIR
}
/include
fi
if
[
!
-d
"
${
BUILD_DIR
}
/lib"
]
;
then
mkdir
${
BUILD_DIR
}
/lib
fi
# Build ffmpeg.wasm-core
cd
${
LIB_DIR
}
/ffmpeg.wasm-core
bash ./build.sh
cp
lib
*
/
*
.a
${
BUILD_DIR
}
/lib
cp
build/include/
*
${
BUILD_DIR
}
/include
cp
build/lib/
*
${
BUILD_DIR
}
/lib
# Build Protocols
# Build Protocols
cd
${
LIB_DIR
}
/ffmpeg.sharedmemproto
cd
${
LIB_DIR
}
/ffmpeg.protos
mkdir
build
cd
build
emcmake cmake ..
-DCMAKE_INSTALL_PREFIX
=
${
BUILD_DIR
}
-Denable_trmem
=
OFF
-Denable_movmem
=
ON
-DDEBUG
=
OFF
-DIS_EMCC_ENV
=
ON
\
-DCMAKE_CXX_FLAGS
=
-isystem
\
${
LIB_DIR
}
/ffmpeg.wasm-core
emmake make
emmake make
install
chown
-R
$1
:
$2
${
BUILD_DIR
}
chown
-R
$1
:
$2
${
LIB_DIR
}
/ffmpeg.protos/build
###############################################################################
###############################################################################
# FFMPEG Core #
# FFMPEG Core #
...
@@ -40,19 +68,18 @@ if [[ "$FFMPEG_ST" != "yes" ]]; then
...
@@ -40,19 +68,18 @@ if [[ "$FFMPEG_ST" != "yes" ]]; then
-pthread
-pthread
-s
USE_PTHREADS
=
1
# enable pthreads support
-s
USE_PTHREADS
=
1
# enable pthreads support
-s
PROXY_TO_PTHREAD
=
1
# detach main() from browser/UI main thread
-s
PROXY_TO_PTHREAD
=
1
# detach main() from browser/UI main thread
-o
${
DEMO_PATH
}
/resources/workers/
mp4
encoder.js
-o
${
DEMO_PATH
}
/resources/workers/
para
encoder.js
)
)
else
else
EXTRA_FLAGS
=(
EXTRA_FLAGS
=(
-o
${
DEMO_PATH
}
/resources/workers/
mp4
encoder.js
-o
${
DEMO_PATH
}
/resources/workers/
para
encoder.js
)
)
fi
fi
FLAGS
=(
FLAGS
=(
-I
$
WORKPATH
/lib/ffmpeg-emcc/include
-L
$WORKPATH
/lib/ffmpeg-emcc/lib
-I
$THIRD_DIR
/include
-L
$THIRD_DIR
/lib
-Wno-deprecated-declarations
-I
$
BUILD_DIR
/include
-L
$BUILD_DIR
/lib
-I
$LIB_DIR
/ffmpeg.wasm-core
-Wno-deprecated-declarations
-Wno-pointer-sign
-Wno-implicit-int-float-conversion
-Wno-switch
-Wno-parentheses
-Qunused-arguments
-lavdevice
-lavfilter
-lavformat
-lavcodec
-Wno-pointer-sign
-Wno-implicit-int-float-conversion
-Wno-switch
-Wno-parentheses
-Qunused-arguments
-lavdevice
-lavfilter
-lavformat
-lavcodec
-lswresample
-lswscale
-lavutil
-lpostproc
-lm
-lharfbuzz
-lfribidi
-lass
-lx264
-lx265
-lvpx
-lwavpack
-lmp3lame
-lswresample
-lswscale
-lavutil
-lpostproc
-lm
-lx264
-lz
-lshmproto
-lfdk-aac
-lvorbis
-lvorbisenc
-lvorbisfile
-logg
-ltheora
-ltheoraenc
-ltheoradec
-lz
-lfreetype
-lopus
-lwebp
$WASM_DIR
/interfaces.cc
$WASM_DIR
/interfaces.cc
...
@@ -77,3 +104,6 @@ FLAGS=(
...
@@ -77,3 +104,6 @@ FLAGS=(
)
)
emcc
"
${
FLAGS
[@]
}
"
emcc
"
${
FLAGS
[@]
}
"
chown
$1
:
$2
${
DEMO_PATH
}
/resources/workers/paraencoder.js
chown
$1
:
$2
${
DEMO_PATH
}
/resources/workers/paraencoder.wasm
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