fluent-ffmpeg

Unable to convert files with fluent-ffmpeg

不问归期 提交于 2019-12-11 07:18:25
问题 I installed fluent-ffmpeg with npm install fluent-ffmpeg and verified its present in the node-modules. There is no error if I include it in the server var ffmpeg = require('fluent-ffmpeg'); But when I use it to convert a .gif file in the directory to .mp4 it throws an error : Error: Cannot find ffmpeg My code : var express = require('express'); var bodyParser = require('body-parser'); var app = express(); var ffmpeg = require('fluent-ffmpeg'); var proc = new ffmpeg({ source: '/uploads/myfile

How to read any frame while having frame number using ffmpeg av_seek_frame()

China☆狼群 提交于 2019-12-10 20:49:48
问题 int64_t timeBase; timeBase = (int64_t(pavStrm-> time_base.num) * AV_TIME_BASE) / int64_t(pavStrm->time_base.den); int64_t seekTarget = int64_t(iFrameNumber) * timeBase; av_seek_frame(fmt_ctx, -1, seekTarget, AVSEEK_FLAG_FRAME); here I want to read next 5 frame after iFrameNumebr for(int iCnt = 0; iCnt <= 4; iCnt++) { iRet = av_read_frame(fmt_ctx, &pkt); do { ret = decode_packet(&got_frame, 0); if (ret < 0) break; pkt.data += ret; pkt.size -= ret; }while (pkt.size > 0); av_free_packet(&pkt); }

ffmpeg mp3 streaming via node js

偶尔善良 提交于 2019-12-02 14:32:45
问题 var fs = require('fs'); var child = require('child_process'); var http=require('http') var input_file = fs.createReadStream('./remo.mp3'); http.createServer(function (req,res) { var args = ['-ss',120, '-i', 'remo.mp3', '-f','mp3', 'pipe:1' // Output on stdout ]; var trans_proc = child.spawn('ffmpeg', args); res.writeHead(200, { 'Content-Type': 'audio/mpeg' }); trans_proc.stdout.pipe(res) trans_proc.stderr.on('data',function (err) { console.log(err.toString()); }) }).listen(2000) i am trying

How do you use Node.js to stream an MP4 file with ffmpeg?

£可爱£侵袭症+ 提交于 2019-11-30 08:51:36
I've been trying to solve this problem for several days now and would really appreciate any help on the subject. I'm able to successfully stream an mp4 audio file stored on a Node.js server using fluent-ffmpeg by passing the location of the file as a string and transcoding it to mp3. If I create a file stream from the same file and pass that to fluent-ffmpeg instead it works for an mp3 input file, but not a mp4 file. In the case of the mp4 file no error is thrown and it claims the stream completed successfully, but nothing is playing in the browser. I'm guessing this has to do with the meta

Cloud Functions for Firebase: completing long processes without touching maximum timeout

匆匆过客 提交于 2019-11-30 07:00:51
问题 I have to transcode videos from webm to mp4 when they're uploaded to firebase storage. I have a code demo here that works, but if the uploaded video is too large, firebase functions will time out on me before the conversion is finished. I know it's possible to increase the timeout limit for the function, but that seems messy, since I can't ever confirm the process will take less time than the timeout limit. Is there some way to stop firebase from timing out without just increasing the maximum

How do you use Node.js to stream an MP4 file with ffmpeg?

╄→尐↘猪︶ㄣ 提交于 2019-11-29 12:34:53
问题 I've been trying to solve this problem for several days now and would really appreciate any help on the subject. I'm able to successfully stream an mp4 audio file stored on a Node.js server using fluent-ffmpeg by passing the location of the file as a string and transcoding it to mp3. If I create a file stream from the same file and pass that to fluent-ffmpeg instead it works for an mp3 input file, but not a mp4 file. In the case of the mp4 file no error is thrown and it claims the stream

Cloud Functions for Firebase: completing long processes without touching maximum timeout

时光怂恿深爱的人放手 提交于 2019-11-29 00:10:54
I have to transcode videos from webm to mp4 when they're uploaded to firebase storage. I have a code demo here that works , but if the uploaded video is too large, firebase functions will time out on me before the conversion is finished. I know it's possible to increase the timeout limit for the function, but that seems messy, since I can't ever confirm the process will take less time than the timeout limit. Is there some way to stop firebase from timing out without just increasing the maximum timeout limit? If not, is there a way to complete time consuming processes (like video conversion)