Hi!
I'm working on providing encoded frames (as H264 bitstream) to WebRTC running within an native (c++) application on windows.
Currently the encoded bitstream comes from NVENC.
Instead of using the OpenH264 encoder:
- filling a webrtc::I420Buffer with h264 bitstream
- find the NAL startcode ("0001"), set offset and length in the fragmentation header
- find the frame type within the NALU type (the bitstream contains IDR, I, P frames)
- signal a finished encode picture
The way this is done looks quite hacky and not very stable, so I was wondering if there was a better way I overlooked.
Whats also missing is getting feedback on the available bitrate etc., in order to adjust the encoding on the fly.
Thus the quality depends on the preconfigured enncoder settings.
As far as i understood the WebRTC library adjusts the (unencoded) input frames resolution in adition to adjusting the encoding bitrate?
By having a way of delievering feedback to the external encoder, this values could be adjusted before encoding.
But going this way would mean to move the NVENC encoder into the WebRTC library?
I would like to just provide the pre-encoded H264 bitstream to the WebRTC library.
Would a comment there make any sense to start a discussion?
Any comments, ideas?
Thanks