<p>In</p>

<p><code>-vf select=gte(n\,360)</code>,</p>

<p><code>-vf</code> declares a video filterchain i.e. a sequence of one or more filters to be applied to the video stream.</p>

<p>The <code>select</code> filter allows the user to keep or discard individual frames, based on the result of the expression presented to it. For each frame, the expression is evaluated. If the result is zero, the frame is discarded, else kept. Here, the expression is <code>gte(n\,360)</code> which checks if the index i.e. presentation serial number, of the current frame is equal to or greater than 360. So, this expr will result in all frames with index 0 to 359 to be discarded, and <em>all</em> frames with a higher index to be selected.</p>

<p>See <a href="https://ffmpeg.org/ffmpeg-utils.html#Expression-Evaluation" rel="nofollow noreferrer">https://ffmpeg.org/ffmpeg-utils.html#Expression-Evaluation</a> for a list of functions available.</p>

<p>See the <a href="https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect" rel="nofollow noreferrer">docs</a> for the select filter to see the list of variables which can be tested. </p>

<p>Since <code>-vframes 1</code> is present, ffmpeg will stop after one frame has been received from the select filter.</p>

CC BY-SA 4.0
2018-12-28T15:53:06.300Z
"Expression Evaluation" that was the name I was looking for 
Arete
CC BY-SA 4.0
2018-12-28T15:46:22.493Z
2018-12-28T15:46:22.493Z
Gyan
<p><a href="https://stevens.li/guides/video/converting-hdr-to-sdr-with-ffmpeg/" rel="nofollow noreferrer">This</a> article describes how you can use <a href="https://ffmpeg.org/ffmpeg.html" rel="nofollow noreferrer">ffmpeg</a> to export a frame of a video file as a PNG image using the following command:</p>

<pre><code>ffmpeg.exe -i input.mkv -vf select=gte(n\,360) -vframes 1 output.png
</code></pre>

<p>My question is what <code>-vf select=gte(n\,360)</code> really does and how it works. I could not find any documentation on this, neither in the official documentation or elsewhere on the internet.</p>

<p>From the context I know this tells FFmpeg to use the 360th frame, but I would like some further documentation on how to use this. What does <code>gte</code> mean and what is <code>n\,</code>?</p>

<ffmpeg>
Export an image frame with FFmpeg
Arete
# Export an image frame with FFmpeg

(Asked by: username_0 on 2018-12-28)

This article describes how you can use ffmpeg to export a frame of a video file as a PNG image using the following command:
ffmpeg.exe -i input.mkv -vf select=gte(n\,360) -vframes 1 output.png

My question is what -vf select=gte(n\,360) really does and how it works. I could not find any documentation on this, neither in the official documentation or elsewhere on the internet.
From the context I know this tells FFmpeg to use the 360th frame, but I would like some further documentation on how to use this. What does gte mean and what is n\,?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2018-12-28. Score: 0 | Accepted answer

In

`-vf select=gte(n\,360)`,

`-vf` declares a video filterchain i.e. a sequence of one or more filters to be applied to the video stream.

The `select` filter allows the user to keep or discard individual frames, based on the result of the expression presented to it. For each frame, the expression is evaluated. If the result is zero, the frame is discarded, else kept. Here, the expression is `gte(n\,360)` which checks if the index i.e. presentation serial number, of the current frame is equal to or greater than 360. So, this expr will result in all frames with index 0 to 359 to be discarded, and *all* frames with a higher index to be selected.

See <https://ffmpeg.org/ffmpeg-utils.html#Expression-Evaluation> for a list of functions available.

See the [docs](https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect) for the select filter to see the list of variables which can be tested.

Since `-vframes 1` is present, ffmpeg will stop after one frame has been received from the select filter.

> **Comments:**
> **username_0**: "Expression Evaluation" that was the name I was looking for   

---

