Closed piercus closed 2 years ago
@piercus, I see that this issue is not occuring when i are try to create new becmcoder object for each frame like this.
stream.on('data', frame => {
const encoder = beamcoder.encoder({
name: 'mjpeg',
width: frame.width,
height: frame.height,
pix_fmt: 'yuvj420p',
time_base: [1, 1],
});
encoder.encode(frame).then(jpeg => {
const filename = `tmp/frame-${count}.jpeg`;
console.log(`Writing file ${filename}`);
fs.writeFileSync(filename, jpeg.packets[0].data);
count++;
}).catch(error => {
throw new Error(error);
});
});
@dharmik-dalwadi-seaflux can you please open a PR on this branch (do NOT mix the branches) including the fix.
Please write a script in ./scripts
which is using FrameStream + jpg to save all images in the ./tmp
folder and make sure all the images are visible.
I will review this once ready
@piercus I have created the PR can you please review it? https://github.com/alezanai/kvs-parser/pull/15
@dharmik-dalwadi-seaflux i'm experiencing different problems while running node scripts/kvs-to-frames.js
➜ kvs-parser git:(DHA-frame-stream-issue) ✗ node scripts/kvs-to-frames.js
Aerostat Beam Coder Copyright (C) 2019 Streampunk Media Ltd
GPL v3.0 or later license. This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. Conditions and warranty at:
https://github.com/Streampunk/beamcoder/blob/master/LICENSE
Using FFmpeg version 4.3.2-0york0~18.04
Writing file tmp/frame-00000.jpg
Writing file tmp/frame-00001.jpg
Writing file tmp/frame-00002.jpg
Writing file tmp/frame-00003.jpg
Writing file tmp/frame-00004.jpg
Writing file tmp/frame-00005.jpg
...
Writing file tmp/frame-00106.jpg
PID 23885 received SIGSEGV for address: 0x6e086
[1] 23885 segmentation fault (core dumped) node scripts/kvs-to-frames.js
Please pull the code from DHA-frame-stream-issue and then run
ffmpeg -i tmp/frame-%05d.jpg tmp/video.mp4
the result is here
You can see that the video is shaking a lot, i don't know why but this is strange. Please create one sub issue for each of those problem, with actual/expected issue format we will discuss them separately.
In each of the issue, tell me if you are able to reproduce the issue on your side
On branch https://github.com/alezanai/kvs-parser/tree/frame-stream
@dharmik-dalwadi-seaflux please edit this issue to add detailed explanations
Actual
@dharmik-dalwadi-seaflux please explain what is the actual bahavior
Error
Expected
@dharmik-dalwadi-seaflux please explain what is the expected bahavior