Closed jpietek closed 3 years ago
Hi Jan, thanks for the pull request. I have just pushed some changes with a slightly different approach that should allow you to have the encoder use hw frames but in this version you will need to copy the hw_frames_ctx from frame to encoder in your JS code before the first frame is encoded. I hope this meets your needs.
Hi @jpietek , did my changes support what you needed? Can we close the pull request? Thanks.
Yup, having those hw_contexts mapped to nodejs will do the trick. BTW do you have some plans to support -hwaccel flags via beamcoder and filters like cuda_overlay?
Great, I'll go ahead and close the pull request. I'd like to add more hw support when time allows - but I'm not sure when that will be!
The idea behind this change is to allow encoder to use hardware accelerated frames. For ex. a frame can be hwuploaded to cuda and filtered with a scale_npp filter. If the hw_frames context is not passed to the encoder, it currently fails in such scenario.
The avdevices are currently not initialized on beamcoder init. That's why it's impossible to use a v4l2 device as a demuxer input:
let dm = await beamcoder.demuxer({ url: '/dev/video10', iformat: "video4linux2",
This will fail with "invalid input" error. Registering the avdevices on init fixes this issue.