Observed behavior
In the following file:
SRTHaishinKit/Sources/TS/TSReader.swift
at makeSampleBuffer()
The current code picks only the first slice and drops the rest:
case .h264:
let units = nalUnitReader.read(&pes.data, type: H264NALUnit.self)
if let unit = units.first(where: { $0.type == .idr || $0.type == .slice }) {
var data = Data([0x00, 0x00, 0x00, 0x01])
data.append(unit.data)
pes.data = data
}
isNotSync = !units.contains { $0.type == .idr }
(See first screenshot)
Expected behavior
my suggestion:
var annexB = Data()
for unit in units where unit.type == .idr || unit.type == .slice {
annexB.append(contentsOf: [0x00, 0x00, 0x00, 0x01])
annexB.append(unit.data)
}
if !annexB.isEmpty {
pes.data = annexB
It should gather all the slices to fully recreate the frame (See screenshot)
To Reproduce
I used VisionPro as a sender. It seems that VPro sends video in multiple slices instead of just one.
Version
2.2.5
Smartphone info.
VisionPro 26.2
Additional context
Sender is a VisionPro device with mode=caller sending a mock video
Used SRT mode=listener in ipad
Screenshots
Before:
After:
Relevant log output
Observed behavior
In the following file:
SRTHaishinKit/Sources/TS/TSReader.swift
at makeSampleBuffer()
The current code picks only the first slice and drops the rest:
(See first screenshot)
Expected behavior
my suggestion:
It should gather all the slices to fully recreate the frame (See screenshot)
To Reproduce
I used VisionPro as a sender. It seems that VPro sends video in multiple slices instead of just one.
Version
2.2.5
Smartphone info.
VisionPro 26.2
Additional context
Sender is a VisionPro device with mode=caller sending a mock video
Used SRT mode=listener in ipad
Screenshots
Before:
After:
Relevant log output