osx - ffmpeg rotate and resize -
i'm trying resize movie , rotate counter-clockwise using ffmpeg. can achieve 1 or other ok individually
ffmpeg -i mvi_8189.mov -vf "transpose=2" -ss 00:00:12 -t 00:00:05 rotate.mov
or
ffmpeg -i mvi_8189.mov -s 720x406 -ss 00:00:12 -t 00:00:05 resize.mov
but if try both, either-
ffmpeg -i mvi_8189.mov -s 720x406 -ss 00:00:12 -t 00:00:05 resize.mov
ffmpeg -i resize.mov -vf "transpose=2" toutp.mov
or
ffmpeg -i mvi_8189.mov -vf "transpose=2" -ss 00:00:12 -t 00:00:05 rotate.mov
ffmpeg -i rotate.mov -s 406x720 toutp.mov
the final movie not play, audio, no video; neither previewing in finder, nor in quicktime. more once have attempted play it, can't play other movie whatsoever (only audio) - quicktime won't quit, need force-quit it. way restore seems reboot os-x
this though work -
ffmpeg -i mvi_8189.mov -vf "transpose=2" -ss 00:00:12 -t 00:00:05 rotate.mov
ffmpeg -i rotate.mov -s 720x406 toutp.mov
but doesn't want - stretches movie in wrong direction
any ideas?
ffmpeg version 1.0.git copyright (c) 2000-2012 ffmpeg developers built on dec 24 2012 18:43:25 llvm-gcc 4.2.1 (llvm build 2336.1.00)
mac osx 10.7.5
========== output
ffmpeg -i mvi_8189.mov -vf "transpose=2" -ss 00:00:12 -t 00:00:05 rotate.mov ffmpeg -i rotate.mov -s 406x720 toutp.mov ffmpeg version 1.0.git copyright (c) 2000-2012 ffmpeg developers built on dec 24 2012 18:43:25 llvm-gcc 4.2.1 (llvm build 2336.1.00) configuration: --prefix=/usr/local --enable-shared --disable-mmx --enable-libmp3lame --enable-gpl --enable-zlib --enable-libvorbis --enable-libfaac --enable-nonfree --enable-libx264 --enable-pthreads libavutil 52. 12.100 / 52. 12.100 libavcodec 54. 81.100 / 54. 81.100 libavformat 54. 49.102 / 54. 49.102 libavdevice 54. 3.102 / 54. 3.102 libavfilter 3. 29.101 / 3. 29.101 libswscale 2. 1.103 / 2. 1.103 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 guessed channel layout input stream #0.1 : stereo input #0, mov,mp4,m4a,3gp,3g2,mj2, 'mvi_8189.mov': metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt caep creation_time : 2014-08-17 23:13:43 duration: 00:01:32.40, start: 0.000000, bitrate: 44677 kb/s stream #0:0(eng): video: h264 (constrained baseline) (avc1 / 0x31637661), yuvj420p, 1920x1080, 43132 kb/s, 25 fps, 25 tbr, 25k tbn, 50k tbc metadata: creation_time : 2014-08-17 23:13:43 stream #0:1(eng): audio: pcm_s16le (sowt / 0x74776f73), 48000 hz, stereo, s16, 1536 kb/s metadata: creation_time : 2014-08-17 23:13:43 [libx264 @ 0x7fc67c043600] using cpu capabilities: mmx2 sse2fast ssse3 fastshuffle sse4.2 avx [libx264 @ 0x7fc67c043600] profile high, level 4.0 [libx264 @ 0x7fc67c043600] 264 - core 128 - h.264/mpeg-4 avc codec - copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 output #0, mov, 'rotate.mov': metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt caep encoder : lavf54.49.102 stream #0:0(eng): video: h264 (avc1 / 0x31637661), yuvj420p, 1080x1920, q=-1--1, 12800 tbn, 25 tbc metadata: creation_time : 2014-08-17 23:13:43 stream #0:1(eng): audio: aac (mp4a / 0x6134706d), 48000 hz, stereo, s16, 128 kb/s metadata: creation_time : 2014-08-17 23:13:43 stream mapping: stream #0:0 -> #0:0 (h264 -> libx264) stream #0:1 -> #0:1 (pcm_s16le -> libfaac) press [q] stop, [?] frame= 125 fps=5.7 q=-2.0 lsize= 6394kb time=00:00:05.00 bitrate=10470.5kbits/s /s video:6322kb audio:67kb subtitle:0 global headers:0kb muxing overhead 0.079207% [libx264 @ 0x7fc67c043600] frame i:1 avg qp:25.87 size:113032 [libx264 @ 0x7fc67c043600] frame p:65 avg qp:25.78 size: 64251 [libx264 @ 0x7fc67c043600] frame b:59 avg qp:26.73 size: 37017 [libx264 @ 0x7fc67c043600] consecutive b-frames: 5.6% 94.4% 0.0% 0.0% [libx264 @ 0x7fc67c043600] mb i16..4: 10.7% 79.9% 9.3% [libx264 @ 0x7fc67c043600] mb p i16..4: 3.6% 12.0% 0.3% p16..4: 52.0% 19.1% 11.3% 0.0% 0.0% skip: 1.7% [libx264 @ 0x7fc67c043600] mb b i16..4: 0.9% 1.7% 0.0% b16..8: 45.4% 5.1% 0.8% direct:24.2% skip:21.9% l0:50.1% l1:44.5% bi: 5.3% [libx264 @ 0x7fc67c043600] 8x8 transform intra:74.5% inter:79.5% [libx264 @ 0x7fc67c043600] coded y,uvdc,uvac intra: 59.4% 94.3% 79.5% inter: 38.2% 80.5% 30.1% [libx264 @ 0x7fc67c043600] i16 v,h,dc,p: 30% 21% 22% 28% [libx264 @ 0x7fc67c043600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 14% 24% 6% 8% 9% 7% 8% 7% [libx264 @ 0x7fc67c043600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 18% 17% 6% 7% 8% 6% 6% 4% [libx264 @ 0x7fc67c043600] i8c dc,h,v,p: 60% 14% 18% 8% [libx264 @ 0x7fc67c043600] weighted p-frames: y:0.0% uv:0.0% [libx264 @ 0x7fc67c043600] ref p l0: 43.9% 12.6% 26.8% 16.7% [libx264 @ 0x7fc67c043600] ref b l0: 68.6% 31.4% [libx264 @ 0x7fc67c043600] kb/s:10357.28 ffmpeg version 1.0.git copyright (c) 2000-2012 ffmpeg developers built on dec 24 2012 18:43:25 llvm-gcc 4.2.1 (llvm build 2336.1.00) configuration: --prefix=/usr/local --enable-shared --disable-mmx --enable-libmp3lame --enable-gpl --enable-zlib --enable-libvorbis --enable-libfaac --enable-nonfree --enable-libx264 --enable-pthreads libavutil 52. 12.100 / 52. 12.100 libavcodec 54. 81.100 / 54. 81.100 libavformat 54. 49.102 / 54. 49.102 libavdevice 54. 3.102 / 54. 3.102 libavfilter 3. 29.101 / 3. 29.101 libswscale 2. 1.103 / 2. 1.103 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 input #0, mov,mp4,m4a,3gp,3g2,mj2, 'rotate.mov': metadata: major_brand : qt minor_version : 512 compatible_brands: qt encoder : lavf54.49.102 duration: 00:00:05.01, start: 0.010667, bitrate: 10446 kb/s stream #0:0(eng): video: h264 (high) (avc1 / 0x31637661), yuvj420p, 1080x1920, 10358 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc metadata: handler_name : datahandler stream #0:1(eng): audio: aac (mp4a / 0x6134706d), 48000 hz, stereo, fltp, 109 kb/s metadata: handler_name : datahandler [libx264 @ 0x7fcf1c05ba00] using cpu capabilities: mmx2 sse2fast ssse3 fastshuffle sse4.2 avx [libx264 @ 0x7fcf1c05ba00] profile high, level 3.0 [libx264 @ 0x7fcf1c05ba00] 264 - core 128 - h.264/mpeg-4 avc codec - copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 output #0, mov, 'toutp.mov': metadata: major_brand : qt minor_version : 512 compatible_brands: qt encoder : lavf54.49.102 stream #0:0(eng): video: h264 (avc1 / 0x31637661), yuvj420p, 406x720, q=-1--1, 12800 tbn, 25 tbc metadata: handler_name : datahandler stream #0:1(eng): audio: aac (mp4a / 0x6134706d), 48000 hz, stereo, s16, 128 kb/s metadata: handler_name : datahandler stream mapping: stream #0:0 -> #0:0 (h264 -> libx264) stream #0:1 -> #0:1 (aac -> libfaac) press [q] stop, [?] frame= 125 fps= 32 q=-2.0 lsize= 469kb time=00:00:05.01 bitrate= 766.2kbits/s video:396kb audio:68kb subtitle:0 global headers:0kb muxing overhead 1.088481% [libx264 @ 0x7fcf1c05ba00] frame i:1 avg qp:24.20 size: 31395 [libx264 @ 0x7fcf1c05ba00] frame p:42 avg qp:24.51 size: 7137 [libx264 @ 0x7fcf1c05ba00] frame b:82 avg qp:27.71 size: 893 [libx264 @ 0x7fcf1c05ba00] consecutive b-frames: 0.8% 16.0% 57.6% 25.6% [libx264 @ 0x7fcf1c05ba00] mb i16..4: 7.0% 62.2% 30.8% [libx264 @ 0x7fcf1c05ba00] mb p i16..4: 0.2% 0.8% 0.1% p16..4: 52.8% 18.7% 12.5% 0.0% 0.0% skip:14.9% [libx264 @ 0x7fcf1c05ba00] mb b i16..4: 0.0% 0.0% 0.0% b16..8: 30.0% 0.8% 0.1% direct: 0.9% skip:68.2% l0:36.0% l1:62.1% bi: 2.0% [libx264 @ 0x7fcf1c05ba00] 8x8 transform intra:66.4% inter:78.3% [libx264 @ 0x7fcf1c05ba00] coded y,uvdc,uvac intra: 79.3% 93.6% 84.9% inter: 13.6% 32.2% 10.4% [libx264 @ 0x7fcf1c05ba00] i16 v,h,dc,p: 50% 19% 7% 24% [libx264 @ 0x7fcf1c05ba00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 20% 11% 5% 8% 10% 9% 7% 8% [libx264 @ 0x7fcf1c05ba00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 22% 8% 5% 8% 8% 10% 5% 5% [libx264 @ 0x7fcf1c05ba00] i8c dc,h,v,p: 42% 22% 24% 13% [libx264 @ 0x7fcf1c05ba00] weighted p-frames: y:0.0% uv:0.0% [libx264 @ 0x7fcf1c05ba00] ref p l0: 48.7% 16.3% 25.6% 9.4% [libx264 @ 0x7fcf1c05ba00] ref b l0: 73.7% 21.3% 5.0% [libx264 @ 0x7fcf1c05ba00] ref b l1: 90.7% 9.3% [libx264 @ 0x7fcf1c05ba00] kb/s:647.04
i rotate, , resize (or vice versa). let's assume want output video 1280 pixels wide, , height proportional input aspect ratio.
ffmpeg -i movie.mp4 -filter_complex " [0] transpose=dir=2 [rotated] ; [rotated] scale=1280:-2 " fixed_movie.mp4
the -2
argument makes output height equal appropriate aspect ratio, divisible 2.
Comments
Post a Comment