[FFmpeg-trac] #61(avfilter:new): ability to read video size during filtergraph operation

FFmpeg trac at avcodec.org
Thu Apr 14 00:23:54 CEST 2011


#61: ability to read video size during filtergraph operation
--------------------------+----------------------
  Reporter:  nieder       |      Owner:  michael
      Type:  enhancement  |     Status:  new
  Priority:  wish         |  Component:  avfilter
   Version:  git          |   Keywords:
Blocked By:               |   Blocking:
Reproduced:  0            |   Analyzed:  0
--------------------------+----------------------
 While running a video through a filtergraph, I needed to know the size of
 the video.  However, I could not find a way to read the size of the video
 at that point in time.

 {{{
 -vf "scale=${OUTWIDTH}:-1 [small] ; movie=${WATERMARK_FILE} [wm] ;
 [small][wm] overlay=main_w-overlay_w-10:10 [tagged] ; [tagged]
 pad=${OUTWIDTH}:${OUTHEIGHT}:0:(${OUTHEIGHT}-in_w)/2"
 }}}

 This is the filtergraph I was using.  My goal is to take several videos
 with different sizes and aspect ratios, shrink them all to a fixed width,
 and then add padding as necessary to give them all the same height.
 Because the scaled video will have varying height dimensions, I need to
 determine the height value before I can calculate the padding value.  The
 'crop' filter has "in_w" and "in_h" to provide the current values of the
 video, but these parameters don't seem to be available in the 'pad'
 filter.

 So it would be great to either

 1) have the 'pad' filter have in_w and in_h made available

 or

 2) more generalizable, have a 'filter' that returns the dimension values
 of the video so it can be fed into an expression for evaluation and use in
 other filters in the filtergraph.

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


More information about the FFmpeg-trac mailing list