Is it possible to use AVAssetWriter to mux together audio and video and produce an MPEG-TS stream?
I'm constructing an AVAssetWriter like this:
private lazy var assetWriter = {
let w = AVAssetWriter(contentType: .mpeg2TransportStream)
w.shouldOptimizeForNetworkUse = true
return w
}()
and wiring it up to an AVCaptureSession, however I get the following error
[AVAssetWriter initWithContentType:] Invalid file type UTI. Available file types are: public.aiff-audio, public.3gpp, public.aifc-audio, com.apple.m4v-video, com.apple.m4a-audio, com.apple.coreaudio-format, public.mpeg-4, com.microsoft.waveform-audio, com.apple.quicktime-movie, org.3gpp.adaptive-multi-rate-audio'
which seems to suggest that I can't do this? My goal is to produce an MPEG-TS stream to send over the network from an AVCaptureSession, following something like this guide except producing MPEG-TS instead of fragmented mp4.