[Fixed] crash when using libx264 in recent builds

Issues involving a Windows version of FFmpeg. Do not post general usage questions here.

Re: crash when using libx264 in recent builds

Postby Zeranoe » Tue Feb 26, 2013 1:02 am

jonforums wrote:
Zeranoe wrote:Interesting, I can confirm this error.

There might have been a toolchain update that broke something.

Can you confirm that it is the toolchain and not FFmpeg's code that is causing the issue?


I'm not familiar with the toolchain. What do I need to do to check whether root cause is the toolchain?


This is a -threads issue, something with pthread. I'm digging into it, but till the fix, add -threads 1 to the command and it should run.
User avatar
Zeranoe
Site Admin
 
Posts: 540
Joined: Sat May 07, 2011 7:12 pm

Re: crash when using libx264 in recent builds

Postby Zeranoe » Tue Feb 26, 2013 3:07 am

It looks like the newest build doesn't error out, but the old "hang" is back...

Roger, ideas?
User avatar
Zeranoe
Site Admin
 
Posts: 540
Joined: Sat May 07, 2011 7:12 pm

Re: crash when using libx264 in recent builds

Postby Zeranoe » Tue Feb 26, 2013 3:48 am

I didn't get much helpful info from GDB for debugging this.

FFmpeg will just hang forever when it tries to encode with x264 using threads.

Command that causes the endless hang is:
Code: Select all
ffmpeg_g.exe -v 9 -loglevel 99 -i input.mp4 -y -b:a 48k -b:v 200k -an -c:v libx264 -s hd480 output.mp4


Which returns:
Code: Select all
ffmpeg version N-50314-gf6fff8e Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 25 2013 22:13:46 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-libx264
  libavutil      52. 17.103 / 52. 17.103
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 41.100 /  3. 41.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'C:\Users\Kyle\Downloads\Music\Top_Best_Dubstep_August_2012.mp4'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '48k'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '200k'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument 'hd480'.
Reading option 'out.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument 9.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file input.mp4.
Successfully parsed a group of options.
Opening an input file: input.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 056ce920] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 056ce920] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 056ce920] File position before avformat_find_stream_info() is 340397
[mov,mp4,m4a,3gp,3g2,mj2 @ 056ce920] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 056ce920] File position after avformat_find_stream_info() is 706144
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2012-08-24 22:59:10
  Duration: 00:18:22.41, start: 0.000000, bitrate: 1704 kb/s
    Stream #0:0(und), 13, 1/50: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 1/50, 1509 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und), 1, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s
    Metadata:
      creation_time   : 2012-08-24 22:59:11
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Successfully opened the file.
Parsing a group of options: output file out.mp4.
Applying option b:a (video bitrate (please use -b:v)) with argument 48k.
Applying option b:v (video bitrate (please use -b:v)) with argument 200k.
Applying option an (disable audio) with argument 1.
Applying option c:v (codec name) with argument libx264.
Applying option s (set frame size (WxH or abbreviation)) with argument hd480.
Successfully parsed a group of options.
Opening an output file: out.mp4.
Successfully opened the file.
[buffer @ 0561a8e0] Setting entry with key 'video_size' to value '1920x1080'
[buffer @ 0561a8e0] Setting entry with key 'pix_fmt' to value '0'
[buffer @ 0561a8e0] Setting entry with key 'time_base' to value '1/50'
[buffer @ 0561a8e0] Setting entry with key 'pixel_aspect' to value '0/1'
[buffer @ 0561a8e0] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0561a8e0] Setting entry with key 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0561a7e0] w:1920 h:1080 pixfmt:yuv420p tb:1/50 fr:25/1 sar:0/1 sws_param:flags=2
[scale @ 05539e20] Setting 'w' to value '852'
[scale @ 05539e20] Setting 'h' to value '480'
[scale @ 05539e20] Setting 'flags' to value '0x4'
[scaler for output stream 0:0 @ 05539dc0] w:852 h:480 flags:'0x4' interl:0
[scaler for output stream 0:0 @ 05539dc0] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:852 h:480 fmt:yuv420p sar:0/1 flags:0x4
[libx264 @ 074940a0] using mv_range_thread = 24
[libx264 @ 074940a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 074940a0] profile High, level 3.0
[libx264 @ 074940a0] 264 - core 129 r2245 bc13772 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 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=abr mbtree=1 bitrate=200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[h264 @ 055478a0] detected 8 logical cores
Output #0, mp4, to 'out.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf54.63.100
    Stream #0:0(und), 0, 1/12800: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 852x480, 1/25, q=-1--1, 200 kb/s, 12800 tbn, 25 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
Press [q] to stop, [?] for help
[libx264 @ 074940a0] using mv_range_thread = 24
[libx264 @ 074940a0] frame=   0 QP=35.77 NAL=3 Slice:I Poc:0   I:1620 P:0    SKIP:0    size=13903 bytes
[libx264 @ 074940a0] frame=   1 QP=36.07 NAL=2 Slice:P Poc:2   I:0    P:145  SKIP:1475 size=283 bytes
[libx264 @ 074940a0] frame=   2 QP=34.32 NAL=2 Slice:P Poc:4   I:1    P:22   SKIP:1597 size=87 bytes
[libx264 @ 074940a0] frame=   3 QP=34.10 NAL=2 Slice:P Poc:12  I:1    P:55   SKIP:1564 size=162 bytes
[libx264 @ 074940a0] frame=   4 QP=42.00 NAL=2 Slice:B Poc:8   I:0    P:17   SKIP:1603 size=42 bytes
[libx264 @ 074940a0] frame=   5 QP=44.00 NAL=0 Slice:B Poc:6   I:0    P:3    SKIP:1617 size=24 bytes
[libx264 @ 074940a0] frame=   6 QP=44.00 NAL=0 Slice:B Poc:10  I:0    P:1    SKIP:1619 size=22 bytes
[libx264 @ 074940a0] frame=   7 QP=34.11 NAL=2 Slice:P Poc:14  I:0    P:20   SKIP:1600 size=87 bytes
[libx264 @ 074940a0] frame=   8 QP=33.68 NAL=2 Slice:P Poc:16  I:0    P:13   SKIP:1607 size=60 bytes
[libx264 @ 074940a0] frame=   9 QP=34.58 NAL=2 Slice:P Poc:24  I:3    P:12   SKIP:1605 size=83 bytes
[libx264 @ 074940a0] frame=  10 QP=42.00 NAL=2 Slice:B Poc:20  I:0    P:13   SKIP:1607 size=38 bytes
[libx264 @ 074940a0] frame=  11 QP=44.00 NAL=0 Slice:B Poc:18  I:0    P:2    SKIP:1618 size=23 bytes
[libx264 @ 074940a0] frame=  12 QP=44.00 NAL=0 Slice:B Poc:22  I:0    P:2    SKIP:1618 size=24 bytes
[libx264 @ 074940a0] frame=  13 QP=42.28 NAL=2 Slice:P Poc:32  I:0    P:1    SKIP:1619 size=33 bytes
[libx264 @ 074940a0] frame=  14 QP=46.00 NAL=2 Slice:B Poc:28  I:0    P:1    SKIP:1619 size=25 bytes
[libx264 @ 074940a0] frame=  15 QP=46.00 NAL=0 Slice:B Poc:26  I:0    P:0    SKIP:1620 size=22 bytes
[libx264 @ 074940a0] frame=  16 QP=50.00 NAL=0 Slice:B Poc:30  I:0    P:0    SKIP:1620 size=22 bytes
[libx264 @ 074940a0] frame=  17 QP=43.32 NAL=2 Slice:P Poc:34  I:0    P:1    SKIP:1619 size=32 bytes
[libx264 @ 074940a0] frame=  18 QP=41.57 NAL=2 Slice:P Poc:36  I:0    P:3    SKIP:1617 size=37 bytes
[libx264 @ 074940a0] frame=  19 QP=39.54 NAL=2 Slice:P Poc:38  I:2    P:71   SKIP:1547 size=115 bytes
[libx264 @ 074940a0] frame=  20 QP=39.03 NAL=2 Slice:P Poc:40  I:3    P:29   SKIP:1588 size=151 bytes
[libx264 @ 074940a0] frame=  21 QP=37.57 NAL=2 Slice:P Poc:42  I:6    P:19   SKIP:1595 size=151 bytes
[libx264 @ 074940a0] frame=  22 QP=36.83 NAL=2 Slice:P Poc:44  I:0    P:23   SKIP:1597 size=117 bytes
[libx264 @ 074940a0] frame=  23 QP=37.27 NAL=2 Slice:P Poc:46  I:1    P:41   SKIP:1578 size=199 bytes
[libx264 @ 074940a0] frame=  24 QP=35.47 NAL=2 Slice:P Poc:48  I:1    P:29   SKIP:1590 size=163 bytes
[libx264 @ 074940a0] frame=  25 QP=36.61 NAL=2 Slice:P Poc:50  I:1    P:50   SKIP:1569 size=234 bytes
[libx264 @ 074940a0] frame=  26 QP=37.38 NAL=2 Slice:P Poc:52  I:1    P:52   SKIP:1567 size=280 bytes
[libx264 @ 074940a0] frame=  27 QP=33.82 NAL=2 Slice:P Poc:54  I:2    P:95   SKIP:1523 size=449 bytes
[libx264 @ 074940a0] frame=  28 QP=33.23 NAL=2 Slice:P Poc:56  I:8    P:207  SKIP:1405 size=708 bytes
[libx264 @ 074940a0] frame=  29 QP=32.34 NAL=2 Slice:P Poc:64  I:9    P:190  SKIP:1421 size=1115 bytes
frame=   86 fps=0.0 q=38.0 size=      19kB time=00:00:01.12 bitrate= 138.9kbits/s   
frame=  30 QP=41.00 NAL=2 Slice:B Poc:60  I:0    P:142  SKIP:1478 size=110 bytes
[libx264 @ 074940a0] frame=  31 QP=42.00 NAL=0 Slice:B Poc:58  I:0    P:95   SKIP:1525 size=99 bytes
[libx264 @ 074940a0] frame=  32 QP=42.00 NAL=0 Slice:B Poc:62  I:0    P:5    SKIP:1615 size=25 bytes
[libx264 @ 074940a0] frame=  33 QP=31.32 NAL=2 Slice:P Poc:66  I:26   P:723  SKIP:871  size=4287 bytes
[libx264 @ 074940a0] frame=  34 QP=30.82 NAL=2 Slice:P Poc:68  I:15   P:407  SKIP:1198 size=2222 bytes
[libx264 @ 074940a0] frame=  35 QP=30.43 NAL=2 Slice:P Poc:70  I:16   P:286  SKIP:1318 size=1691 bytes
[libx264 @ 074940a0] frame=  36 QP=30.36 NAL=2 Slice:P Poc:72  I:4    P:289  SKIP:1327 size=1645 bytes
[libx264 @ 074940a0] frame=  37 QP=29.55 NAL=2 Slice:P Poc:74  I:10   P:285  SKIP:1325 size=1765 bytes
[libx264 @ 074940a0] frame=  38 QP=29.50 NAL=2 Slice:P Poc:76  I:10   P:245  SKIP:1365 size=1517 bytes
[libx264 @ 074940a0] frame=  39 QP=29.44 NAL=2 Slice:P Poc:78  I:5    P:228  SKIP:1387 size=1279 bytes
[libx264 @ 074940a0] frame=  40 QP=27.80 NAL=2 Slice:P Poc:80  I:6    P:137  SKIP:1477 size=739 bytes
[libx264 @ 074940a0] frame=  41 QP=28.18 NAL=2 Slice:P Poc:82  I:2    P:93   SKIP:1525 size=560 bytes
Statistics: 1569835 bytes read, 2 seeks
Received signal 2: terminating.


For anyone interested in debugging with GDB they can use: gdb.exe and ffmpeg_g.exe.

Both of the linked gdb.exe and ffmpeg_g.exe are win32 (32-bit).
User avatar
Zeranoe
Site Admin
 
Posts: 540
Joined: Sat May 07, 2011 7:12 pm

Re: crash when using libx264 in recent builds

Postby rogerdpack » Tue Feb 26, 2013 7:16 pm

Zeranoe wrote: built on Feb 25 2013 22:13:46 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-libx264


which pthreads library are you using? has the version of libx264 (or toolchain version) changed around that point (or recently at all?).

FWIW I'm not able to reproduce a hang or crash with my own recent builds (ex: http://rdp.inet2.org/incoming/ffmpeg_di ... pthread.7z from the 20th) but do see the hang at least with recent zeranoe builds ...
rogerdpack
 
Posts: 1454
Joined: Fri Aug 05, 2011 9:56 pm

Re: crash when using libx264 in recent builds

Postby rogerdpack » Tue Feb 26, 2013 7:45 pm

mongoosesRawesome wrote:They also don't seem to respond to different presets. [/code]


You can list available presets with a full command line but use "-preset help" instead...
rogerdpack
 
Posts: 1454
Joined: Fri Aug 05, 2011 9:56 pm

Re: crash when using libx264 in recent builds

Postby Zeranoe » Tue Feb 26, 2013 8:45 pm

I'm using Pthreads-win32, and I just recently updated the toolchain+the Pthreads-win32 version.

I wish I knew how to track this issue down.
User avatar
Zeranoe
Site Admin
 
Posts: 540
Joined: Sat May 07, 2011 7:12 pm

Re: crash when using libx264 in recent builds

Postby rogerdpack » Tue Feb 26, 2013 9:41 pm

Zeranoe wrote:I'm using Pthreads-win32, and I just recently updated the toolchain+the Pthreads-win32 version.

I wish I knew how to track this issue down.


Which version of pthreads-win32 are you using? (I would definitely double check to make sure you're using it, not winpthreads, this definitely acts like the old old behavior when using winpthreads...). You may want add some extra printf's to the pthreads-win32 code (and relink x264 and ffmpeg after rebuilding it, of course), just so that you can see the output when you run ffmpeg to certify that's what you're using...
-roger-
rogerdpack
 
Posts: 1454
Joined: Fri Aug 05, 2011 9:56 pm

Re: crash when using libx264 in recent builds

Postby Zeranoe » Wed Feb 27, 2013 5:20 am

Fixed, was a library mix up issue. Download the latest and test.
User avatar
Zeranoe
Site Admin
 
Posts: 540
Joined: Sat May 07, 2011 7:12 pm

Re: crash when using libx264 in recent builds

Postby mongoosesRawesome » Wed Feb 27, 2013 5:29 am

Confirmed working. Thanks!
mongoosesRawesome
 
Posts: 5
Joined: Fri Feb 22, 2013 12:17 am

Re: [Fixed] crash when using libx264 in recent builds

Postby Artofit » Thu Feb 28, 2013 11:33 am

Fix works. Thanks
Artofit
 
Posts: 16
Joined: Thu Jul 12, 2012 10:54 pm

Previous

Return to Usage Issues

Who is online

Users browsing this forum: No registered users and 2 guests