View Full Version : ffmpeg + crop + pad broken?
Selur
15th May 2010, 15:57
Atm. I'm using something like:
ffmpeg.exe -v 0 -r 23.976 -i "D:\Test.m2ts" -threads 4 -v 0 -croptop 130 -cropbottom 132 -cropleft 0 -cropright 0 -padtop 130 -padbottom 132 -vsync 0 -an -r 23.976 -pix_fmt yuv420p -f rawvideo - | x264 --crf 20 --fps 23.976 --output "test.264" - 1920x1080
for encoding
using a ffmpeg Version from:
http://sourceforge.net/projects/mplayer-win32/files/
or
http://ffmpeg.arrozcru.org/autobuilds/
Problem is, newest versions just stop and post:
"Please use vf=pad"
(older once work fine)
Since I couldn't find anything over at http://www.ffmpeg.org/ffmpeg-doc.html why this is happening I thought I might ask here if someone knows what's going wrong.
Is there a new option for padding, or is there a but in newer ffmpeg versions?
Cu Selur
http://ffmpeg.org/libavfilter.html
(replace "-vfilters" with "-vf", they need to update the docs)
Selur
20th May 2010, 18:00
Thanks for the info. :)
Selur
20th May 2010, 21:02
using latest from http://ffmpeg.arrozcru.org/autobuilds/ with:
ffmpeg -v 0 -r 25.000 -i "D:\sx264\test.mp4" -threads 4 -v 0 -vfilters "crop=640:350:0:2, scale=720:394, pad=720:576:90" -vsync 0 -an -r 25 -pix_fmt yuv420p -f rawvideo - | x264 --crf 20 --fps 23.976 --output "test.264" - 1920x1080
I get:
FFmpeg version SVN-r23201, Copyright (c) 2000-2010 the FFmpeg developers built on May 20 2010 04:15:44 with gcc 4.4.2
configuration: --target-os=mingw32 --enable-runtime-cpudetect --enable-avisynth --enable-gpl --enable-version3 --enable-bzlib --enable-libgsm --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid --enable-libschroedinger --enable-libx264 --enable-libopencore_amrwb --enable-libopencore_amrnb --cross-prefix=i686-mingw32- --cc=ccache-i686-mingw32-gcc --arch=x86 --enable-memalign-hack
libavutil 50.15. 3 / 50.yuv [info]: 720x576p 0:0 @ 25/1 fps (cfr)15. 3
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
libavcodec 52.68. 2 / 52.68. 2
libavformat 52.63. 0 / 52.63. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.10. 0 / 0.10. 0
x264 [info]: profile High, level 4.1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\sx264\test.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
Duration: 00:00:17.20, start: 0.000000, bitrate: 844 kb/s
Stream #0.0(und): Video: mpeg4, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 722 kb/s, 25 fps, 25 tbr, 25k tbn, 25 tbc
Stream #0.1(und): Audio: mp3, 48000 Hz, 2 channels, s16, 120 kb/s
Unrecognized option 'vfilters'
using latest from: http://sourceforge.net/projects/mplayer-win32/files/ which uses rev23107 gives the same output, both don't recognize vfilters.
Cu Selur
Brazil2
20th May 2010, 22:07
both don't recognize vfilters.
Looks like you have misunderstood what Pete meant: do NOT use -vfilters but use -vf instead.
Selur
20th May 2010, 22:11
Doh, now I get it. :)
Thanks!! :)
Selur
28th May 2010, 19:07
Apparently I dont':
ffmpeg -v 0 -r 23.976 -i "D:\testclips\IronMan2_avc_aac.mov" -threads 4 -v 0 -vf "crop=0:4:1280:540,scale=1280:656,pad=1280:720:32:0" -vsync 0 -an -r 23.976 -pix_fmt yuv420p -f rawvideo - | x264 --pass 2 --bitrate 1500 --level 4.1 --direct auto --qpmin 1 --partitions i4x4,p8x8,b8x8 --subme 5 --trellis 0 --no-fast-pskip --weightp 1 --aq-mode 0 --vbv-maxrate 62500 --vbv-bufsize 78125 --sar 40:33 --stats "D:\test_19_47_30_003_01.stats" --fps 23.976 --output "D:\Encoding Temp\test_19_47_30_003_02.264" - 1280x720
gives me:
[crop @ 013e6f60]x:0 y:4 w:1280 h:540
[scale @ 013e70f0]w:1280 h:540 fmt:yuv420p -> w:1280 h:656 fmt:yuv420p flags:2
[pad @ 013e6f20]w:1280 h:720 x:32 y:0 color:0x10808000[yuva]
[pad @ 013e6f20]Input area 32:0:1312:656 not within the padded area 0:0:1280:720 or zero-sized
but the syntax seems to be right, or not?
-vf "crop=0:4:1280:540,scale=1280:656,pad=1280:720:32:0"
should crop to 1280x540, then resize the result to 1280:656 and then pad to 1280:720.
Cu Selur
Reimar
28th May 2010, 19:16
-vf "crop=0:4:1280:540,scale=1280:656,pad=1280:720:32:0"
should crop to 1280x540, then resize the result to 1280:656 and then pad to 1280:720.
You don't add any padding in the X-direction, so you can't use any X-offset. Did you maybe mean pad=1280:720:0:32 ?
Selur
28th May 2010, 19:20
DOH!!! Thanks totally missed it! I mixed up x&y :)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.