Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#2806 closed defect (fixed)

Overlay filter with "shortest=1" drops last frame

Reported by: hansmi Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by richardpl)

Summary of the bug:
Encoding a video using "overlay=shortest=1" in the filter chain will lead to the last frame being dropped.

Using FFmpeg 1.2.1 installed using MacPorts?:

$ ffmpeg
ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 12 2013 13:46:11 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  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
[...]

How to reproduce:

# Generate 30 input frames (requires ImageMagick)
$ for i in {0..30}; do \
  convert -alpha on -background none -fill red \
    -pointsize 30  -size 200x200 -gravity center \
    label:$i png32:frame_$(printf '%03d' $i).png; \
done

# Encode without overlay filter (you have to adjust the
# font path if not testing on Mac OS X)
$ ffmpeg -an \
-f image2 -i 'frame_%03d.png' \
-filter_complex "[0:v] drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out]" \
-map '[out]' \
-vcodec mpeg4 -b:v 600k -flags +aic+mv4 \
working.mp4

# Encode with "overlay=shortest=1" (needed to stop encoding
# when running out of input frames; adjust the font path
# again)
$ ffmpeg -an \
-f image2 -i 'frame_%03d.png' \
-f lavfi -i 'color=c=white:size=200x200' \
-filter_complex "[1:v][0:v] overlay=shortest=1, drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out]" \
-map '[out]' \
-vcodec mpeg4 -b:v 600k -flags +aic+mv4 \
missingframe.mp4

Notice how the second version is missing a frame:

$ ffprobe -show_streams -loglevel quiet working.mp4 | grep -w nb_frames
nb_frames=31

$ ffprobe -show_streams -loglevel quiet missingframe.mp4 | grep -w nb_frames
nb_frames=30

This can be confirmed by looking at the video. The frame number is encoded at the top left and is also reflected by the number encoded in the original PNG files.

Change History (7)

comment:1 Changed 5 years ago by cehoyos

Please test current git head and please provide your failing command line together with the complete, uncut console output to make this a valid ticket.

comment:2 Changed 5 years ago by hansmi

Using Git master branch as of Wed Jul 24 13:48:12 UTC 2013:

~/src/ffmpeg $ git describe 
n2.0-314-gc5f3cc4

/tmp/ffmpeg-git-install $ bin/ffmpeg 
ffmpeg version N-54917-gc5f3cc4 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 24 2013 15:46:49 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/tmp/ffmpeg-git-install --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.102 /  3. 81.102
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Generating input frames:

/tmp/ffmpeg-git-install $ for i in {0..30}; do \
>   convert -alpha on -background none -fill red \
>     -pointsize 30  -size 200x200 -gravity center \
>     label:$i png32:frame_$(printf '%03d' $i).png; \
> done

/tmp/ffmpeg-git-install $ echo frame_*.png
frame_000.png frame_001.png frame_002.png frame_003.png frame_004.png frame_005.png frame_006.png frame_007.png frame_008.png frame_009.png frame_010.png frame_011.png frame_012.png frame_013.png frame_014.png frame_015.png frame_016.png frame_017.png frame_018.png frame_019.png frame_020.png frame_021.png frame_022.png frame_023.png frame_024.png frame_025.png frame_026.png frame_027.png frame_028.png frame_029.png frame_030.png

Input file information (notice how there are 31 frames):

/tmp/ffmpeg-git-install $ bin/ffmpeg -v 9 -loglevel 99 -i 'frame_%03d.png'
ffmpeg version N-54917-gc5f3cc4 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 24 2013 15:46:49 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/tmp/ffmpeg-git-install --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.102 /  3. 81.102
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'frame_%03d.png'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file frame_%03d.png.
Successfully parsed a group of options.
Opening an input file: frame_%03d.png.
[AVIOContext @ 0x7fd809c13880] Statistics: 907 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c13da0] Statistics: 589 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c13da0] Statistics: 849 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c148e0] Statistics: 861 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c14640] Statistics: 733 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c14720] Statistics: 880 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c155c0] Statistics: 962 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c15a80] Statistics: 715 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c15e40] Statistics: 946 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c16360] Statistics: 965 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c16880] Statistics: 1031 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c16960] Statistics: 625 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c16d40] Statistics: 1006 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c16e20] Statistics: 1029 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c16f00] Statistics: 848 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c173a0] Statistics: 1021 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c17480] Statistics: 1090 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c17560] Statistics: 862 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c17a20] Statistics: 1080 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c17b00] Statistics: 1130 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c17be0] Statistics: 1233 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c17cc0] Statistics: 985 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c18220] Statistics: 861 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c186e0] Statistics: 1204 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c187c0] Statistics: 1060 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c188a0] Statistics: 1202 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c18980] Statistics: 1274 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c18ac0] Statistics: 1052 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c18ba0] Statistics: 1262 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c18c80] Statistics: 1259 bytes read, 0 seeks
[AVIOContext @ 0x7fd809c18dc0] Statistics: 1263 bytes read, 0 seeks
Input #0, image2, from 'frame_%03d.png':
  Duration: 00:00:01.24, start: 0.000000, bitrate: N/A
    Stream #0:0, 31, 1/25: Video: png, rgba, 200x200, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
At least one output file must be specified

Produce video without overlay filter:

/tmp/ffmpeg-git-install $ bin/ffmpeg -an -v 9 -loglevel 99 \
> -f image2 -i 'frame_%03d.png' \
> -filter_complex "[0:v] drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out]" \
> -map '[out]' \
> -vcodec mpeg4 -b:v 600k -flags +aic+mv4 \
> working.mp4
ffmpeg version N-54917-gc5f3cc4 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 24 2013 15:46:49 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/tmp/ffmpeg-git-install --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.102 /  3. 81.102
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'image2'.
Reading option '-i' ... matched as input file with argument 'frame_%03d.png'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument '[0:v] drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out]'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '[out]'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'mpeg4'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '600k'.
Reading option '-flags' ... matched as AVOption 'flags' with argument '+aic+mv4'.
Reading option 'working.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option filter_complex (create a complex filtergraph) with argument [0:v] drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out].
Successfully parsed a group of options.
Parsing a group of options: input file frame_%03d.png.
Applying option an (disable audio) with argument 1.
Applying option f (force format) with argument image2.
Successfully parsed a group of options.
Opening an input file: frame_%03d.png.
[AVIOContext @ 0x7fecc3413e40] Statistics: 907 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3414340] Statistics: 589 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3414340] Statistics: 849 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3414ec0] Statistics: 861 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3414c20] Statistics: 733 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3414d00] Statistics: 880 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3415be0] Statistics: 962 bytes read, 0 seeks
[AVIOContext @ 0x7fecc34160a0] Statistics: 715 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3416460] Statistics: 946 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3416980] Statistics: 965 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3416ea0] Statistics: 1031 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3416f80] Statistics: 625 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3417360] Statistics: 1006 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3417440] Statistics: 1029 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3417520] Statistics: 848 bytes read, 0 seeks
[AVIOContext @ 0x7fecc34179c0] Statistics: 1021 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3417aa0] Statistics: 1090 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3417b80] Statistics: 862 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418040] Statistics: 1080 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418120] Statistics: 1130 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418200] Statistics: 1233 bytes read, 0 seeks
[AVIOContext @ 0x7fecc34182e0] Statistics: 985 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418840] Statistics: 861 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418d00] Statistics: 1204 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418de0] Statistics: 1060 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418ec0] Statistics: 1202 bytes read, 0 seeks
[AVIOContext @ 0x7fecc3418fa0] Statistics: 1274 bytes read, 0 seeks
[AVIOContext @ 0x7fecc34190e0] Statistics: 1052 bytes read, 0 seeks
[AVIOContext @ 0x7fecc34191c0] Statistics: 1262 bytes read, 0 seeks
[AVIOContext @ 0x7fecc34192a0] Statistics: 1259 bytes read, 0 seeks
[AVIOContext @ 0x7fecc34193e0] Statistics: 1263 bytes read, 0 seeks
Input #0, image2, from 'frame_%03d.png':
  Duration: 00:00:01.24, start: 0.000000, bitrate: N/A
    Stream #0:0, 31, 1/25: Video: png, rgba, 200x200, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file working.mp4.
Applying option map (set input stream mapping) with argument [out].
Applying option vcodec (force video codec ('copy' to copy stream)) with argument mpeg4.
Applying option b:v (video bitrate (please use -b:v)) with argument 600k.
Successfully parsed a group of options.
Opening an output file: working.mp4.
detected 2 logical cores
[Parsed_drawtext_0 @ 0x7fecc4000000] Setting 'fontfile' to value '/Library/Fonts/Arial.ttf'
[Parsed_drawtext_0 @ 0x7fecc4000000] Setting 'x' to value '5'
[Parsed_drawtext_0 @ 0x7fecc4000000] Setting 'y' to value '5'
[Parsed_drawtext_0 @ 0x7fecc4000000] Setting 'text' to value 'frame %{n}'
[graph 0 input from stream 0:0 @ 0x7fecc4002860] Setting 'video_size' to value '200x200'
[graph 0 input from stream 0:0 @ 0x7fecc4002860] Setting 'pix_fmt' to value '28'
[graph 0 input from stream 0:0 @ 0x7fecc4002860] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x7fecc4002860] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 0x7fecc4002860] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x7fecc4002860] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x7fecc4002860] w:200 h:200 pixfmt:rgba tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x7fecc40035a0] compat: called with args=[yuv420p]
[format @ 0x7fecc40035a0] Setting 'pix_fmts' to value 'yuv420p'
Successfully opened the file.
[auto-inserted scaler 0 @ 0x7fecc4003c40] w:iw h:ih flags:'bilinear' interl:0
[format @ 0x7fecc40035a0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_drawtext_0' and the filter 'format'
[AVFilterGraph @ 0x7fecc3415180] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 0x7fecc4003c40] w:200 h:200 fmt:rgba sar:0/1 -> w:200 h:200 fmt:yuv420p sar:0/1 flags:0x2
[mpeg4 @ 0x7fecc480c400] intra_quant_bias = 0 inter_quant_bias = -64
Output #0, mp4, to 'working.mp4':
  Metadata:
    encoder         : Lavf55.12.102
    Stream #0:0, 0, 1/12800: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 200x200, 1/25, q=2-31, 600 kb/s, 12800 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (png) -> drawtext
  drawtext -> Stream #0:0 (mpeg4)
Press [q] to stop, [?] for help
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:0 t:0.000000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:1 t:0.040000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:2 t:0.080000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:3 t:0.120000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:4 t:0.160000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:5 t:0.200000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:6 t:0.240000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:7 t:0.280000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:8 t:0.320000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:9 t:0.360000 text_w:53 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:10 t:0.400000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:11 t:0.440000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:12 t:0.480000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:13 t:0.520000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:14 t:0.560000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:15 t:0.600000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:16 t:0.640000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:17 t:0.680000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:18 t:0.720000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:19 t:0.760000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:20 t:0.800000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:21 t:0.840000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:22 t:0.880000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:23 t:0.920000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:24 t:0.960000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:25 t:1.000000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:26 t:1.040000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:27 t:1.080000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:28 t:1.120000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:29 t:1.160000 text_w:62 text_h:12 x:5 y:5
[Parsed_drawtext_0 @ 0x7fecc4000000] Copying data in avfilter.
[Parsed_drawtext_0 @ 0x7fecc4000000] n:30 t:1.200000 text_w:62 text_h:12 x:5 y:5
[output stream 0:0 @ 0x7fecc4003320] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
frame=   31 fps=0.0 q=2.0 Lsize=      23kB time=00:00:01.24 bitrate= 151.9kbits/s    
video:22kB audio:0kB subtitle:0 global headers:0kB muxing overhead 4.185470%
31 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7fecc4003900] Statistics: 34 seeks, 57 writeouts

It has 31 frames as intended:

/tmp/ffmpeg-git-install $ bin/ffprobe -show_streams -loglevel quiet working.mp4 | grep -w nb_frames
nb_frames=31

Now produce another video using “overlay=shortest=1”:

/tmp/ffmpeg-git-install $ bin/ffmpeg -an -v 9 -loglevel 99 \
> -f image2 -i 'frame_%03d.png' \
> -f lavfi -i 'color=c=white:size=200x200' \
> -filter_complex "[1:v][0:v] overlay=shortest=1, drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out]" \
> -map '[out]' \
> -vcodec mpeg4 -b:v 600k -flags +aic+mv4 \
> missingframe.mp4
ffmpeg version N-54917-gc5f3cc4 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 24 2013 15:46:49 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/tmp/ffmpeg-git-install --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.102 /  3. 81.102
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'image2'.
Reading option '-i' ... matched as input file with argument 'frame_%03d.png'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'lavfi'.
Reading option '-i' ... matched as input file with argument 'color=c=white:size=200x200'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument '[1:v][0:v] overlay=shortest=1, drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out]'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '[out]'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'mpeg4'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '600k'.
Reading option '-flags' ... matched as AVOption 'flags' with argument '+aic+mv4'.
Reading option 'missingframe.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option filter_complex (create a complex filtergraph) with argument [1:v][0:v] overlay=shortest=1, drawtext=fontfile=/Library/Fonts/Arial.ttf:x=5:y=5:text='frame %{n}' [out].
Successfully parsed a group of options.
Parsing a group of options: input file frame_%03d.png.
Applying option an (disable audio) with argument 1.
Applying option f (force format) with argument image2.
Successfully parsed a group of options.
Opening an input file: frame_%03d.png.
[AVIOContext @ 0x7fa65b414040] Statistics: 907 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b414560] Statistics: 589 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b414560] Statistics: 849 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b414da0] Statistics: 861 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b414e00] Statistics: 733 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b414ee0] Statistics: 880 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b415dc0] Statistics: 962 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b416280] Statistics: 715 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b416640] Statistics: 946 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b416b60] Statistics: 965 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417080] Statistics: 1031 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417160] Statistics: 625 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417540] Statistics: 1006 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417620] Statistics: 1029 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417700] Statistics: 848 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417ba0] Statistics: 1021 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417c80] Statistics: 1090 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b417d60] Statistics: 862 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b418220] Statistics: 1080 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b418300] Statistics: 1130 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b4183e0] Statistics: 1233 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b4184c0] Statistics: 985 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b418a20] Statistics: 861 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b418ee0] Statistics: 1204 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b418fc0] Statistics: 1060 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b4190a0] Statistics: 1202 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b419180] Statistics: 1274 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b4192c0] Statistics: 1052 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b4193a0] Statistics: 1262 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b419480] Statistics: 1259 bytes read, 0 seeks
[AVIOContext @ 0x7fa65b4195c0] Statistics: 1263 bytes read, 0 seeks
Input #0, image2, from 'frame_%03d.png':
  Duration: 00:00:01.24, start: 0.000000, bitrate: N/A
    Stream #0:0, 31, 1/25: Video: png, rgba, 200x200, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: input file color=c=white:size=200x200.
Applying option f (force format) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: color=c=white:size=200x200.
detected 2 logical cores
[Parsed_color_0 @ 0x7fa65c000000] Setting 'c' to value 'white'
[Parsed_color_0 @ 0x7fa65c000000] Setting 'size' to value '200x200'
[Parsed_color_0 @ 0x7fa65c000000] size:200x200 rate:25/1 duration:-1.000000 sar:1/1
[AVFilterGraph @ 0x7fa65b4137c0] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed
[lavfi @ 0x7fa65b814200] All info found
Input #1, lavfi, from 'color=c=white:size=200x200':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #1:0, 1, 1/25: Video: rawvideo (I420 / 0x30323449), yuv420p, 200x200 [SAR 1:1 DAR 1:1], 1/25, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file missingframe.mp4.
Applying option map (set input stream mapping) with argument [out].
Applying option vcodec (force video codec ('copy' to copy stream)) with argument mpeg4.
Applying option b:v (video bitrate (please use -b:v)) with argument 600k.
Successfully parsed a group of options.
Opening an output file: missingframe.mp4.
[Parsed_overlay_0 @ 0x7fa65c001760] Setting 'shortest' to value '1'
[Parsed_drawtext_1 @ 0x7fa65c001d80] Setting 'fontfile' to value '/Library/Fonts/Arial.ttf'
[Parsed_drawtext_1 @ 0x7fa65c001d80] Setting 'x' to value '5'
[Parsed_drawtext_1 @ 0x7fa65c001d80] Setting 'y' to value '5'
[Parsed_drawtext_1 @ 0x7fa65c001d80] Setting 'text' to value 'frame %{n}'
[graph 0 input from stream 1:0 @ 0x7fa65c0044e0] Setting 'video_size' to value '200x200'
[graph 0 input from stream 1:0 @ 0x7fa65c0044e0] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 1:0 @ 0x7fa65c0044e0] Setting 'time_base' to value '1/25'
[graph 0 input from stream 1:0 @ 0x7fa65c0044e0] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 1:0 @ 0x7fa65c0044e0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 1:0 @ 0x7fa65c0044e0] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 1:0 @ 0x7fa65c0044e0] w:200 h:200 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 0:0 @ 0x7fa65c0048e0] Setting 'video_size' to value '200x200'
[graph 0 input from stream 0:0 @ 0x7fa65c0048e0] Setting 'pix_fmt' to value '28'
[graph 0 input from stream 0:0 @ 0x7fa65c0048e0] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x7fa65c0048e0] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 0x7fa65c0048e0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x7fa65c0048e0] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x7fa65c0048e0] w:200 h:200 pixfmt:rgba tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x7fa65c0054c0] compat: called with args=[yuv420p]
[format @ 0x7fa65c0054c0] Setting 'pix_fmts' to value 'yuv420p'
Successfully opened the file.
[auto-inserted scaler 0 @ 0x7fa65c005b00] w:iw h:ih flags:'bilinear' interl:0
[Parsed_overlay_0 @ 0x7fa65c001760] auto-inserting filter 'auto-inserted scaler 0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_overlay_0'
[AVFilterGraph @ 0x7fa65c001280] query_formats: 6 queried, 4 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 0x7fa65c005b00] w:200 h:200 fmt:rgba sar:0/1 -> w:200 h:200 fmt:yuva420p sar:0/1 flags:0x2
[Parsed_overlay_0 @ 0x7fa65c001760] main w:200 h:200 fmt:yuv420p overlay w:200 h:200 fmt:yuva420p
[mpeg4 @ 0x7fa65c82fa00] intra_quant_bias = 0 inter_quant_bias = -64
Output #0, mp4, to 'missingframe.mp4':
  Metadata:
    encoder         : Lavf55.12.102
    Stream #0:0, 0, 1/12800: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 200x200 [SAR 1:1 DAR 1:1], 1/25, q=2-31, 600 kb/s, 12800 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (png) -> overlay:overlay
  Stream #1:0 (rawvideo) -> overlay:main
  drawtext -> Stream #0:0 (mpeg4)
Press [q] to stop, [?] for help
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:0.000000 t:0.000000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:0 t:0.000000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:1.000000 t:0.040000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:1 t:0.040000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:2.000000 t:0.080000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:2 t:0.080000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:3.000000 t:0.120000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:3 t:0.120000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:4.000000 t:0.160000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:4 t:0.160000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:5.000000 t:0.200000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:5 t:0.200000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:6.000000 t:0.240000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:6 t:0.240000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:7.000000 t:0.280000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:7 t:0.280000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:8.000000 t:0.320000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:8 t:0.320000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:9.000000 t:0.360000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:9 t:0.360000 text_w:53 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:10.000000 t:0.400000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:10 t:0.400000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:11.000000 t:0.440000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:11 t:0.440000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:12.000000 t:0.480000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:12 t:0.480000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:13.000000 t:0.520000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:13 t:0.520000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:14.000000 t:0.560000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:14 t:0.560000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:15.000000 t:0.600000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:15 t:0.600000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:16.000000 t:0.640000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:16 t:0.640000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:17.000000 t:0.680000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:17 t:0.680000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:18.000000 t:0.720000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:18 t:0.720000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:19.000000 t:0.760000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:19 t:0.760000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:20.000000 t:0.800000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:20 t:0.800000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:21.000000 t:0.840000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:21 t:0.840000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:22.000000 t:0.880000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:22 t:0.880000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:23.000000 t:0.920000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:23 t:0.920000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:24.000000 t:0.960000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:24 t:0.960000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:25.000000 t:1.000000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:25 t:1.000000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:26.000000 t:1.040000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:26 t:1.040000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:27.000000 t:1.080000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:27 t:1.080000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:28.000000 t:1.120000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:28 t:1.120000 text_w:62 text_h:12 x:5 y:5
[Parsed_overlay_0 @ 0x7fa65c001760] Copying data in avfilter.
[Parsed_overlay_0 @ 0x7fa65c001760] n:29.000000 t:1.160000 pos:nan x:0.000000 xi:0 y:0.000000 yi:0
[Parsed_drawtext_1 @ 0x7fa65c001d80] n:29 t:1.160000 text_w:62 text_h:12 x:5 y:5
[output stream 0:0 @ 0x7fa65c005180] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
frame=   30 fps=0.0 q=2.0 Lsize=      38kB time=00:00:01.20 bitrate= 259.9kbits/s    
video:37kB audio:0kB subtitle:0 global headers:0kB muxing overhead 2.475690%
61 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7fa65c005940] Statistics: 34 seeks, 56 writeouts

This video has only 30 frames, missing one:

/tmp/ffmpeg-git-install $ bin/ffprobe -show_streams -loglevel quiet missingframe.mp4 | grep -w nb_frames
nb_frames=30

As can be determined by looking at working.mp4 and missingframe.mp4 it is the last frame that's missing.

comment:3 Changed 5 years ago by richardpl

  • Component changed from undetermined to avfilter
  • Description modified (diff)
  • Reproduced by developer set
  • Status changed from new to open
  • Summary changed from Overlay filter with “shortest=1” drops last frame to Overlay filter with "shortest=1" drops last frame
  • Version changed from unspecified to git-master

ffmpeg -f lavfi -i color=black:hd720 -i in.png -lavfi overlay=shortest=1 out.png

comment:4 Changed 5 years ago by Cigaes

The following patch series: http://ffmpeg.org/pipermail/ffmpeg-devel/2013-August/147589.html, once finalized, should fix this problem, amongst other things.

comment:5 Changed 5 years ago by richardpl

'once finalized'

comment:6 Changed 5 years ago by richardpl

  • Resolution set to fixed
  • Status changed from open to closed

comment:7 Changed 5 years ago by hansmi

Confirmed, thanks!

Note: See TracTickets for help on using tickets.