[FFmpeg-trac] #8464(avformat:closed): `outpoint` directive of `concat` demuxer may be off by 1 frame

FFmpeg trac at avcodec.org
Mon Jan 13 06:37:50 EET 2020


#8464: `outpoint` directive of `concat` demuxer may be off by 1 frame
-------------------------------------+-------------------------------------
             Reporter:  gdgsdg123    |                    Owner:
                 Type:  enhancement  |                   Status:  closed
             Priority:  normal       |                Component:  avformat
              Version:  git-master   |               Resolution:
                                     |  worksforme
             Keywords:  concat       |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Changes (by gdgsdg123):

 * resolution:  invalid => worksforme


Comment:

 The [http://trac.ffmpeg.org/attachment/ticket/8464/merge.avi
 ""merge.avi""] also serves as a good example for testing the cutting
 accuracy.
 [[BR]]
 [[BR]]
 The file is entirely composed of "Black Screen" frames with only 3
 exceptions:
 ||= Frame Number =||= Presentation Timestamp =||= Duration =||= Content
 =||
 || 564|| 87.05|| 0.033333||  Yellow  ||
 || 595|| 88.083333|| 0.033334||  Green  ||
 || 596|| 88.116667|| N/A||  Red  ||
 Which resemble all 3 possible outcomes: on point, early, late.
 [[BR]]
 ----
 Another thing: possible 0 frame output (null segment) without warning...
 [[BR]]
 [[BR]]
 X.txt:
 {{{
 file 'merge.avi'
 inpoint 87.05
 outpoint 87.05
 }}}
 [[BR]]
 {{{
 ffmpeg -y -f concat -safe 0 -i "X.txt" -c copy "temp.avi"
 }}}
 {{{
 ffmpeg version git-2020-01-10-3d894db Copyright (c) 2000-2020 the FFmpeg
 developers
   built with gcc 9.2.1 (GCC) 20191125
   configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
 fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-
 libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
 --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
 --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
 libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
 --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
 --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc
 --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 --enable-amf
   libavutil      56. 38.100 / 56. 38.100
   libavcodec     58. 65.103 / 58. 65.103
   libavformat    58. 35.101 / 58. 35.101
   libavdevice    58.  9.103 / 58.  9.103
   libavfilter     7. 70.101 /  7. 70.101
   libswscale      5.  6.100 /  5.  6.100
   libswresample   3.  6.100 /  3.  6.100
   libpostproc    55.  6.100 / 55.  6.100
 Input #0, concat, from 'X.txt':
   Duration: 00:00:00.00, bitrate: N/A
     Stream #0:0: Video: h264 (High 4:4:4 Intra) (H264 / 0x34363248),
 gbrp(tv, gbr/unknown/unknown, progressive), 256x144, 60 fps, 30 tbr, 60
 tbn, 60 tbc
 Output #0, avi, to 'temp.avi':
   Metadata:
     ISFT            : Lavf58.35.101
     Stream #0:0: Video: h264 (High 4:4:4 Intra) (H264 / 0x34363248),
 gbrp(tv, gbr/unknown/unknown, progressive), 256x144, q=2-31, 60 fps, 30
 tbr, 60 tbn, 60 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 frame=    0 fps=0.0 q=-1.0 Lsize=       6kB time=00:00:00.00 bitrate=N/A
 speed=   0x
 video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 }}}
 [[BR]]
 [[BR]]
 {{{
 ffmpeg -ss 87.05 -to 87.05 -i "merge.avi" -an -c copy "to.avi"
 }}}
 {{{
 ffmpeg version git-2020-01-10-3d894db Copyright (c) 2000-2020 the FFmpeg
 developers
   built with gcc 9.2.1 (GCC) 20191125
   configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
 fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-
 libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
 --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
 --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
 libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
 --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
 --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc
 --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 --enable-amf
   libavutil      56. 38.100 / 56. 38.100
   libavcodec     58. 65.103 / 58. 65.103
   libavformat    58. 35.101 / 58. 35.101
   libavdevice    58.  9.103 / 58.  9.103
   libavfilter     7. 70.101 /  7. 70.101
   libswscale      5.  6.100 /  5.  6.100
   libswresample   3.  6.100 /  3.  6.100
   libpostproc    55.  6.100 / 55.  6.100
 -to value smaller than -ss; aborting.
 }}}
 [[BR]]
 [[BR]]
 The `inpoint`/`-ss`, `outpoint`/`-to` values must be carefully chosen.
 [[BR]]
 [[BR]]
 [[BR]]
 [[BR]]
 **Off-Topic**
 [[BR]]
 Is it yet possible to instruct FFmpeg to report the number of frames of
 each segment? (when using `concat` demuxer)

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8464#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list