Newest 'libx264' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/libx264

Les articles publiés sur le site

  • libx264 2 pass encoding with mbtree option, first pass fails

    25 août 2012, par lightdee

    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?

  • no c compiler found libx264 build [closed]

    24 août 2012, par kerim yucel

    I have been trying to build ffmpeg for Android and I have managed to do so by using roman10's tutorial.

    However, I needed x264 and I enabled libx264 in the configurations but it wasn't able to find the library. A quick internet search led me to the answer that I have to build x264 seperately and include it to ffmpeg config by editing ExternalLibs flags.

    Currently I am using this script to build x264. Everything is fine except the fact that the error saying "No working C compiler is found" pops up. I have updated and installed build-essential and my gcc version is up to date.

    Any help will be appreciated. Thanks a lot.

    P.S. I am using ndk 4 just to make everything compatible with the tutorial link given above. I am running Ubuntu with VirtualBox from Windows 7.

    Edit: I have been trying this tutorial as well, I am getting the same error along with unknown options error for each configuration options.

    Another edit: I have tried this code and obtained the following.

    echo 'int main() { return 0;}' > main.c && arm-eabi-gcc main.c || echo $?

    /home/mehmet/Android_NDK_r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: crt0.o: No such file: No such file or directory collect2: ld returned 1 exit status 1

    I have checked the flags as well, flags seem ok or I can't see the faulty line. Above you may find the build script I am using.

    export ARM_ROOT=/home/mehmet/Android_NDK_r4
    export ARM_INC=$ARM_ROOT/build/platforms/android-8/arch-arm/usr/include/
    export ARM_LIB=$ARM_ROOT/build/platforms/android-8/arch-arm/usr/lib/
    export ARM_TOOL=$ARM_ROOT/build/prebuilt/linux-x86/arm-eabi-4.4.0
    export ARM_LIBO=$ARM_TOOL/lib/gcc/arm-eabi/4.4.0
    export PATH=$ARM_TOOL/bin:$PATH
    export PATH=$ARM_TOOL/arm-eabi/bin:$PATH
    export ARM_PRE=arm-eabi 
    ./configure --prefix=/sdcard/arm_and \
    --disable-gpac \
    --extra-cflags=" -I$ARM_INC -fPIC -DANDROID -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-prote
    ctor -fno-short-enums -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtu
    ne=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -
    MMD -MP " \
    --extra-ldflags=" -nostdlib -Bdynamic -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,nocopyreloc -Wl,-soname,/system
    /lib/libz.so -Wl,-rpath-link=$ARM_LIB,-dynamic-linker=/system/bin/linker -L$ARM_LIB -nostdlib $ARM_LIB/crtbegin_dynamic.o $ARM_LIB/crtend_android.o -lc -lm -ldl -lgcc " \
    --cross-prefix=${ARM_PRE}- \
    --disable-asm\
    --host=arm-linux \
    

    Third edit:

    Config.log gives the following.

    x264 configure script
    Command line options: "--prefix=/sdcard/arm_and" "--disable-gpac" "--extra-cflags=" "-I/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/include/" "-fPIC" "-DANDROID" "-fpic" "-mthumb-interwork" "-ffunction-sections" "-funwind-tables" "-fstack-prote" "ctor" "-fno-short-enums" "-D__ARM_ARCH_5__" "-D__ARM_ARCH_5T__" "-D__ARM_ARCH_5E__" "-D__ARM_ARCH_5TE__" "-Wno-psabi" "-march=armv5te" "-mtu" "ne=xscale" "-msoft-float" "-mthumb" "-Os" "-fomit-frame-pointer" "-fno-strict-aliasing" "-finline-limit=64" "-DANDROID" "-Wa,--noexecstack" "-" "MMD" "-MP" "--extra-ldflags=" "-nostdlib" "-Bdynamic" "-Wl,--no-undefined" "-Wl,-z,noexecstack" "-Wl,-z,nocopyreloc" "-Wl,-soname,/system" "/lib/libz.so" "-Wl,-rpath-link=/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib/,-dynamic-linker=/system/bin/linker" "-L/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib/" "-nostdlib" "/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib//crtbegin_dynamic.o" "/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib//crtend_android.o" "-lc" "-lm" "-ldl" "-lgcc" "--cross-prefix=arm-eabi-" "--disable-asm" "--host=arm-linux"
    
        checking whether arm-eabi-gcc works... no
        Failed commandline was:
        --------------------------------------------------
        arm-eabi-gcc conftest.c -Wall -I. -I$(SRCPATH) -I/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/include/ -fPIC -DANDROID -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-prote
        ctor -fno-short-enums -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtu
        ne=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -
        MMD -MP -nostdlib -Bdynamic -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,nocopyreloc -Wl,-soname,/system
        /lib/libz.so -Wl,-rpath-link=/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib/,-dynamic-linker=/system/bin/linker -L/home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib/ -nostdlib /home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib//crtbegin_dynamic.o /home/mehmet/Android_NDK_r4/build/platforms/android-8/arch-arm/usr/lib//crtend_android.o -lc -lm -ldl -lgcc -lm -o conftest
        arm-eabi-gcc: ctor: No such file or directory
        arm-eabi-gcc: ne=xscale: No such file or directory
        arm-eabi-gcc: MMD: No such file or directory
        arm-eabi-gcc: /lib/libz.so: No such file or directory
        cc1: error: unrecognized command line option "-mtu"
        cc1: error: unrecognized command line option "-fstack-prote"
        cc1: error: to generate dependencies you must specify either -M or -MM
        arm-eabi-gcc: -E or -x required when input is from standard input
        --------------------------------------------------
        Failed program was:
        --------------------------------------------------
        int main () { return 0; }
        --------------------------------------------------
        DIED: No working C compiler found.
    

    Last edit Problem solved. It was just a mistake related to typos. It works well now.

  • What, if any, guarantees are there for when `nalu_process` will be called ?

    1er août 2012, par gspr

    In particular, can a call to x264_encoder_encode return before every nalu_process callback associated to it has returned? Someone in #x264 suggested it's settings-dependent; I'm talking here about the "zerolatency" preset.

    If the answer to the above question is yes, then how common is it, empirically?

  • GStreamer x264enc and SIGSEGV on Android

    18 juillet 2012, par Cipi

    I am trying to play around with GStreamer-java and it's h.264 encoder (x264enc) on Android.

    Now, I tried to encode raw video from test video source (set its is-live property to TRUE), and when data starts flowing into the x264enc Element, I get SIGSEGV in libx264.so and my app crashes. And it looks like code is dereferencing a NULL... Exact error location is in file "gstreamer_ndk_bundle/x264/encoder/analyse.c" line 963. And it is this line:

    h->mc.memcpy_aligned( h->mb.pic.i8x8_dct_buf, h->dct.luma8x8, sizeof(h->mb.pic.i8x8_dct_buf) );
    

    My device's CPU is Cortex 8 and it has NEON feature...

    I tried to printout to a file all h structure fields, and no field is uninitialized.

    Android DEBUG info from LogCat: HERE

    My questions:

    1. How can I know what is throwing SIGSEGV, because this line of code seems to be ok?
    2. Is this a known bug or an expected behavior of x264 encoder on ARM CPU or I am missing some encoder configuration?
    3. I noticed that if I set property analyse of the encoder to 0x3:0x113 (some random value I found online) I don't get SIGSEGV, encoder seems to work, but I get error in pipeline: Data flow error. Can I just set analyse to a meaningful value?

    Update

    I fprintf-ed all important "h" fields just before execution runs in x264_mb_analyse_intra() function and just before the line that it breaks, guess it could help: http://pastebin.com/sAfX239j

  • Compiling ffmpeg+libx264 for ios with sdk 4.3

    20 juin 2012, par ArchiButtle

    I want to compile FFMPEG with libx264 for iOS with SDK4.3. Scripts i found were for previous sdk version. Since 4.3 version, gcc is replace with llvm+clang so they didn't work. I edited script and i managed to compile for mac OS. But cross-compiling (armv6 & armv7) didn't work. Could someone help me?