Playback stream only returns 1 video frame. All following video frame requests fail.

We make the initial RequestStream call with the following parameters…

{
        StreamType: "Transcoded",
        MethodType: "Pull",
        SignalType: "Playback",
        ItemId: cameraId,
        DestWidth: width,
        DestHeight: height,
        Fps: "1",
        ComprLevel: "70",
        Time: dateTime
}

And we receive the following outputParams…

<OutputParams>
	<Param Name="Live" Value="Yes" />
	<Param Name="Playback" Value="Yes" />
	<Param Name="PTZ" Value="Yes" />
	<Param Name="Preset" Value="Yes" />
	<Param Name="ExportAvi" Value="Yes" />
	<Param Name="ExportDatabase" Value="Yes" />
	<Param Name="ExportJpeg" Value="Yes" />
	<Param Name="Sequences" Value="Yes" />
	<Param Name="DbStartTime" Value="1613073014253" />
	<Param Name="VideoId" Value="25cd6b5c-de93-4fa4-a9bc-6a3a186fa969" />
	<Param Name="StreamId" Value="25cd6b5c-de93-4fa4-a9bc-6a3a186fa969" />
	<Param Name="ByteOrder" Value="LittleEndian" />
	<Param Name="StreamType" Value="Transcoded" />
	<Param Name="SrcWidth" Value="1920" />
	<Param Name="SrcHeight" Value="1080" />
</OutputParams>

We then make a POST request to… http://{Endpoint}/XProtectMobile/Video/{VideoId}

The response returns with valid data that we then decode and use to build out an image.

However, subsequent requests to the same endpoint result in failures when trying to parse the response body for video information. The first 2 properties decoded, the GUID and the timestamp, don’t get decoded correctly and nothing else seems to be correct. Here is the decoded VideoConnectionItem from the initial response that was working…

VideoConnectionItem {
    Type: { Segment: 0, Frame: 1 },
    Error: { NonFatal: 1, Fatal: 2 },
    MainHeaderLength: 36,
    SizeInfoHeaderLength: 32,
    LiveInfoHeaderLength: 8,
    PlaybackInfoHeaderLength: 8,
    HeaderExtensionFlagSize: 1,
    HeaderExtensionFlagLive: 2,
    HeaderExtensionFlagPlayback: 4,
    HeaderExtensionFlagNativeData: 8,
    HeaderExtensionFlagMotionData: 16,
    HeaderLocationData: 32,
    HeaderStreamInfo: 64,
    HeaderCarouselInfo: 128,
    LiveFlags:
       { LiveFeed: 1,
         Motion: 2,
         Recording: 4,
         Notification: 8,
         CameraConnectionLost: 16,
         DatabaseFail: 32,
         DiskFull: 64,
         ClientLiveStopped: 128 },
    PlaybackFlags:
       { Stopped: 1,
         Forward: 2,
         Backward: 4,
         DatabaseStart: 16,
         DatabaseEnd: 32,
         DatabaseError: 64 },
    offset: 84,
    data: Uint8Array [ ... ],
    uuid: 'c0541af4-a407-4046-b3ca-741affa6706e',
    timestamp: 2021-02-25T20:52:06.687Z,
    frameNumber: 0,
    dataSize: 262312,
    headerSize: 84,
    hasSizeInformation: 1,
    hasLiveInformation: 0,
    hasPlaybackInformation: 0,
    hasNativeData: 0,
    hasMotionInformation: 0,
    hasLocationData: 0,
    hasStreamInfo: 0,
    hasCarouselInfo: 0,
    sizeInfo:
       { sourceSize: { width: 1920, height: 1080 },
         sourceCrop:
              { left: 0,
                top: 0,
                right: 1920,
                bottom: 1080,
                width: 1920,
                height: 1080 },
         destinationSize:
              { width: 1920,
                height: 1080,
                resampling: 1,
                top: 0,
                right: 1920,
                bottom: 1080 } },
    type: 1,
    blob: Blob {
         buffer: <Buffer ... >,
         [Symbol(closed)]: false,
         [Symbol(type)]: 'image/jpeg' } 
}

We are just trying to get playback working through through the Mobile Protocol. Please let us know if we are missing something or if you need more information.

Thank you.

Hello Dan,

It will be nice if you provide us with Wireshark trace so that we debug in more details what is the problem with the flow.

Also what is the parse error that happens in the failed to decoded frame? Usually all the frames after the first one will be empty frames unless you play the video forward or backwards using the ChangeStream command.

Best regards

Teodor