New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write mp4 to stream #366
Comments
I think the problem is in the way browsers do requests. |
I think the problem of the server part ist solved by this gist: but what is a bit strange to me: code from the docsfmpeg(__dirname +'/player/movie.mp4')
.videoCodec('libx264')
.audioCodec('libmp3lame')
.size('320x240')
.on('error', function(err,stdout,stderr) {
console.log('an error happened: ' + err.message);
console.log('ffmpeg stdout: ' + stdout);
console.log('ffmpeg stderr: ' + stderr);
})
.on('end', function() {
console.log('Processing finished !');
})
.on('progress', function(progress) {
console.log('Processing: ' + progress.percent + '% done');
})
.pipe(outStream, { end: true }); produces:
if i add a format:fmpeg(__dirname +'/player/movie.mp4')
.videoCodec('libx264')
.audioCodec('libmp3lame')
.size('320x240')
.format('mp4')
.on('error', function(err,stdout,stderr) {
console.log('an error happened: ' + err.message);
console.log('ffmpeg stdout: ' + stdout);
console.log('ffmpeg stderr: ' + stderr);
})
.on('end', function() {
console.log('Processing finished !');
})
.on('progress', function(progress) {
console.log('Processing: ' + progress.percent + '% done');
})
.pipe(outStream, { end: true }); produces:
|
Yeah, unfortunately that example is flawed. As you pointed out a format specification is missing. But you may not use mp4 when outputting to a stream, as mp4 requires a seekable output (it needs to go back after having written the video file to write the file header). |
Oh yeah that was obvious! |
Can I ask real quick if I understand this right; Streaming as mp4 is impossible because it needs to set file / stream headers (I assume something like the length of the video) before the stream starts? If so, is there any way to generate a stream that can be read by the native |
I have a strange isssue when converting a file to an mp4 stream and sending it out via express.
The following code works with vlc but if I try to add it to a
<video>
element in a browser the encoding starts but after a few seconds the browser closes the stream.Idon*t now if these is an issue of fluent-ffmeg or express but thanks for any hints
This is the output:
This is the code
The text was updated successfully, but these errors were encountered: