Commit bb0f1fe9 authored by NzSN's avatar NzSN

update

parent a5adc0f9
#!/bin/bash
bash build-with-docker.sh "EXTERNAL"
......@@ -21,7 +21,7 @@ let encBuf = null;
self.importScripts('defs.js');
// Load wasm encoder
self.importScripts('mp4encoder.js');
self.importScripts('paraencoder.js');
createParaEncoder().then(m => {
encoder = m;
});
......
......@@ -18,7 +18,7 @@ let muxBuffer = null;
self.importScripts('defs.js');
// Load wasm encoder
self.importScripts('./mp4encoder.js');
self.importScripts('./paraencoder.js');
createParaEncoder().then(m => {
muxer = m;
});
......
......@@ -40,6 +40,8 @@ EM_PORT_API(int) getPackets(uint8_t *buffer, uint32_t size, uint32_t *osize);
EM_PORT_API(uint8_t) encodeInit(int width, int height, int fps) {
int ret = 0;
width_ = width;
height_ = height;
framerate_ = fps;
......@@ -62,8 +64,9 @@ EM_PORT_API(uint8_t) encodeInit(int width, int height, int fps) {
cc->time_base = (AVRational){1, timescale};
cc->gop_size = 0;
if (avcodec_open2(cc, encoder, NULL) < 0) {
fprintf(stderr, "Unable to open codec context\n");
if ((ret = avcodec_open2(cc, encoder, NULL) < 0)) {
fprintf(stderr, "Unable to open codec context: %s\n",
av_err2str(ret));
return 3;
}
......@@ -76,7 +79,8 @@ EM_PORT_API(uint8_t) encodeInit(int width, int height, int fps) {
frame->format = cc->pix_fmt;
frame->width = cc->width;
frame->height = cc->height;
int ret = av_frame_get_buffer(frame, 0);
ret = av_frame_get_buffer(frame, 0);
if (ret < 0) {
fprintf(stderr, "Could not allocate the video frame data\n");
return 4;
......@@ -210,6 +214,7 @@ EM_PORT_API(int) getPackets(uint8_t *buffer, uint32_t size, uint32_t *osize) {
}
DONE:
*osize = size - remainSize;
return ret;
......
......@@ -25,6 +25,8 @@ DEBUG="-O3"
BUILD_DIR=${WORKPATH}/Build
if [ "$3" ]; then
if [ ! -d "${BUILD_DIR}" ]; then
mkdir ${BUILD_DIR}
fi
......@@ -55,6 +57,7 @@ emmake make install
chown -R "$1:$2" ${BUILD_DIR}
chown -R "$1:$2" ${LIB_DIR}/ffmpeg.protos/build
fi
###############################################################################
# FFMPEG Core #
......@@ -78,8 +81,9 @@ fi
FLAGS=(
-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
-lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lz -lshmproto
-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 -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -lfreetype -lopus -lwebp
-lshmproto
$WASM_DIR/interfaces.cc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment