Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3484 closed defect (needs_more_info)

FFmpeg timing control problem

Reported by: Spencerg Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: I want to control the display time of individual frames sufficient to allow me to mate with segments of an audio timed to hundredths of a second. Some frames seemed not to display at all. Some displayed far longer than others and for times that differed greatly from "duration" specified in a concat demuxer control file.

How to reproduce:
As soon as I can figure out how, I will submit "ffmpegFailsToControlFrameTimes.7z" containing 5 png files (tst0.png, ... tst4.png), a concat demuxer control file (concat3.txt), and the output produced by the version of FFmpeg I downloaded earlier today (tst2g.mp4).

The ffmpeg command and output appear below.

ffmpeg -y -f concat -i concat3.txt -pix_fmt yuv420p tst2g.mp4

ffmpeg version N-61620-ge555e1b Copyright (c) 2000-2014 the FFmpeg developers

built on Mar 19 2014 22:01:32 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av

isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable
-zlib

libavutil 52. 67.100 / 52. 67.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 34.101 / 55. 34.101
libavdevice 55. 11.100 / 55. 11.100
libavfilter 4. 3.100 / 4. 3.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100

Input #0, concat, from 'concat3.txt':

Duration: 00:00:12.00, start: 0.000000, bitrate: 0 kb/s

Stream #0:0: Video: png, pal8, 480x480, 25 tbr, 25 tbn, 25 tbc

[libx264 @ 042ae100] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 042ae100] profile High, level 3.0
[libx264 @ 042ae100] 264 - core 142 r2409 d6b4e63 - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deb
lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m
e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro
ma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenec
ut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=
0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'tst2g.mp4':

Metadata:

encoder : Lavf55.34.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 480x48

0, q=-1--1, 12800 tbn, 25 tbc
Stream mapping:

Stream #0:0 -> #0:0 (png -> libx264)

Press [q] to stop, ? for help
frame= 276 fps=0.0 q=-1.0 Lsize= 16kB time=00:00:10.96 bitrate= 12.3kbits
/s dup=271 drop=0
video:12kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 32.223
881%
[libx264 @ 042ae100] frame I:2 Avg QP:20.30 size: 2128
[libx264 @ 042ae100] frame P:70 Avg QP:10.40 size: 44
[libx264 @ 042ae100] frame B:204 Avg QP:12.67 size: 23
[libx264 @ 042ae100] consecutive B-frames: 1.4% 0.0% 0.0% 98.6%
[libx264 @ 042ae100] mb I I16..4: 21.0% 74.2% 4.8%
[libx264 @ 042ae100] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0%

0.0% 0.0% skip:99.9%

[libx264 @ 042ae100] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3% 0.0% 0.0%

direct: 0.0% skip:99.7% L0:69.7% L1:30.3% BI: 0.0%

[libx264 @ 042ae100] 8x8 transform intra:73.8% inter:0.0%
[libx264 @ 042ae100] coded y,uvDC,uvAC intra: 2.8% 2.7% 2.6% inter: 0.0% 0.0% 0.
0%
[libx264 @ 042ae100] i16 v,h,dc,p: 54% 31% 16% 0%
[libx264 @ 042ae100] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 78% 7% 16% 0% 0% 0% 0%

0% 0%

[libx264 @ 042ae100] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 51% 22% 16% 1% 1% 2% 2%

1% 2%

[libx264 @ 042ae100] i8c dc,h,v,p: 97% 1% 1% 0%
[libx264 @ 042ae100] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 042ae100] ref P L0: 74.0% 2.0% 24.0%
[libx264 @ 042ae100] ref B L0: 33.0% 67.0%
[libx264 @ 042ae100] kb/s:8.70

Attachments (1)

ffmpegFailsToControlFrameTimes.7z (22.2 KB) - added by Spencerg 5 years ago.
Problem controlling the duration of frames with a simple toy example

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by Spencerg

Problem controlling the duration of frames with a simple toy example

comment:1 Changed 5 years ago by cehoyos

Please test -vf fps=25

comment:2 Changed 5 years ago by cehoyos

  • Keywords concat time control removed
  • Resolution set to needs_more_info
  • Status changed from new to closed

Please reopen if you believe there is a bug in FFmpeg that can be fixed.

comment:3 Changed 5 years ago by fluff

This would seem more like a feature request. I think Blender's imprecise time control is at least worth a mention. Just my 2 cents.

comment:4 Changed 5 years ago by Cigaes

You need to use -vf fps to have proper rounding for the times.

Also you can not rely on the duration for the last frame of a file, you need to add a short (1/fps) last frame as a terminator.

Note: See TracTickets for help on using tickets.