<p>Simply insert crop after the select filter.</p>
<pre><code>-vf &quot;select=not(mod(n\,$N)),crop=1440:1080,tile=${COLS}x${ROWS}&quot;
</code></pre>

CC BY-SA 4.0
2022-06-23T23:50:22.143Z
Thanks - I had tried that but my mistake was apparently that I was adding ":0:0" for the offset.  For some reason if I do that the crop does not apply in this context.
Pat Niemeyer
CC BY-SA 4.0
2022-06-23T04:00:43.317Z
2022-06-23T04:00:43.317Z
Gyan
<p>I'm using the following to build a preview filmstrip image by grabbing every Nth frame and tiling them into a grid:</p>
<pre><code>ffmpeg -i &quot;$file&quot; -frames 1 -vf &quot;select=not(mod(n\,$N)),tile=${COLS}x${ROWS}&quot; -y strip.jpg
</code></pre>
<p>However the input video has black bars so I'd like to crop them out before grabbing those frames using something like:</p>
<pre><code>-filter:v &quot;crop=1440:1080&quot;
</code></pre>
<p>Adding that has no effect on the tiled output image.  I have also tried incorporating that filter into the -vf option to no effect.  Is there any way to accomplish this without a second pass that renders the whole video (temporarily) cropped?  Thanks!</p>

<ffmpeg>
How can I apply a crop to frames before tiling with ffmpeg?
Pat Niemeyer
# How can I apply a crop to frames before tiling with ffmpeg?

(Asked by: username_0 on 2022-06-22)

I'm using the following to build a preview filmstrip image by grabbing every Nth frame and tiling them into a grid:
ffmpeg -i "$file" -frames 1 -vf "select=not(mod(n\,$N)),tile=${COLS}x${ROWS}" -y strip.jpg

However the input video has black bars so I'd like to crop them out before grabbing those frames using something like:
-filter:v "crop=1440:1080"

Adding that has no effect on the tiled output image.  I have also tried incorporating that filter into the -vf option to no effect.  Is there any way to accomplish this without a second pass that renders the whole video (temporarily) cropped?  Thanks!

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2022-06-23. Score: 0 | Accepted answer

Simply insert crop after the select filter.
-vf "select=not(mod(n\,$N)),crop=1440:1080,tile=${COLS}x${ROWS}"

> **Comments:**
> **username_0**: Thanks - I had tried that but my mistake was apparently that I was adding ":0:0" for the offset.  For some reason if I do that the crop does not apply in this context.  

---

