user12719: I am trying to create a simple overlay graphic where the overlay moves and screen and changes speed according to time. So I tried a simple 
ffmpeg -i input.mp4 -vcodec qtrle -i overlay.mov -filter_complex '[0:0][1:0]overlay=x=if(t<2\,t*3\,t*5)[out]' -map '[out]' -y output.mp4
and got an error code of :
[Parsed_overlay_0 @ 0000003f4e1e2ea0] [Eval @ 0000003f4c0fe5b0] Missing ')' or too many args in 'if(t<2,t*3,t*5)'
[Parsed_overlay_0 @ 0000003f4e1e2ea0] Error when evaluating the expression 'if(t<2,t*3,t*5)' for x
[Parsed_overlay_0 @ 0000003f4e1e2ea0] Failed to configure input pad on Parsed_overlay_0
Error configuring complex filters.
Invalid argument
if I remove the "if" part and just leave a formula it works :
-filter_complex '[0:0][1:0]overlay=x=12+t*3[out]'
I tried playing with escaping of the different characters but it doesn't look like its a parsing error. Any ideas of how to use this correctly? The ffmpeg documentation has a sample for doing font color expression with a logical value here , but any attempt at 
overlay=x_expr
doesn't really work as well
please help
Thanks in advance

user21958: Here's an example of how to crop landscape videos to square (1:1 aspect), while not cropping portrait videos:
-filter_complex "[0:v]crop='if(lt(in_h,in_w),in_h,in_w):in_h'[out]"

user1871: FFmpeg uses functions, rather than operators, for conditional execution and comparisons, so t<2 is not a valid syntax. 
The syntax for your given command would be
ffmpeg -i input.mp4 -i overlay.mov -filter_complex \
       "[0][1]overlay=x=if(lt(t\,2)\,t*3\,t*5)[out]" \
       -map '[out]' -c:v qtrle -y output.mp4

where lt(var,value) is the less than function. 

12719: <p>I am trying to create a simple overlay graphic where the overlay moves and screen and changes speed according to time. So I tried a simple </p>

<p>ffmpeg -i input.mp4 -vcodec qtrle -i overlay.mov -filter_complex '[0:0][1:0]overlay=x=if(t&lt;2\,t*3\,t*5)[out]' -map '[out]' -y output.mp4</p>

<p>and got an error code of :</p>

<p>[Parsed_overlay_0 @ 0000003f4e1e2ea0] [Eval @ 0000003f4c0fe5b0] Missing ')' or too many args in 'if(t&lt;2,t*3,t*5)'</p>

<p>[Parsed_overlay_0 @ 0000003f4e1e2ea0] Error when evaluating the expression 'if(t&lt;2,t*3,t*5)' for x</p>

<p>[Parsed_overlay_0 @ 0000003f4e1e2ea0] Failed to configure input pad on Parsed_overlay_0</p>

<p>Error configuring complex filters.</p>

<p>Invalid argument</p>

<p>if I remove the "if" part and just leave a formula it works :</p>

<p>-filter_complex '[0:0][1:0]overlay=x=12+t*3[out]'</p>

<p>I tried playing with escaping of the different characters but it doesn't look like its a parsing error. Any ideas of how to use this correctly? The ffmpeg documentation has a sample for doing font color expression with a logical value <a href="https://ffmpeg.org/ffmpeg-all.html#Examples-80" rel="nofollow">here</a> , but any attempt at </p>

<p>overlay=x_expr</p>

<p>doesn't really work as well</p>

<p>please help</p>

<p>Thanks in advance</p>
 21958: <p>Here's an example of how to crop landscape videos to square (1:1 aspect), while <strong>not</strong> cropping portrait videos:</p>

<p><code>-filter_complex "[0:v]crop='if(lt(in_h,in_w),in_h,in_w):in_h'[out]"</code></p>
 1871: <p>FFmpeg uses functions, rather than operators, for conditional execution and comparisons, so <code>t&lt;2</code> is not a valid syntax. </p>

<p>The syntax for your given command would be</p>

<pre><code>ffmpeg -i input.mp4 -i overlay.mov -filter_complex \
       "[0][1]overlay=x=if(lt(t\,2)\,t*3\,t*5)[out]" \
       -map '[out]' -c:v qtrle -y output.mp4
</code></pre>

<p>where <code>lt(var,value)</code> is the <code>less than</code> function. </p>
