[FFmpeg-user] how to calibrate slow motion & timecode elapse ?

Sub Phil phil4000n at gmail.com
Sat Dec 27 16:13:45 CET 2014


Hi,

I want to scientifically measure some experiments, therefore I first need
duration (timecode) calibration.

However, I observe inconsistencies, may be due to my wrong use of ffmpeg,
can you help.

Test process:
1/ I recorded a chronometer lapse of about 25s on my smartphone with a
camera.

2/ Then I want to use ffmpeg to slow down the recorded video by a factor 10
and burn the associated timecode (cli at end of msg).

3/ I visually compare the burnt timecode with the one recorded.
I notice, that the time discrepency between the burnt timecode and the
recorded one varies according to start, middle and end of the video.

To better show it, attached pictures extracted with:
ffmpeg -ss 240 -t 0.05 -i timeCslow.mp4 -q:v 1 ss240_img%d.png
and
ffmpeg -ss 60 -t 0.05 -i timeCslow.mp4 -q:v 1 ss60_img%d.png
Oddly, the difference between the last 2 snapshots are 30sec!!


What's wrong?

Thanks.

P.S. Link to video and output
https://drive.google.com/file/d/0B752iWgZhOl6Q0VBNU1zT2hPeFU/view?usp=sharing
https://drive.google.com/file/d/0B752iWgZhOl6Mk1lNm4wT3M0OEE/view?usp=sharing
https://drive.google.com/file/d/0B752iWgZhOl6eDZBYnZ1SE9BTzQ/view?usp=sharing
https://drive.google.com/file/d/0B752iWgZhOl6Y1RFUzZtY1IwMkE/view?usp=sharing
https://drive.google.com/file/d/0B752iWgZhOl6QzgxTXYtWFY5NzA/view?usp=sharing


REF: http://ffmpeg.org/ffmpeg-filters.html#setpts_002c-asetpts

ffmpeg -ss 3.9 -i timeC2.mp4 -c:v libx264 -vf
"crop=in_w-16*20:in_h-7*20:8*20:4*20,setpts=10*PTS,
drawtext=fontfile='C\:\\Windows\\Fonts\\arial.ttf':timecode='00\:00\:00\:00':r=29.97:x=(w-tw)/2:y=h-(2*lh):fontsize=128:fontcolor=red:box=1:boxcolor=blue at 0.5"
-preset ultrafast -crf 30 -an timeCslow.mp4


F:\>ffmpeg -ss 3.9  -i timeC2.mp4 -c:v libx264 -vf
"crop=in_w-16*20:in_h-7*20:8*20:4*20,setpts=10*PTS,
drawtext=fontfile='C\:\\Windows\\Fonts\\arial.ttf':timecode='00\:00\:00\:00':r=29.97:x=(w-tw)/2:y=h-(2*lh):fontsize=128:fontcolor=red:box=1:boxcolor=blue
@0.5" -preset ultrafast -crf 30 -an timeCslow.mp4
ffmpeg version N-68694-g7c210c4 Copyright (c) 2000-2014 the FFmpeg
developers
  built on Dec 25 2014 22:13:21 with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libfreety
pe --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --enable-libsoxr --enable-libs
peex --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs --enable-libxvid --enab
le-decklink --enable-zlib
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 16.100 / 56. 16.100
  libavformat    56. 16.102 / 56. 16.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  5.101 /  5.  5.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'timeC2.mp4':
  Metadata:
    major_brand     : MSNV
    minor_version   : 19595353
    compatible_brands: MSNVmp42isom
    creation_time   : 2014-11-26 13:44:44
  Duration: 00:00:29.03, start: 0.000000, bitrate: 8866 kb/s
    Stream #0:0(und): Video: mpeg4 (Advanced Coding Profile) (mp4v /
0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 8799 kb/s, 29.97 fps,
29.97 tbr, 30k tbn, 30k tbc (default)
    Metadata:
      creation_time   : 2014-11-26 13:44:44
      handler_name    : Video Media Handler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 24000 Hz, mono,
fltp, 64 kb/s (default)
    Metadata:
      creation_time   : 2014-11-26 13:44:44
      handler_name    : Sound Media Handler
[libx264 @ 000000000581f200] using SAR=1/1
[libx264 @ 000000000581f200] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 000000000581f200] profile Constrained Baseline, level 3.1
[libx264 @ 000000000581f200] 264 - core 144 r2525 40bb568 - H.264/MPEG-4
AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html -
options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chr
oma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1
chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0
decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0
weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_r
efresh=0 rc=crf mbtree=0 crf=30.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
ip_ratio=1.40 aq=0
Output #0, mp4, to 'timeCslow.mp4':
  Metadata:
    major_brand     : MSNV
    minor_version   : 19595353
    compatible_brands: MSNVmp42isom
    encoder         : Lavf56.16.102
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021),
yuv420p, 960x580 [SAR 1:1 DAR 48:29], q=-1--1, 29.97 fps, 30k tbn, 29.97
tbc (default)
    Metadata:
      creation_time   : 2014-11-26 13:44:44
      handler_name    : Video Media Handler
      encoder         : Lavc56.16.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 7522 fps=519 q=-1.0 Lsize=   33682kB time=00:04:10.98
bitrate=1099.4kbits/s dup=6769 drop=0
video:33651kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.091521%
[libx264 @ 000000000581f200] frame I:31    Avg QP:20.16  size: 67376
[libx264 @ 000000000581f200] frame P:7491  Avg QP:23.00  size:  4321
[libx264 @ 000000000581f200] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 000000000581f200] mb P  I16..4:  2.3%  0.0%  0.0%  P16..4: 30.5%
 0.0%  0.0%  0.0%  0.0%    skip:67.2%
[libx264 @ 000000000581f200] coded y,uvDC,uvAC intra: 26.5% 56.8% 22.4%
inter: 10.1% 12.1% 2.2%
[libx264 @ 000000000581f200] i16 v,h,dc,p: 19% 53% 18% 10%
[libx264 @ 000000000581f200] i8c dc,h,v,p: 35% 41% 18%  6%
[libx264 @ 000000000581f200] kb/s:1098.34

F:\>


More information about the ffmpeg-user mailing list