Skip to content

Commit 0064602

Browse files
committed
feat: change pushLive to upStreaming
1 parent 381aa14 commit 0064602

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

examples/live.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const createFFTask = () => {
2929
log: true,
3030
preset: 'veryfast',
3131
vprofile: 'baseline',
32-
pushLive: true,
32+
upStreaming: true,
3333
audio,
3434
});
3535

lib/conf/conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Conf {
2828
this.copyByDefaultVal(conf, 'vprofile', 'main');
2929
this.copyByDefaultVal(conf, 'debug', false);
3030
this.copyByDefaultVal(conf, 'audioLoop', true);
31-
this.copyByDefaultVal(conf, 'pushLive', false);
31+
this.copyByDefaultVal(conf, 'upStreaming', false);
3232
this.copyByDefaultVal(conf, 'cacheFormat', 'mp4');
3333
this.copyByDefaultVal(conf, 'hasTransition', false);
3434
this.copyByDefaultVal(conf, 'defaultOutputOptions', true);

lib/core/renderer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class Renderer extends FFBase {
3535
start() {
3636
const { creator } = this;
3737
const log = creator.getConf('log');
38-
const pushLive = creator.getConf('pushLive');
38+
const upStreaming = creator.getConf('upStreaming');
3939

4040
Perf.setEnabled(log);
4141
Perf.start();
4242

4343
const { scenes } = creator;
44-
if (ScenesUtil.isSingle(creator) || pushLive) {
44+
if (ScenesUtil.isSingle(creator) || upStreaming) {
4545
const scene = scenes[0];
4646
scene.addAudio();
4747
this.singleStart(scene);

lib/core/synthesis.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class Synthesis extends FFBase {
4040
*/
4141
start() {
4242
const { creator, conf } = this;
43-
const pushLive = conf.getVal('pushLive');
43+
const upStreaming = conf.getVal('upStreaming');
4444

45-
if (pushLive) {
45+
if (upStreaming) {
4646
this.liveOutput();
4747
} else if (ScenesUtil.isSingle(creator)) {
4848
this.mvOutput();

lib/creator.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ class FFCreator extends FFCon {
169169
* @public
170170
*/
171171
generateOutput() {
172-
const pushLive = this.getConf('pushLive');
172+
const upStreaming = this.getConf('upStreaming');
173173
let outputDir = this.getConf('outputDir');
174174

175-
if (this.inCenter && outputDir && !pushLive) {
175+
if (this.inCenter && outputDir && !upStreaming) {
176176
outputDir = outputDir.replace(/\/$/, '');
177177
const output = `${outputDir}/${Utils.uid()}.mp4`;
178178
this.setConf('output', output);

lib/node/scene.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ class FFScene extends FFCon {
109109
createNewCommand() {
110110
const conf = this.rootConf();
111111
const threads = conf.getVal('threads');
112-
const pushLive = conf.getVal('pushLive');
112+
const upStreaming = conf.getVal('upStreaming');
113113
const command = FFmpegUtil.createCommand({ threads });
114-
if (!pushLive) {
114+
if (!upStreaming) {
115115
command.setDuration(this.duration);
116116
}
117117

@@ -138,9 +138,9 @@ class FFScene extends FFCon {
138138

139139
addCommandOptions(command) {
140140
const conf = this.rootConf();
141-
const pushLive = conf.getVal('pushLive');
141+
const upStreaming = conf.getVal('upStreaming');
142142

143-
if (pushLive) {
143+
if (upStreaming) {
144144
FFmpegUtil.addDefaultOptions({ command, conf, audio: true });
145145
} else {
146146
FFmpegUtil.addDefaultOptions({ command, conf, audio: false });
@@ -157,9 +157,9 @@ class FFScene extends FFCon {
157157
let filepath;
158158
const conf = this.rootConf();
159159
const output = conf.getVal('output');
160-
const pushLive = conf.getVal('pushLive');
160+
const upStreaming = conf.getVal('upStreaming');
161161

162-
if (pushLive) {
162+
if (upStreaming) {
163163
filepath = output;
164164
command.outputOptions(['-f', 'flv']);
165165
} else {

lib/utils/ffmpeg.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const FFmpegUtil = {
7777
const crf = conf.getVal('crf');
7878
const preset = conf.getVal('preset');
7979
const vprofile = conf.getVal('vprofile');
80-
const pushLive = conf.getVal('pushLive');
80+
const upStreaming = conf.getVal('upStreaming');
8181

8282
let outputOptions = []
8383
//---- misc ----
@@ -118,7 +118,7 @@ const FFmpegUtil = {
118118
}
119119

120120
//---- live stream ----
121-
if (!pushLive) {
121+
if (!upStreaming) {
122122
outputOptions = outputOptions.concat(['-map', '0']);
123123
}
124124

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ffcreatorlite",
3-
"version": "2.3.5",
3+
"version": "2.3.6",
44
"description": "FFCreatorLite is a lightweight and flexible short video production library",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)