[FFmpeg-trac] #9210(undetermined:new): Concat images produces wrong timings when duration is in milliseconds

FFmpeg trac at avcodec.org
Thu Apr 29 15:25:00 EEST 2021


#9210: Concat images produces wrong timings when duration is in milliseconds
-------------------------------------+-------------------------------------
             Reporter:  demet64      |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Description changed by demet64:

Old description:

> This issue was also mentioned here:
> https://www.reddit.com/r/ffmpeg/comments/e1o3hv/ffconcat_filter_with_millisecond_precision_how/
> and here: https://forum.videohelp.com/threads/397470-Converting-a
> -sequence-of-images-to-video-with-variable-framerate
>

> Summary of the bug:
> How to reproduce:
> {{{
> % ffmpeg -i input ... output
> ffmpeg version
> built on ...
> }}}
> Patches should be submitted to the ffmpeg-devel mailing list and not this
> bug tracker.

New description:

 This issue was also mentioned here:
 https://www.reddit.com/r/ffmpeg/comments/e1o3hv/ffconcat_filter_with_millisecond_precision_how/
 and here: https://forum.videohelp.com/threads/397470-Converting-a
 -sequence-of-images-to-video-with-variable-framerate


 Summary of the bug:
 How to reproduce:
 A concat file like this
 {{{
 file 000000.jpg
 duration 116ms
 file 000001.jpg
 duration 116ms
 file 000002.jpg
 duration 116ms
 file 000003.jpg
 duration 116ms
 file 000004.jpg
 duration 116ms
 file 000005.jpg
 duration 116ms
 file 000006.jpg
 duration 116ms
 file 000007.jpg
 duration 116ms
 file 000008.jpg
 duration 116ms
 file 000009.jpg
 duration 1002ms
 file 000010.jpg
 duration 116ms
 file 000011.jpg
 duration 116ms
 file 000012.jpg
 duration 116ms
 file 000013.jpg
 duration 1129ms
 file 000014.jpg
 duration 73ms
 file 000015.jpg
 duration 73ms
 file 000016.jpg
 duration 116ms
 file 000017.jpg
 duration 116ms
 file 000018.jpg
 duration 2184ms
 file 000018.jpg
 }}}

 The output:
 {{{
 ffprobe -f concat -i concat.txt -show_frames | findstr "pkt_pts"
 pkt_pts=0
 pkt_pts_time=0.000000
 pkt_pts=3
 pkt_pts_time=0.120000
 pkt_pts=6
 pkt_pts_time=0.240000
 pkt_pts=9
 pkt_pts_time=0.360000
 pkt_pts=12
 pkt_pts_time=0.480000
 pkt_pts=15
 pkt_pts_time=0.600000
 pkt_pts=17
 pkt_pts_time=0.680000
 pkt_pts=20
 pkt_pts_time=0.800000
 pkt_pts=23
 pkt_pts_time=0.920000
 pkt_pts=26
 pkt_pts_time=1.040000
 pkt_pts=51
 pkt_pts_time=2.040000
 pkt_pts=54
 pkt_pts_time=2.160000
 pkt_pts=57
 pkt_pts_time=2.280000
 pkt_pts=60
 pkt_pts_time=2.400000
 pkt_pts=88
 pkt_pts_time=3.520000
 pkt_pts=90
 pkt_pts_time=3.600000
 pkt_pts=92
 pkt_pts_time=3.680000
 pkt_pts=95
 pkt_pts_time=3.800000
 pkt_pts=98
 pkt_pts_time=3.920000
 pkt_pts=152
 pkt_pts_time=6.080000
 }}}

 The output looks correct at first, but timestamps are rounded, and for
 some reasons the duration here
 {{{
 pkt_pts_time=0.600000
 pkt_pts=17
 pkt_pts_time=0.680000
 }}}
 is 80ms instead of 120ms (and expected 116ms)

 It's not the problem of ffprobe, when converting to webm, for example, or
 gif
 {{{
 ffmpeg -i concat.txt -c:v libvpx-vp9 -lossless 1 out.webm
 }}}
 timings would be like showed above.

 The other case:
 {{{
 file 000000.jpg
 duration 50ms
 file 000001.jpg
 duration 60ms
 file 000002.jpg
 duration 50ms
 file 000003.jpg
 duration 60ms
 file 000004.jpg
 duration 50ms
 file 000005.jpg
 duration 60ms
 file 000006.jpg
 duration 50ms
 file 000007.jpg
 duration 60ms
 file 000008.jpg
 duration 60ms
 file 000009.jpg
 duration 50ms
 file 000010.jpg
 duration 60ms
 file 000011.jpg
 duration 50ms
 file 000012.jpg
 duration 60ms
 file 000013.jpg
 duration 50ms
 file 000014.jpg
 duration 60ms
 file 000015.jpg
 duration 50ms
 file 000016.jpg
 duration 60ms
 file 000017.jpg
 duration 60ms
 file 000018.jpg
 duration 50ms
 file 000019.jpg
 duration 60ms
 file 000020.jpg
 duration 50ms
 file 000021.jpg
 duration 60ms
 file 000022.jpg
 duration 50ms
 file 000023.jpg
 duration 60ms
 file 000023.jpg
 }}}

 Output:
 {{{
 pkt_pts=0
 pkt_pts_time=0.000000
 pkt_pts=1
 pkt_pts_time=0.040000
 pkt_pts=3
 pkt_pts_time=0.120000
 pkt_pts=4
 pkt_pts_time=0.160000
 pkt_pts=6
 pkt_pts_time=0.240000
 pkt_pts=7
 pkt_pts_time=0.280000
 pkt_pts=8
 pkt_pts_time=0.320000
 pkt_pts=10
 pkt_pts_time=0.400000
 pkt_pts=11
 pkt_pts_time=0.440000
 pkt_pts=13
 pkt_pts_time=0.520000
 pkt_pts=14
 pkt_pts_time=0.560000
 pkt_pts=15
 pkt_pts_time=0.600000
 pkt_pts=17
 pkt_pts_time=0.680000
 pkt_pts=18
 pkt_pts_time=0.720000
 pkt_pts=19
 pkt_pts_time=0.760000
 pkt_pts=21
 pkt_pts_time=0.840000
 pkt_pts=22
 pkt_pts_time=0.880000
 pkt_pts=24
 pkt_pts_time=0.960000
 pkt_pts=25
 pkt_pts_time=1.000000
 pkt_pts=26
 pkt_pts_time=1.040000
 pkt_pts=28
 pkt_pts_time=1.120000
 pkt_pts=29
 pkt_pts_time=1.160000
 pkt_pts=31
 pkt_pts_time=1.240000
 pkt_pts=32
 pkt_pts_time=1.280000
 pkt_pts=33
 pkt_pts_time=1.320000
 }}}

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


More information about the FFmpeg-trac mailing list