I assume it's happening because it doesn't drain the rest of the audio buffer before stopping. The have documentation on their site about getting this to work. So a video worth 10 seconds of data just has 5 seconds of audio and from second 5 - 10 there's just silence. Want to build the ffmpeg.js file for yourself First, make sure you have Emscripten set up: git clone :kripken/emscripten.git Depending on your system may need to also get the SDK to make sure Emscripten will work. You probably know it can run from the terminal, but did you know it can also be invoked from an application in Node. Let me remind you that the code may be found in the GitHub repository here. FFmpeg is a versatile open-source tool for encoding video files and performing basic editing operations such as stitching, cropping, and resizing. I hope that this small project proves that it is not as difficult as it may look. FFmpeg has a lot of filters that may be combined together and create a complex structure. It indeed stops encoding but it's happening too fast. FFmpeg is a robust solution for video processing and you can integrate it with the JS stack. Finish encoding when the shortest output stream ends. To ultimately stop FFmpeg from encoding the video, it does not stop - I guess because it's still grabbing audio data from the directshow device.Īfter digging through the FFmpeg manual I've found the -shortest output options which should: The problem is, if I later stop sending images down the pipe inputStream.end() "-f", "image2pipe", "-r", "24", "-fflags", "nobuffer", fluent-ffmpeg wrapper for ffmpeg command ffmpeg-installer/ffmpeg ffmpeg binary ffprobe-installer/ffprobe ffprobe binary Example ffmpeg.js file. Let inputStream = new stream.PassThrough() Additionally it records audio from a directshow device. Via node.js I'm spawning a FFmpeg process which generates a video using jpeg images received from a node.js stream.
0 Comments
Leave a Reply. |