ilhamdev commited on
Commit
f54af35
·
verified ·
1 Parent(s): b003589

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +0 -33
index.js CHANGED
@@ -195,39 +195,6 @@ async function fby2mate(url) {
195
  return e;
196
  }
197
  }
198
- async function mergeVideoAndAudio(videoBuffer, audioBuffer) {
199
- return new Promise((resolve, reject) => {
200
- const videoStream = new Readable();
201
- videoStream.push(videoBuffer);
202
- videoStream.push(null);
203
-
204
- const audioStream = new Readable();
205
- audioStream.push(audioBuffer);
206
- audioStream.push(null);
207
-
208
- const outputBuffer = [];
209
- const outputStream = new Writable({
210
- write(chunk, encoding, callback) {
211
- outputBuffer.push(chunk);
212
- callback();
213
- }
214
- });
215
-
216
- ffmpeg()
217
- .input(videoStream)
218
- .input(audioStream)
219
- .outputFormat('mp4')
220
- .on('end', () => {
221
- console.log('Merging finished!');
222
- resolve(Buffer.concat(outputBuffer));
223
- })
224
- .on('error', (err) => {
225
- console.error('Error during merging:', err);
226
- reject(err);
227
- })
228
- .pipe(outputStream);
229
- });
230
- }
231
  async function convertMp4ToAudio(inputBuffer) {
232
  return new Promise((resolve, reject) => {
233
  const inputStream = new Readable();
 
195
  return e;
196
  }
197
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  async function convertMp4ToAudio(inputBuffer) {
199
  return new Promise((resolve, reject) => {
200
  const inputStream = new Readable();