Comments (6)
Great.
FFmpeg has deprecated yuvj422p format apparently - you will probably be seeing a warning about this. In my example I have used the yuv422p format and used a colorspace filter to set the jpeg output range.
from beamcoder.
SigSev issue is too deep inside FFmpeg to defend against. Ideally the MJPEG encoder could be at little nicer.
Closing as main issue is resolved.
from beamcoder.
I think the issue is that the mjpeg
encoder only accepts the following planar pixel formats:
[ 'yuvj420p', 'yuvj422p', 'yuvj444p' ]
You can see this with the following:
beamcoder.encoders()['mjpeg'].pix_fmts
You would need to convert the interleaved data from macadam into the planar form (data[0] for Y, data[1] for U and data[2] for V) before encoding.
However, I wish you had not got a segfault ... I'll see if I can turn this into a more friendly error before closing this issue.
from beamcoder.
I have added an example app that has a filtering implementation that with small modifications should help you avoid this problem. Take a look at examples/jpeg_filter_app.js.
from beamcoder.
Something like the following just before calling encode:
let filt = await beamcoder.filterer({
filterType: 'video',
inputParams: [{
width: f.video.width,
height: f.video.height,
pixelFormat: 'uyvy422',
timeBase: [ 1, 25 ],
pixelAspect: [ 1, 1 ] }],
outputParams: [{ pixelFormat: 'yuv422p' }],
filterSpec: 'scale=640:360, colorspace=range=jpeg:all=bt709' })
let filtResult = await filt.filter([{ frames: [ f ] }]);
let filtFrame = filtResult[0].frames[0]
let jpg = await enc.encode(filtFrame)
...
I haven't tested this as I don't have any BMD hardware at the moment - but I hope it helps!
from beamcoder.
Yup, that's pretty much what I did:
filterer = await beamcoder.filterer({
filterType: 'video',
inputParams: [
{
width: 1280,
height: 720,
pixelFormat: 'uyvy422',
pixelAspect: [1, 1],
timeBase: [1, 1]
}
],
outputParams: [
{
pixelFormat: 'yuvj422p'
}
],
filterSpec: 'format=pix_fmts=yuvj422p'
})
let filtFrames = await filterer.filter([{ frames: { frames: [ frame ] } }])
let jpg = await enc.encode(filtFrames[0].frames[0])
from beamcoder.
Related Issues (20)
- Decoder hwaccel flag is too simplified
- Ubuntu 20.04 npm install fails, can't find PPA HOT 3
- Installation instructions HOT 3
- Permission to fork and create a LGPL variant of your project HOT 1
- Encoder message error catching HOT 1
- Releasing beamcoder-stream Nodejs Stream API HOT 1
- Why is the project abandoned? HOT 2
- Is there a way to get AAC data out of audio as ADTS?
- Is there a limit on number of demuxers? HOT 1
- Hardware Encoding Example Needed
- Please create encode_aac.js example to show how to create AAC frames from raw PCM data. HOT 3
- Will support arm64? HOT 1
- Memory leak on Windows 10/Ubuntu 20.04 LTS - x64
- Error splitting the input into NAL units. HOT 2
- How to use av_rescale_q_rnd/av_rescale_q in beamcoder ?
- Using pkg-config or similar for link dependencies
- Memory error: double free or corruption at format.cc HOT 1
- failed to install version v0.7.1 HOT 1
- A Typescript port ready for testing.
- Hardware accelerated filters are not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beamcoder.