missing videoCodec item in json

SLM

Member
Sometimes there's no videoCodec item in the returned json of rest-api/stream/find, although there is videostream.

Code:
    [appKey] => defaultApp
    [sessionId] => .................
    [mediaSessionId] => 78915cb0-8a4d-11ec-9160-7dcaaf8117a1
    [name] => 0853b67864bb996634d6a33541a81f8f
    [published] => 1
    [hasVideo] => 1
    [hasAudio] => 1
    [status] => PENDING
    [sdp] => v=0
o=- 1239478873764154356 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
...

    [audioCodec] => opus
    [record] => 
    [width] => 0
    [height] => 0
    [bitrate] => 0
    [minBitrate] => 0
    [maxBitrate] => 0
    [quality] => 0
    [history] => 
    [gop] => 0
    [fps] => 0
    [audioBitrate] => 0
    [codecImpl] => 
    [transport] => UDP
    [cvoExtension] => 
    [createDate] => 1644482589883
    [mediaType] => publish
    [audioState] => Array
        (
            [muted] => 
        )

    [videoState] => Array
        (
            [muted] => 
        )

    [mediaProvider] => WebRTC
    [custom] => Array
        (
            ..........
        )

    [origin] => https://.....................
    [constraints] => Array
        (
            [audio] => Array
                (
                    [deviceId] => default
                )

            [video] => Array
                (
                    [deviceId] => d83b3de5f6f476ad70afa1bcfe751043edda411f8e7adde6cecda8d137d5a954
                    [width] => 1280
                    [height] => 720
                    [minWidth] => 1280
                    [minHeight] => 720
                    [maxWidth] => 1280
                    [maxHeight] => 720
                    [minBitrate] => 1024
                    [frameRate] => 30
                )

        )

)


As far as I can see, this only happens when the videostream is 'pending', but I'm not sure. It would be preferable however if the videoCodec item was still listed but empty or set to n/a.
 

Max

Administrator
Staff member
Good day.
As far as I can see, this only happens when the videostream is 'pending', but I'm not sure.
A typical stream flow is:
1. PENDING - WebRTC connection is establishing, no media traffic yet, stream codecs is unknown
2. PUBLISHING - WebRTC connection is established, media traffic is sent from client, stream codec can be detected
3. UNPUBLISHED or FAILED - streaming is stopped by client or server
So on the first stage codec is not known yet.
Anyway, the only proper way to check a stream codec is stream metrics
 
Top