[FFmpeg-user] Zeranoe Windows builds spiking CPU to 100% randomly

Roger Pack rogerdpack2 at gmail.com
Fri Jul 13 20:33:39 CEST 2012


> It's much easier to see the spikes with -pass 1 though.
>
> ffmpeg -i 7416_20120706235700.mpg -pass 1 -c:v libx264 nul.mp4

Ok I'm able to see it with 32-bit ffmpeg (running on 64 bit windows 7,
with either an Athlon X2 or an i7).
Every so often the console output "hangs" (mine uses basically 100%
cpu the whole time, I don't see any spikes).

Using this file: http://rogerdpack.t28.net/incoming/sintel.mpg

zeranoe build ffmpeg-20120706-git-8293a21-win32-shared:
...
(ran ffmpeg -y -i sintel.mpg -pass 1 -t 75 -c:v libx264 -an nul.mp4 [1])

took 32.0s (showed console pause at frame 1145)
took 35.8 (showed console pauses at frames 641, 1079)
took 25.27s (showed no console pauses--it got lucky!)

other build (http://x32.elijst.nl/FFmpeg-20120622.7z
[20120622-N-41843-gc17808c-mod Jul 11 2012]):

(ran \Downloads\FFmpeg-20120622\ffmpeg.exe -y -i sintel.mpg -pass 1 -t
75 -c:v libx264 -an nul.new.mp4 [2])
took 25.6s
took 26.6s
took 24.5s
(never shows console pauses)

They make "presumably" the same file:
  3780 -rw-r--r--    1 packrd   Administ  7739909 Jul 13 12:30 original.mp4
  3779 -rw-r--r--    1 packrd   Administ  7739232 Jul 13 12:32 w32threads.mp4

I don't see pauses with other codecs like mpeg4 or mpeg2video codecs, just x264.

> Can't easily see a 64-bit gdb, yes, I can build a 32 bit version and see
> if the same problem occurs, but it does point to a race condition in the
> wingw implementation of pthreads at the moment.

Do these work?
http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20(Win64%20hosted)/gdb

Cheers!
-roger-

uncut output:
[1]
c:\installs\ffmpeg-20120706-git-8293a21-win32-shared\bin\ffmpeg.exe -y
-i sintel.mpg -pass 1 -t 75 -c:v libx264 -an original.mp4
ffmpeg version N-42288-g8293a21 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul  5 2012 20:58:08 with gcc 4.7.1
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3 --disable-w32threads --enable-runtime-cpudetect
--enable-avisynth --enable-bzlib --enable-frei0r --enable-libass
--enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libnut --enable-libopenjpeg --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs
--enable-libxvid --enable-zlib
  libavutil      51. 64.100 / 51. 64.100
  libavcodec     54. 33.100 / 54. 33.100
  libavformat    54. 15.100 / 54. 15.100
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  0.101 /  3.  0.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg2video @ 01e759e0] ac-tex damaged at 40 7
[mpeg2video @ 01e759e0] Warning MVs not available
[mpeg2video @ 01e759e0] concealing 1035 DC, 1035 AC, 1035 MV errors
[mpeg @ 01e63240] max_analyze_duration 5000000 reached at 5024000
Input #0, mpeg, from 'sintel.mpg':
  Duration: 00:14:47.58, start: 0.233367, bitrate: 4132 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480
[SAR 32:27 DAR 16:9], 7000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94
tbc
    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s
[graph 0 input from stream 0:0 @ 01f4eb40] w:720 h:480 pixfmt:yuv420p
tb:1/90000 fr:30000/1001 sar:32/27 sws_param:flags=2
[output stream 0:0 @ 01f4ee40] No opaque field provided
[libx264 @ 01e764a0] using SAR=32/27
[libx264 @ 01e764a0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
[libx264 @ 01e764a0] profile Main, level 3.0
[libx264 @ 01e764a0] 264 - core 125 r2200 999b753 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html -
options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=2
psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0
8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0
threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1
interlaced=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 scenecut=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 'original.mp4':
  Metadata:
    encoder         : Lavf54.15.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p,
720x480 [SAR 32:27 DAR 16:9], q=-1--1, pass 1, 30k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Press [q] to stop, [?] for help
[mpeg2video @ 01e759e0] ac-tex damaged at 40 7
[mpeg2video @ 01e759e0] Warning MVs not available
[mpeg2video @ 01e759e0] concealing 1035 DC, 1035 AC, 1035 MV errors
frame= 2248 fps= 53 q=29.0 Lsize=    7559kB time=00:01:14.94 bitrate=
826.2kbits/s dup=202 drop=0
video:7537kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.290262%
[libx264 @ 01e764a0] frame I:44    Avg QP:20.21  size: 12565
[libx264 @ 01e764a0] frame P:1323  Avg QP:25.44  size:  4719
[libx264 @ 01e764a0] frame B:881   Avg QP:27.98  size:  1045
[libx264 @ 01e764a0] consecutive B-frames: 38.7% 23.2% 11.7% 26.3%
[libx264 @ 01e764a0] mb I  I16..4: 61.4%  0.0% 38.6%
[libx264 @ 01e764a0] mb P  I16..4: 22.7%  0.0%  0.0%  P16..4: 29.2%
0.0%  0.0%  0.0%  0.0%    skip:48.2%
[libx264 @ 01e764a0] mb B  I16..4:  1.1%  0.0%  0.0%  B16..8: 13.1%
0.0%  0.0%  direct: 3.3%  skip:82.5%  L0:35.7% L1:49.5% BI:14.8%
[libx264 @ 01e764a0] coded y,uvDC,uvAC intra: 28.5% 17.5% 1.8% inter:
8.3% 2.5% 0.0%
[libx264 @ 01e764a0] i16 v,h,dc,p: 29% 37% 21% 13%
[libx264 @ 01e764a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 53% 18%  2%
3%  2%  2%  2%  2%
[libx264 @ 01e764a0] i8c dc,h,v,p: 68% 18% 13%  1%
[libx264 @ 01e764a0] Weighted P-Frames: Y:2.3% UV:0.1%
[libx264 @ 01e764a0] kb/s:823.03
took 42.473796s (ran ffmpeg -y -i sintel.mpg -pass 1 -t 75 -c:v
libx264 -an original.mp4)

[2]

timerr \Downloads\FFmpeg-20120622\ffmpeg.exe -y -i sintel.mpg -pass 1
-t 75 -c:v libx264 -an nul.new.mp4
\Downloads\FFmpeg-20120622\ffmpeg.exe -y -i sintel.mpg -pass 1 -t 75
-c:v libx264 -an nul.new.mp4
ffmpeg version 20120622-N-41843-gc17808c-mod Copyright (c) 2000-2012
the FFmpeg developers
  built on Jul 11 2012 02:56:33 with gcc 4.5.2
  configuration: --extra-cflags=-m32 --extra-ldflags='-m32
-L/usr/local/i686-pc-mingw32/lib' --prefix=/usr/local/i686-pc-mingw32
--enable-static --disable-shared --enable-nonfree --enable-libfaac
--enable-gpl --enable-libmp3lame --enable-libx264
  libavutil      51. 61.100 / 51. 61.100
  libavcodec     54. 29.100 / 54. 29.100
  libavformat    54. 11.100 / 54. 11.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 82.100 /  2. 82.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg2video @ 0174C900] ac-tex damaged at 40 7
[mpeg2video @ 0174C900] Warning MVs not available
[mpeg2video @ 0174C900] concealing 1035 DC, 1035 AC, 1035 MV errors
[mpeg @ 0174C400] max_analyze_duration 5000000 reached at 5024000
Input #0, mpeg, from 'sintel.mpg':
  Duration: 00:14:47.58, start: 0.233367, bitrate: 4132 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480
[SAR 32:27 DAR 16:9], 7000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94
tbc
    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s
[buffer @ 03387FE0] w:720 h:480 pixfmt:yuv420p tb:1/90000
fr:30000/1001 sar:32/27 sws_param:flags=2
[ffmpeg_buffersink @ 03398160] No opaque field provided
[libx264 @ 0340E6A0] using SAR=32/27
[libx264 @ 0340E6A0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
[libx264 @ 0340E6A0] profile Main, level 3.0
[libx264 @ 0340E6A0] 264 - core 125 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2012 - http://www.videolan.org/x264.html - options:
cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=2 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0
8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0
threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1
interlaced=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 scenecut=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 'nul.new.mp4':
  Metadata:
    encoder         : Lavf54.11.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p,
720x480 [SAR 32:27 DAR 16:9], q=-1--1, pass 1, 30k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Press [q] to stop, [?] for help
[mpeg2video @ 0174C900] ac-tex damaged at 40 7
[mpeg2video @ 0174C900] Warning MVs not available
[mpeg2video @ 0174C900] concealing 1035 DC, 1035 AC, 1035 MV errors
frame= 2248 fps= 93 q=29.0 Lsize=       0kB time=00:01:14.94 bitrate=
 0.0kbits/s dup=202 drop=0
video:7536kB audio:0kB subtitle:0 global headers:0kB muxing overhead
-100.000000%
[libx264 @ 0340E6A0] frame I:44    Avg QP:20.21  size: 12565
[libx264 @ 0340E6A0] frame P:1323  Avg QP:25.41  size:  4719
[libx264 @ 0340E6A0] frame B:881   Avg QP:27.98  size:  1045
[libx264 @ 0340E6A0] consecutive B-frames: 38.7% 23.2% 11.7% 26.3%
[libx264 @ 0340E6A0] mb I  I16..4: 61.4%  0.0% 38.6%
[libx264 @ 0340E6A0] mb P  I16..4: 22.7%  0.0%  0.0%  P16..4: 29.2%
0.0%  0.0%  0.0%  0.0%    skip:48.2%
[libx264 @ 0340E6A0] mb B  I16..4:  1.1%  0.0%  0.0%  B16..8: 13.1%
0.0%  0.0%  direct: 3.3%  skip:82.5%  L0:35.6% L1:49.6% BI:14.8%
[libx264 @ 0340E6A0] coded y,uvDC,uvAC intra: 28.5% 17.5% 1.8% inter:
8.3% 2.5% 0.0%
[libx264 @ 0340E6A0] i16 v,h,dc,p: 29% 37% 21% 13%
[libx264 @ 0340E6A0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 53% 18%  2%
3%  2%  2%  2%  2%
[libx264 @ 0340E6A0] i8c dc,h,v,p: 68% 18% 13%  1%
[libx264 @ 0340E6A0] Weighted P-Frames: Y:2.3% UV:0.1%
[libx264 @ 0340E6A0] kb/s:823.01
took 24.345798s (ran \Downloads\FFmpeg-20120622\ffmpeg.exe -y -i
sintel.mpg -pass 1 -t 75 -c:v libx264 -an nul.new.mp4)


More information about the ffmpeg-user mailing list