Possible to encode raw RGB frames in a video track? #329
-
Hey, I've got some code that generates raw RGB frames and was wondering whether it's currently possible to encode that into a video stream? Just looking around (#281), I saw that it might be possible to encode it into VP8 first, but haven't tried it yet. Is that the approach you'd recommend? Are there any alternatives aside from encoding it into an intermediate format? (I'm not all that worried about performance either. The frames I want to encode might be small enough that it won't matter anyway) BTW, I've been following this repo for awhile now and it's come a long way. Thanks for all the work you've put into it! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey, fundamentally WebRTC carries encoded media in RTP for media transport. Here your choices are either VP8(libvpx) or h264(various encoders) for best support. There's also VP9 and h265 but I don't believe they are broadly supported. In any case the process is the same:
This crate provides nothing in terms of encoding, but if you can get media in the appropriate format(annex-b bitstream for h.264 or VP8 descriptor wrapped frames for VP8). The play-from-disk-* examples are good starting points for this, but instead of playing from disk you'd use an encoder. |
Beta Was this translation helpful? Give feedback.
Hey,
fundamentally WebRTC carries encoded media in RTP for media transport. Here your choices are either VP8(libvpx) or h264(various encoders) for best support. There's also VP9 and h265 but I don't believe they are broadly supported.
In any case the process is the same:
TrackLocalStaticSample
is useful for this)This crate provides nothing in terms of encoding, but if you can get media in the appropriate format(annex-b bitstream for h.264 or VP8 descriptor wrapped frames for VP8). The play-from-disk-* examples are good starting points for this, but instead of playing from disk you'd use an encoder.