# Help with FFMPEG script

**URL:** <https://resource.dopus.com/t/help-with-ffmpeg-script/51302>\
**Category:** Help & Support\
**Created:** [June 15, 2024, 7:05pm UTC](https://resource.dopus.com/t/help-with-ffmpeg-script/51302 "2024-06-15T19:05:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Groovybanana](https://resource.dopus.com/user_avatar/resource.dopus.com/groovybanana/32/45446_2.png) [@Groovybanana](https://resource.dopus.com/u/Groovybanana)\
**Post date:** [June 15, 2024, 7:05pm UTC](https://resource.dopus.com/t/help-with-ffmpeg-script/51302/1 "2024-06-15T19:05:02Z")

</div>

I have the following script in a button and it works great:

for /R %%A IN (\*.mp4 \*.avi \*.mkv \*.m4v) DO ffmpeg -i "%%A" -vf "select=gte(n,2500)" -vframes 1 "%%~nA.jpg"

This will make a video still of every video file in the current folder. I would like to modify it so that it will only work on my selected files rather than every file in the current directory.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [June 15, 2024, 7:33pm UTC](https://resource.dopus.com/t/help-with-ffmpeg-script/51302/2 "2024-06-15T19:33:27Z")

</div>

Try

```plaintext
ffmpeg.exe -i {filepath} -vf "select=gte(n,2500)" -vframes 1 {filepath|ext=jpg}

```

---

<div class="post-metadata">

**Author:** ![Groovybanana](https://resource.dopus.com/user_avatar/resource.dopus.com/groovybanana/32/45446_2.png) [@Groovybanana](https://resource.dopus.com/u/Groovybanana)\
**Post date:** [June 15, 2024, 7:41pm UTC](https://resource.dopus.com/t/help-with-ffmpeg-script/51302/3 "2024-06-15T19:41:23Z")

</div>

Unfortunately, that does not work. The command prompt window pops up for a fraction of a second and that's about all that happens.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [June 15, 2024, 8:27pm UTC](https://resource.dopus.com/t/help-with-ffmpeg-script/51302/4 "2024-06-15T20:27:24Z")

</div>

```plaintext
ffmpeg.exe -i {filepath} -vf "select=gte(n\,2500)" -vframes 1 {filepath|ext=jpg}

```

* * *

Next time, put your command in a code block. [It's not that hard](https://resource.dopus.com/t/formatting-tips-specific-to-the-opus-forum/24899).

---

<div class="post-metadata">

**Author:** ![Groovybanana](https://resource.dopus.com/user_avatar/resource.dopus.com/groovybanana/32/45446_2.png) [@Groovybanana](https://resource.dopus.com/u/Groovybanana)\
**Post date:** [June 15, 2024, 8:41pm UTC](https://resource.dopus.com/t/help-with-ffmpeg-script/51302/5 "2024-06-15T20:41:24Z")

</div>

That did the trick, thank you.
