[FFmpeg-user] how to equal ratio scale the video

(忍)不轻云 449127727 at qq.com
Thu Jan 2 09:59:10 CET 2014


hi all:
[root at vmlin0295 log]# ffmpeg -y -i c448bfc4-cca5-474d-a6e8-651150373368.mp4 -vf scale="'if(gt(a,16/9),1280,trunc(oh*a*2)/2)':'if(gt(a,16/9),trunc(ow/a/2)*2,720)'" debug.mp4                
ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 13 2013 17:33:50 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-1)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libx264 --enable-shared --enable-static --enable-pthreads
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'c448bfc4-cca5-474d-a6e8-651150373368.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2013-12-31 04:05:50
  Duration: 00:06:12.84, start: 0.000000, bitrate: 6295 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1360x768 [SAR 1:1 DAR 85:48], 5984 kb/s, 25.04 fps, 25 tbr, 25k tbn, 50 tbc
    Metadata:
      creation_time   : 2013-12-31 04:05:50
      handler_name    : Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s
    Metadata:
      creation_time   : 2013-12-31 04:05:50
      handler_name    : Alias Data Handler
[libx264 @ 0x11735e00] width not divisible by 2 (1275x720)
Output #0, mp4, to 'debug.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    Stream #0:0(eng): Video: h264, yuv420p, 1275x720 [SAR 1:1 DAR 85:48], q=-1--1, 90k tbn, 25 tbc
    Metadata:
      creation_time   : 2013-12-31 04:05:50
      handler_name    : Alias Data Handler
    Stream #0:1(eng): Audio: none, 48000 Hz, stereo, s16
    Metadata:
      creation_time   : 2013-12-31 04:05:50
      handler_name    : Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> libfdk_aac)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height.


how to equal ratio  scale the video?




can you help me ?








you are welcome , happy new year.


More information about the ffmpeg-user mailing list