Skip to content

Possible to encode raw RGB frames in a video track? #329

Answered by k0nserv
awestlake87 asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  1. Initialise encoder
  2. Encode one raw frame
  3. Send the frame(TrackLocalStaticSample is useful for this)
  4. Go To 2

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@awestlake87
Comment options

Answer selected by k0nserv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #328 on October 22, 2022 09:49.