> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daytalog.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OCF

> A collection of properties and methods for Original Camera Files (OCF).

[Back to Log](/schemas/daytalog/log)

## Usage

```javascript theme={null}
const { log } = useDaytalog();
// Get the total size of camera files
const size = log.ocf.size();
```

## Properties

### <span className="visually-hidden">clips</span>

<ResponseField name="clips" type="OcfClipType[]">
  OCF Clips (Original Camera Files)
</ResponseField>

### <span className="visually-hidden">files()</span>

<ResponseField name="files()" type="number">
  Retrieves the total number of files
</ResponseField>

### <span className="visually-hidden">size()</span>

<ResponseField name="size()" type="string">
  Gets the size in a user-friendly format, such as "1.17 GB" or "117 MB".
  You can specify the unit of measurement you prefer by providing an options object.
  The default unit is `auto`, which automatically selects the most appropriate unit.

  <br />

  Options: <code>size({'{'} type: "auto" | "tb" | "gb" | "mb" | "bytes" {'}'})</code>

  <Expandable title="Example">
    ```javascript theme={null}
    // Automatically choose the best unit
    const sizeAuto = log.ocf.size();
    console.log(sizeAuto); // Output: "117 MB"
    // Specify the unit as Gigabytes
    const sizeGB = log.ocf.size({ type: 'gb' });
    console.log(sizeGB); // Output: "0.117 GB"
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">sizeAsNumber()</span>

<ResponseField name="sizeAsNumber()" type="number">
  Retrieves the size as a numerical value.
  This method returns the size in a numerical format, which can be useful for calculations or comparisons.
  You can specify the unit of measurement by providing an options object. The default unit is `bytes`.

  <br />

  Options: <code>sizeAsNumber({'{'} type: "auto" | "tb" | "gb" | "mb" | "bytes" {'}'})</code>

  <Expandable title="Example">
    ```javascript theme={null}
    // Get size in the default unit (bytes)
    const sizeNumberDefault = log.ocf.sizeAsNumber();
    console.log(sizeNumberDefault); // Output: 117000000
    // Get size in Gigabytes
    const sizeNumberGB = log.ocf.sizeAsNumber({ type: 'gb' });
    console.log(sizeNumberGB); // Output: 0.117
    // Get size in Megabytes
    const sizeNumberMB = log.ocf.sizeAsNumber({ type: 'mb' });
    console.log(sizeNumberMB); // Output: 117
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">sizeAsTuple()</span>

<ResponseField name="sizeAsTuple()" type="[number, string]">
  Obtains the size as a pair containing both the numerical value and its unit.

  <br />

  This method returns an array where the first element is the size number and the second element is the unit.
  You can specify the unit of measurement by providing an options object. The default unit is <code>"auto"</code>.

  <br />

  Options: <code>sizeAsTuple({'{'} type: "auto" | "tb" | "gb" | "mb" | "bytes" {'}'})</code>

  <Expandable title="Example">
    ```javascript theme={null}
    // Get size as a tuple with automatic unit
    const sizeTupleAuto = log.ocf.sizeAsTuple();
    console.log(sizeTupleAuto); // Output: [117, 'MB']
    // Get size as a tuple in Gigabytes
    const sizeTupleGB = log.ocf.sizeAsTuple({ type: 'gb' });
    console.log(sizeTupleGB); // Output: [0.117, 'GB']
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">copies()</span>

<ResponseField name="copies()" type="{ volumes: string[]; clips: string[]; count: [number, number] }[]">
  Retrieves the copies as an array of objects.

  <Expandable title="Properties">
    <ResponseField name="volumes" type="string[]">
      The volumes for the copy. A copy can be split on multiple volumes.
    </ResponseField>

    <ResponseField name="clips" type="string[]">
      The clips in this copy
    </ResponseField>

    <ResponseField name="count" type="[number, number]">
      First number represents the number of clips in this copy.
      Second number is total number of clips.
      The copy has all clips if both numbers are equal. Else it is not complete.
    </ResponseField>
  </Expandable>

  <Expandable title="Example">
    ```javascript theme={null}
    const copies = log.ocf.copies();
    console.log(copies); // Output: [{ volumes: ['Volume1'], clips: ['A001C001'], count: [10, 10] }, ...]
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">reels()</span>

<ResponseField name="reels()" type="string[]">
  Gets the reels as an array of strings.

  <br />

  You can optionally group reels by passing <code>{'{'}rangeMerging: true{'}'}</code>.

  <br />

  Options: <code>reels({'{'} rangeMerging: boolean {'}'})</code>

  <Expandable title="Example">
    ```javascript theme={null}
    // Retrieve reels without grouping (default)
    const reels = log.ocf.reels();
    console.log(reels); // Output: ['Reel1', 'Reel2', 'Reel3']
    // Retrieve merged reels
    const mergedReels = log.ocf.reels({ rangeMerging: true });
    console.log(mergedReels); // Output: ['Reel1 - Reel3', '+ 2 other clips']
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">duration()</span>

<ResponseField name="duration()" type="string">
  Retrieves the duration in a human-readable string format (e.g., "1h, 30m, 45s").

  <Expandable title="Example">
    ```javascript theme={null}
    const duration = log.ocf.duration();
    console.log(duration); // Output: "1h, 30m, 45s"
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">durationTC()</span>

<ResponseField name="durationTC()" type="string">
  Retrieves the duration in timecode format (e.g., "01:30:45:00").

  <Expandable title="Example">
    ```javascript theme={null}
    const durationTC = log.ocf.durationTC();
    console.log(durationTC); // Output: "01:30:45:00"
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">durationObject()</span>

<ResponseField name="durationObject()" type="{ hours: number; minutes: number; seconds: number }">
  Retrieves the duration as an object with time components: hours, minutes, and seconds.

  <Expandable title="Example">
    ```javascript theme={null}
    const durationObj = log.ocf.durationObject();
    console.log(durationObj); // Output: { hours: 1, minutes: 30, seconds: 45 }
    ```
  </Expandable>
</ResponseField>

### <span className="visually-hidden">durationAsSeconds()</span>

<ResponseField name="durationAsSeconds()" type="number">
  Retrieves the duration in total seconds. Suitable if you want to do your own calculations.

  <Expandable title="Example">
    ```javascript theme={null}
    const durationSeconds = log.ocf.durationAsSeconds();
    console.log(durationSeconds); // Output: 5445
    ```
  </Expandable>
</ResponseField>
