> ## 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.

# Clips

> Clips from OCF clips matched with proxy, sound and custom schema clips

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

## Usage

```javascript theme={null}
const { log } = useDaytalog();
/*
Get an array of clips with clip name, ocf size, proxy size 
and durarion in timecode format.
*/ 
const clips = log.clips.map((clip) => {
  return {
    clip: clip.clip,
    ocfSize: clip.size(),
    proxySize: clip.proxy.size()
    duration: clip.durarionTC()
  };
});
```

## Extended

Clips can be extended with data from other schemas.

## Properties

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

<ResponseField name="clip" type="string">
  Clip Name
</ResponseField>

### <span className="visually-hidden">tc\_start</span>

<ResponseField name="tc_start" type="string" post={['optional']}>
  Timecode start
</ResponseField>

### <span className="visually-hidden">tc\_end</span>

<ResponseField name="tc_end" type="string" post={['optional']}>
  Timecode End
</ResponseField>

### <span className="visually-hidden">camera\_model</span>

<ResponseField name="camera_model" type="string" post={['optional']}>
  Camera model
</ResponseField>

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

<ResponseField name="reel" type="string" post={['optional']}>
  Camera Reel
</ResponseField>

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

<ResponseField name="fps" type="number" post={['optional']}>
  Camera fps
</ResponseField>

### <span className="visually-hidden">sensor\_fps</span>

<ResponseField name="sensor_fps" type="number" post={['optional']}>
  Camera sensor fps
</ResponseField>

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

<ResponseField name="lens" type="string" post={['optional']}>
  Camera Lens Info
</ResponseField>

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

<ResponseField name="shutter" type="string" post={['optional']}>
  Camera Shutter
</ResponseField>

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

<ResponseField name="resolution" type="string" post={['optional']}>
  Camera Resolution
</ResponseField>

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

<ResponseField name="codec" type="string" post={['optional']}>
  Camera Codec
</ResponseField>

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

<ResponseField name="gamma" type="string" post={['optional']}>
  Camera Gamma
</ResponseField>

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

<ResponseField name="ei" type="number" post={['optional']}>
  Camera Exposure Index
</ResponseField>

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

<ResponseField name="wb" type="number" post={['optional']}>
  Camera White Balance
</ResponseField>

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

<ResponseField name="tint" type="string" post={['optional']}>
  Camera Tint
</ResponseField>

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

<ResponseField name="lut" type="string" post={['optional']}>
  Camera LUT
</ResponseField>

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

<ResponseField name="copies" type="{ volumes: string, hash?: string }[]">
  OCF Clip Copies
</ResponseField>

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

<ResponseField name="proxy" type="Proxy">
  A collection of proxy related properties and methods

  <Expandable name="Properties">
    <ResponseField name="codec" type="string" post={['optional']}>
      Proxy Codec
    </ResponseField>

    <ResponseField name="format" type="string" post={['optional']}>
      Proxy Format
    </ResponseField>

    <ResponseField name="Resolution" type="string" post={['optional']}>
      Proxy Resolution
    </ResponseField>

    <ResponseField name="size()" type="string">
      Gets the size in a user-friendly format, such as "1.17 GB" or "117 MB".

      <br />

      You can specify the unit of measurement you prefer by providing an options object. The default unit is <code>"auto"</code>.

      <br />

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

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

    <ResponseField name="sizeAsNumber()" type="number">
      Retrieves the size as a numerical value.

      <br />

      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 <code>"bytes"</code>.

      <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 = clip.proxy.sizeAsNumber();
        console.log(sizeNumberDefault); // Output: 117000000
        // Get size in Gigabytes
        const sizeNumberGB = clip.proxy.sizeAsNumber({ type: 'gb' });
        console.log(sizeNumberGB); // Output: 0.117
        // Get size in Megabytes
        const sizeNumberMB = clip.proxy.sizeAsNumber({ type: 'mb' });
        console.log(sizeNumberMB); // Output: 117
        ```
      </Expandable>
    </ResponseField>

    <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 = clip.proxy.sizeAsTuple();
        console.log(sizeTupleAuto); // Output: [117, 'MB']
        // Get size as a tuple in Gigabytes
        const sizeTupleGB = clip.proxy.sizeAsTuple({ type: 'gb' });
        console.log(sizeTupleGB); // Output: [0.117, 'GB']
        ```
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

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

<ResponseField name="sound" type="string[]">
  An array of Sound Clip names matched to this clip by TC
</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">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 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>

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

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

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