0

I'm working on an application which uses libx264. When doing 2-pass encodes, if the mbtree option is enabled, the 1st pass doesn't seem to put anything into the stats files:

    x264_1345845358591.L.mbtree.temp (size of 0)
    x264_1345845358591.L.temp

    $ cat x264_1345845358591.L.temp 
    #options: 288x162 fps=2997/100 timebase=100/2997 bitdepth=8 cabac=0 ref=3 
    deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 
    mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 
    fast_pskip=1 chroma_qp_offset=-2 threads=48 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=40 intra_refresh=0 rc_lookahead=40 
    rc=abr mbtree=1 bitrate=210 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 
    ip_ratio=1.40 aq=1:1.00**

When I do x264_encoder_open() for the 2nd pass, I get the failure message:

    x264 [error]: ratecontrol_init: can't open stats file
    x264 [error]: x264_encoder_open failed

So it seems to be failing in the first pass. 2pass works fine if I turn off mbtree. I can run it with presets or tune parameters as long as mbtree is turned off. What parameter (see above list) might make mbtree fail in the first pass?

lightdee
  • 487
  • 4
  • 11
  • Shoudn't you explicitly mention 1st pass somewhere? – av501 Aug 26 '12 at 18:54
  • I'm using libx264 library calls, not the command line x264. Inside the application it fails when trying to call x264_encoder_open() on the 2nd pass. – lightdee Aug 27 '12 at 16:07
  • 1
    Yes, still to get two pass encoding you have to pass variables which say pass 1 and pass 2 to the encoder. Else how will the encoder know that it is to do only single pass encoding or multipass encoding? I suspect that because if you don't give pass argument it does single pass encoding and no stats file is generated. So that pass variable will be sent to the encoder in some form. – av501 Aug 27 '12 at 19:30

0 Answers0