---
title: "smpteToFrame"
canonical: "https://help.vicon.com/space/ShogunPost121/1253736793/smpteToFrame"
format: markdown
---
# Description

Converts an SMPTE timecode string into a frame number, taking into account the SMPTE_Offset value of the active clip.

The SMPTE_Offset value of the active clip specifies the timecode start for the data on the clip. It is there so that frame 1 of your data corresponds to the starting timecode of your take. Without it, your frame numbers would end up large and cumbersome.

If you want to ignore the SMPTE_Offset in the computation, specify the `-ignoreOffset` flag. You may wish to do this when computing a SMPTE_Offset of your own, for instance. In that situation, you wouldn't want the existing offset value in the computation.

The frames (FF) portion of the timecode string should go from 0 to 24, 25, or 30 depending on the current timecode standard (Film, PAL, and NTSC respectively). As your scene rate may be at a frame rate that is a higher multiple of those standard rates (e.g. 120 fps for NTSC), the sub-frame portion indicates the "in between frame" of the frame passed in.

## Functional area

System

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `smpteToFrame "smpteStr"[-ignoreOffset]` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `smpteStr` | string | yes | The timecode value to convert to a frame number. |

> Macro (scroll-pagebreak)

### Flags

> Macro (scroll-tablelayout)

| Name | Flag arguments | Argument type | Exclusive to | Comments |
| --- | --- | --- | --- | --- |
| `ignoreOffset` | 0 | — | — | By default, the active clip's SMPTE_Offset value is removed from the timecode argument to produce a final frame value. This flag causes the offset to be ignored causing a straight timecode-to-frames conversion. |

## Return value

integer

## Examples

```plaintext
// Set the timecode offset of the active clip
setProperty "SMPTE_Offset" "01:23:45:12(2)" -onMod "TheActiveClip";
 
// Now convert a the value at exactly the one hour mark into a frame
// number. 
int $frameNumber = `smpteToFrame "01:00:00:00(0)"`;
print $frameNumber;
```

# Additional information

## Related commands

- [frameToSmpte](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737420)
- [getTime](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736823)