---
title: "fileOutput(_:didStartRecordingTo:from:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcapturefileoutputrecordingdelegate/fileoutput(_:didstartrecordingto:from:)"
---

# fileOutput(_:didStartRecordingTo:from:)

Informs the delegate when the output has started writing to a file.

## Declaration

```swift
optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection])
```

## Parameters

- `output`: The capture file output that started writing the file.
- `fileURL`: The file URL of the file that is being written.
- `connections`: An array of doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureConnection objects attached to the file output that provided the data that is being written to the file.

## Discussion

Discussion If an error condition prevents any data from being written, this method may not be called. fileOutput(_:willFinishRecordingTo:from:error:) and fileOutput(_:didFinishRecordingTo:from:error:) are always called, even if no data is written. You should not assume that this method will be called on a specific thread, and should make this method as efficient as possible.

## See Also

### Delegate methods

- [fileOutput(_:didStartRecordingTo:startPTS:from:)](avfoundation/avcapturefileoutputrecordingdelegate/fileoutput(_:didstartrecordingto:startpts:from:).md)
- [fileOutput(_:willFinishRecordingTo:from:error:)](avfoundation/avcapturefileoutputrecordingdelegate/fileoutput(_:willfinishrecordingto:from:error:).md)
- [fileOutput(_:didFinishRecordingTo:from:error:)](avfoundation/avcapturefileoutputrecordingdelegate/fileoutput(_:didfinishrecordingto:from:error:).md)
- [fileOutput(_:didPauseRecordingTo:from:)](avfoundation/avcapturefileoutputrecordingdelegate/fileoutput(_:didpauserecordingto:from:).md)
- [fileOutput(_:didResumeRecordingTo:from:)](avfoundation/avcapturefileoutputrecordingdelegate/fileoutput(_:didresumerecordingto:from:).md)
