1.3.15. Video Outputs

Incoming and outgoing video feeds can optionally output video to either a local window, or as an RTP stream over UDP.

This is specified during construction of the video feed type, by passing a VideoOutputFeedComponent object.

For example, to display an outgoing Media Server video feed in a local window:

    PxMedia::VideoOutputFeedAuto localOut;
    auto                         outgoingFeed =
        PxMedia::MediaServerOutgoingVideoFeed::create(mediaSession, props, input, localOut);

To display an outgoing Media Server video feed via RTP/UDP:

    PxMedia::VideoOutputFeedUdp udpOutput;
    udpOutput.host("localhost");
    udpOutput.port(5006);
    udpOutput.encoderProperties().bitrate(5000_kbps);
    auto outgoingFeed =
        PxMedia::MediaServerOutgoingVideoFeed::create(mediaSession, props, inputVideo, udpOutput);

To disable local output of an outgoing Media Server video feed:

    PxMedia::VideoOutputFeedFake fakeOutput;
    auto                         outgoingFeed =
        PxMedia::MediaServerOutgoingVideoFeed::create(mediaSession, props, inputVideo, fakeOutput);

Note that the output encoder properties can be set using encoderProperties(). For a list of available encoder properties, see X264EncoderFeedComponent.

To display an incoming Peer video feed in a local window:

    PxMedia::VideoOutputFeedAuto localOut;
    auto                         remotePeerFeed =
        PxMedia::PeerRemoteVideoFeed::create(peerSession, feedProperties, localOut);

To display an incoming Peer video feed via RTP/UDP:

    PxMedia::VideoOutputFeedUdp udpOutput;
    udpOutput.host("localhost");
    udpOutput.port(5006);
    udpOutput.encoderProperties().bitrate(5000_kbps);
    auto remotePeerFeed =
        PxMedia::PeerRemoteVideoFeed::create(peerSession, feedProperties, udpOutput);