user37004: i have a mkv file and its resolution is 1280x720. when i calculated the crop using Handbrake, it shows that i need to crop 40 from top and 30 from bottom.
So far i know how to crop equal amount from top and bottom, but i cannot understand how to specify that the crop values for top and bottom are different
so far i tried crop=in_w:in_h-80 which cuts 40 from top and 40 from bottom, but i want to cut only 30 from bottom
thank you

user39927: After two days of looking for an answer to this question, I found out the logic behind it and I'll share it here, because this topic looks as the best place for it, I hope it helps people understand it more easily through my explanation than through all the other explanations I found with Google on many sites and forums.
So I wanted to crop different number of rows - 20 from the top and 10 from the bottom - of a video file, and I used this command:
ffmpeg -i input.file -vf crop=iw:ih-30:0:10 -c:v av1_nvenc -c:a copy output.file

The logic of the crop=iw:ih-30:0:10 is as follows:

iw - input width of the video, which stays the same as the original

ih - input height of the video, which we want to cut

30 - the total number of rows we want to remove

0 - I don't know why we have to input this, but we just have to

10 - the number of rows, which we want to cut from the bottom



37004: <p>i have a mkv file and its resolution is 1280x720. when i calculated the crop using Handbrake, it shows that i need to crop <strong>40 from top</strong> and <strong>30 from bottom</strong>.
So far i know how to crop equal amount from top and bottom, but i cannot understand how to specify that the crop values for top and bottom are different</p>
<p>so far i tried <code>crop=in_w:in_h-80</code> which cuts 40 from top and 40 from bottom, but i want to cut only 30 from bottom</p>
<p>thank you</p>
 39927: <p>After two days of looking for an answer to this question, I found out the logic behind it and I'll share it here, because this topic looks as the best place for it, I hope it helps people understand it more easily through my explanation than through all the other explanations I found with Google on many sites and forums.</p>
<p>So I wanted to crop different number of rows - 20 from the top and 10 from the bottom - of a video file, and I used this command:</p>
<pre><code>ffmpeg -i input.file -vf crop=iw:ih-30:0:10 -c:v av1_nvenc -c:a copy output.file
</code></pre>
<p>The logic of the <code>crop=iw:ih-30:0:10</code> is as follows:</p>
<ul>
<li><p><code>iw</code> - input width of the video, which stays the same as the original</p>
</li>
<li><p><code>ih</code> - input height of the video, which we want to cut</p>
</li>
<li><p><code>30</code> - the total number of rows we want to remove</p>
</li>
<li><p><code>0 </code>- I don't know why we have to input this, but we just have to</p>
</li>
<li><p><code>10</code> - the number of rows, which we want to cut from the bottom</p>
</li>
</ul>
