Producing and capturing closed caption data with `AVCaptureSession`

56 views Asked by At

I noticed that when capturing media with AVCaptureSession from an iPhone connected over USB to a mac that there is also a closed caption input (AVMediaTypeClosedCaption = 'clcp'):

"<AVCaptureInputPort: 0x60000003c260 (AVCaptureDeviceInput: 0x6000002497e0) vide 0000 enabled>",
"<AVCaptureInputPort: 0x60000003c270 (AVCaptureDeviceInput: 0x6000002497e0) soun 0000 enabled>",
"<AVCaptureInputPort: 0x60000003c280 (AVCaptureDeviceInput: 0x6000002497e0) clcp 0000 enabled>"

The problem is I don't know how to capture closed caption data or even produce it.

For capture my first guess would be to add an AVCaptureMetadataOutput but that isn't available on macOS. AVCaptureMovieFileOutput seems to consume any inputs it understands, but I can't see any closed caption data in the resulting file. Maybe because I don't know how to produce it on the iPhone.

For producing, I have tried turning on Voice Over and playing back media with subtitles with no obvious results.

0

There are 0 answers