webrtc_codecs_vpx (webrtc_codecs v0.1.0)
View SourceVP8 and VP9 codec plugin, on libvpx.
webrtc:add_transceiver(Pc, video, #{frames => true, codec_plugin => {webrtc_codecs_vpx, #{}}}).decode/2 gives one webrtc_codecs:picture/0 per frame shown, with
the RTP timestamp of the frame. After a frame it cannot decode it drops
frames until the next key frame.
encode/2 takes webrtc_codecs:picture/0 and encodes in real time at
a constant bitrate. It follows bitrate (bits per second) and makes a
key frame for keyframe => true. Pictures of another size start a new
stream with a key frame.
VP9 is profile 0 only: 8 bit 4:2:0.
Options:
bitrate: of the encoder at start, default from the picture sizemin_bitrate,max_bitrate: bounds for the bitrate, default 30000 and nonekeyframe_interval: most frames between two key frames, default 3000threads: of the encoder, default from the picture size and the number of schedulers, and of the decoder, default 1cpu_used: libvpx speed setting, default -6 for VP8 and 7 for VP9max_pixels: largest picture the decoder accepts, default 3840 x 2160
Summary
Functions
The size a frame declares, read from its header without decoding it:
{key, Width, Height} for a key frame, {inter, Width, Height} for
another frame that sets its size, inter for one that takes the size
of a frame before it.
The frames of a VP9 superframe (VP9 bitstream annex B): none when the
data has no superframe index, error when it has one that does not fit
the data. The index is at the end: a marker byte 110 with the number
of bytes per size and the number of frames, the sizes, and the marker
again.
Functions
-spec frame_size(vp8 | vp9, binary()) -> {key | inter, pos_integer(), pos_integer()} | inter | {error, invalid_frame | unsupported_profile}.
The size a frame declares, read from its header without decoding it:
{key, Width, Height} for a key frame, {inter, Width, Height} for
another frame that sets its size, inter for one that takes the size
of a frame before it.
The frames of a VP9 superframe (VP9 bitstream annex B): none when the
data has no superframe index, error when it has one that does not fit
the data. The index is at the end: a marker byte 110 with the number
of bytes per size and the number of frames, the sizes, and the marker
again.