[FFmpeg-trac] #11044(undetermined:new): padding is very frustrating.

FFmpeg trac at avcodec.org
Tue Jun 4 23:31:19 EEST 2024


#11044: padding is very frustrating.
-------------------------------------+-------------------------------------
             Reporter:  elias        |                     Type:  defect
  tsolis                             |
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 I found it very frustrating to center a video
 the original dimensions was: Width 1920 pixels and Height
 : 1080 pixels. I wanted to make new dimensions with padding as:
 (h)3840x(w)2160

 I found these problems
 if i put height/2 or iw/2 or ow/2 are not recognised.
 I could not understand when iw ow or height can be interpret and when not.
 There are not taken automatically from videofile? I must define explicity
 somewhere these variables?
 What is the diff between "=" and ":"?

 for eg.
 this works
 "pad=width=2160:height=3840:x=3840/2:y=2160/2:color=red"
 this does not work
 "pad=width=2160:height=3840:x=width/2:y=height/2:color=red"
 "pad=width=2160:height=3840:x=iw/2:y=ih/2:color=red"
 "pad=iw=2160:ih=3840:x=iw/2:y=ih/2:color=red"
 "pad=iw:2160:ih:3840:x=iw/2:y=ih/2:color=red"

 This was very frustrated for me.
 you explicity says in your manual:

 "in_w
 in_h

     The input video width and height.
 iw
 ih

     These are the same as in_w and in_h.
 "

 Also i cant understand when to use "()" for expressions and when not.
 You must explicity explain in your manual these things.
 I spent almost 4 hours+ to nothing.


 This works:

 {{{
 rm a_t.mp4; for vids in *.mkv; do ffmpeg -i "$vids" -ss 0:00:00 -to
 00:00:01  -vf  "pad=width=2160:height=3840:x=3840/2:y=2160/2:color=red"
 -video_track_timescale 90000 -crf 19  -vcodec libx265   -an
 "a_${vids/.*}.mp4"; done;

 this does not:

 rm a_t.mp4; for vids in *.mkv; do ffmpeg -i "$vids" -ss 0:00:00 -to
 00:00:01  -vf  "pad=width=2160:height=3840:x=height/2:y=width/2:color=red"
 -video_track_timescale 90000 -crf 19  -vcodec libx265   -an
 "a_${vids/.*}.mp4"; done;
 }}}



 {{{

 ffmpeg --version
 ffmpeg version N-115575-g4e120fbbbd Copyright (c) 2000-2024 the FFmpeg
 developers
   built with gcc 13 (Debian 13.2.0-25)
   configuration: --prefix=/home/eros/ffmpeg_build --pkg-config-
 flags=--static --extra-cflags=-I/home/eros/ffmpeg_build/include --extra-
 ldflags=-L/home/eros/ffmpeg_build/lib --extra-libs='-lpthread -lm'
 --ld=g++ --bindir=/home/eros/bin --enable-gpl --enable-gnutls --enable-
 libaom --enable-libass --enable-libfreetype --enable-libmp3lame --enable-
 libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
 libvpx --enable-libx264 --enable-libx265 --enable-nonfree
   libavutil      59. 21.100 / 59. 21.100
   libavcodec     61.  6.100 / 61.  6.100
   libavformat    61.  3.104 / 61.  3.104
   libavdevice    61.  2.100 / 61.  2.100
   libavfilter    10.  2.102 / 10.  2.102
   libswscale      8.  2.100 /  8.  2.100
   libswresample   5.  2.100 /  5.  2.100
   libpostproc    58.  2.100 / 58.  2.100

 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11044>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list