[FFmpeg-user] crop filter, how to move crop rectangle along the y-axis ?

Sub Phil phil4000n at gmail.com
Sat Jun 24 19:56:23 EEST 2017


Hi,

I wish to have the crop retancle to move from position 200 to 400, when 4
seconds are laps.
Why does it only work along the x-axis?

*Along x-axis, this works, crop rectangle jumps from x=200 to x=400 when
t>4*
ffmpeg -y -i "30secGraduated1280x720.mp4" -vf
"crop=in_w-780:in_h-200:if(lt(t\,4)\,200\,400):0" -c:v libx264 -preset:v
ultrafast -crf 27 -an _outALPHA.mp4

*Along y-axis, crop rectangle stay fixed.*
F:\dbtest>ffmpeg -y -i "30secGraduated1280x720.mp4" -vf
"crop=in_w-780:in_h-200:0:if(lt(t\,4)\,200\,400)" -c:v libx264 -preset:v
ultrafast -crf 27 -an _outALPHA.mp4
ffmpeg version N-86537-gae6f6d4 Copyright (c) 2000-2017 the FFmpeg
developers
  built with gcc 7.1.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda
--enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx
--enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig
--enable-frei0r --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype
--enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
--enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 66.100 / 55. 66.100
  libavcodec     57. 99.100 / 57. 99.100
  libavformat    57. 73.100 / 57. 73.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '30secGraduated1280x720.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.72.101
  Duration: 00:00:30.00, start: 0.000000, bitrate: 16 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 /
0x31637661), yuv444p, 1280x720 [SAR 1:1 DAR 16:9], 13 kb/s, 25 fps, 25 tbr,
12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 00000000026d00a0] using SAR=1/1
[libx264 @ 00000000026d00a0] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 00000000026d00a0] profile High 4:4:4 Predictive, level 3.0,
4:4:4 8-bit
[libx264 @ 00000000026d00a0] 264 - core 150 r2833 df79067 - H.264/MPEG-4
AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html -
options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=6 threads=6
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250
keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=27.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to '_outALPHA.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.73.100
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021),
yuv444p, 500x520 [SAR 1:1 DAR 25:26], q=-1--1, 25 fps, 12800 tbn, 25 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.99.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=  750 fps=362 q=-1.0 Lsize=      34kB time=00:00:29.96 bitrate=
9.3kbits/s speed=14.5x
video:30kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 12.376843%
[libx264 @ 00000000026d00a0] frame I:3     Avg QP:16.67  size:  6519
[libx264 @ 00000000026d00a0] frame P:747   Avg QP:16.10  size:    15
[libx264 @ 00000000026d00a0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 00000000026d00a0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%
 0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 00000000026d00a0] coded y,u,v intra: 3.9% 0.0% 0.0% inter: 0.0%
0.0% 0.0%
[libx264 @ 00000000026d00a0] i16 v,h,dc,p: 89%  8%  3%  0%
[libx264 @ 00000000026d00a0] kb/s:8.12

F:\dbtest>


More information about the ffmpeg-user mailing list