Newest 'x264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Directshow X264Vfw Codec CPU usage issue

    18 juillet 2012, par meghana

    I run one graph in graphedit that is below,

    Video Source (Capture Pin) --> x264vfw - H.264/MPEG-4 AVC Codec ---------> Mpeg Muliplexter --> Output (Writer)                                             
    

    By running this graph in graphedit , it consumes cpu usage to 35% (average approx.) , if i just remove x264vfw - H.264/MPEG-4 AVC Codec , then Cpu Usage reduces to 2% - 5%.

    I understand that compressor uses remarkable CPU and Memory , but this is very high usage , we need to reduce it any how.

    Can i reduce CPU usage by changing some configuration of vfw or in any other way ?? Or please suggest me if there's any other x264 vfw codec for mpeg4 in directshow that uses less of cpu memory??

    Edit :

    Below is my x264Vfw Codec Settings

    Encoding Type : Single Pass - bitrate-based (ABR) 
    bitrate : 285 (but i get output bitrate around 485)
    Output Mode : VFW
    VFW FourCC : H264
    SAR : 2:1
    
  • FFmpeg/X264 : Split video mid-GOP without reencoding entire stream

    10 juillet 2012, par yoda_alex

    I've got an H264 video (Stored in an MP4 file). Each GOP is approx 10s long. I want to trim the first couple of seconds off the video, which means I need to split the first GOP. Is there a way to do this without re-encoding the entire video?

    I've got FFmpeg and x264 available. I'm happy to use either the FFmpeg command line, or my own program linked against ffmpeg of x264 libraries.

    Thanks in advance!

  • How to solve bad instruction `vadd.i16 q0,q0,q0' when attempting to check gcc for neon instruction

    6 juillet 2012, par newentry
    Checking  gcc supports failed for neon instruction vadd.i16 q0,q0,q0
        test.c
    
        int main ()
        {
         __asm__("vadd.i16 q0, q0, q0"); return 0;
        }
    
        arm-linux-androideabi-gcc test.c
        /tmp/ccfc8m0G.s: Assembler messages:
        /tmp/ccfc8m0G.s:24: Error: bad instruction `vadd.i16 q0,q0,q0'
    

    Tried with flags -mcpu=cortex-a8 -mfpu=neon but stil no success

    Above code was used to test gcc support for neon instruction.

    Actually i am trying to build x264 with NEON support for ARM platformAfter running configure script x264 config log file contains

    Command line options: "--cross-prefix=arm-linux-androideabi-" "--enable-pic" "--extra- cflags=-mcpu=cortex-a8" "--host=arm-linux"

    checking whether arm-linux-androideabi-gcc works... yes
    checking whether arm-linux-androideabi-gcc supports for( int i = 0; i < 9; i++ ); with -std=gnu99... yes
    checking whether arm-linux-androideabi-gcc supports __asm__("rev ip, ip");... yes
    checking whether arm-linux-androideabi-gcc supports __asm__("movt r0, #0");... yes
    checking whether arm-linux-androideabi-gcc supports __asm__("vadd.i16 q0, q0, q0");... no
    
    arm-linux-androideabi-gcc conftest.c  -Wall -I. -I$(SRCPATH) -mcpu=cortex-a8 -std=gnu99    -lm -o conftest
    E:\cygwin\tmp\ccVtVI1i.s: Assembler messages:
    E:\cygwin\tmp\ccVtVI1i.s:24: Error: bad instruction `vadd.i16 q0,q0,q0'
    --------------------------------------------------
    Failed program was:
    --------------------------------------------------
    int main () { __asm__("vadd.i16 q0, q0, q0"); return 0; }
    --------------------------------------------------
    
    
    config.h contains
    
    #define HAVE_MALLOC_H 1
    #define HAVE_ARMV6 1
    #define HAVE_ARMV6T2 1
    #define ARCH_ARM 1
    #define SYS_LINUX 1
    #define HAVE_VECTOREXT 1
    #define fseek fseeko
    #define ftell ftello
    #define HAVE_GPL 1
    #define HAVE_INTERLACED 1
    #define HAVE_ALTIVEC 0
    #define HAVE_ALTIVEC_H 0
    #define HAVE_MMX 0
    #define HAVE_NEON 0
    #define HAVE_BEOSTHREAD 0
    #define HAVE_POSIXTHREAD 0
    #define HAVE_WIN32THREAD 0
    #define HAVE_THREAD 0
    #define HAVE_LOG2F 0
    #define HAVE_VISUALIZE 0
    #define HAVE_SWSCALE 0
    #define HAVE_LAVF 0
    #define HAVE_FFMS 0
    #define HAVE_GPAC 0
    #define HAVE_GF_MALLOC 0
    #define HAVE_AVS 0
    #define HAVE_CPU_COUNT 0
    
    
    Running make command build x264 static lib  based on above config.h which contains HAVE_NEON 0
    
    
    **Compiler Version**
    
    
    
    arm-linux-androideabi-gcc -v
    Using built-in specs.
    Target: arm-linux-androideabi
    Configured with: /tmp/ndk-digit/src/build/../gcc/gcc-4.4.3/configure --prefix=/usr/local/google/digit/repo/opensource/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows --target=arm-linux-androideabi --host=i586-mingw32msvc --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/ndk-digit/build/toolchain/temp-install --with-mpfr=/tmp/ndk-digit/build/toolchain/temp-install --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable
    -libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-initfini-array --disable-nls --prefix=/usr/local/google/digit/repo/opensource/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows --with-sysroot=/usr/local/google/digit/repo/opensource/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/sysroot --with-binutils-version=2.20.1 --with-mpfr-version=2.4.1 --with
    -gmp-version=4.2.4 --with-gcc-version=4.4.3 --with-gdb-version=6.6 --with-arch=armv5te --program-transform-name='s,^,arm-linux-androideabi-,'
    Thread model: posix
    gcc version 4.4.3 (GCC)    
    

    Goal is to utilize neon enabled ARM processor to boost x264 encoder performance...

  • ffmpeg not setting GOP size for x264

    5 juillet 2012, par Chris Robinson

    Can someone please explain to me why the following settings:

    ffmpeg -i test.avi -vcodec libx264 -g 2 -keyint_min 1 -sc_threshold 100000000 -bf 1 test.mp4
    

    produces the following output:

    ffmpeg version N-41668-g564bb24 Copyright (c) 2000-2012 the FFmpeg developers
    built on Jun 17 2012 20:18:05 with gcc 4.6.3
    configuration: --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 --ena  libavutil      51. 58.100 / 51. 58.100
      libavcodec     54. 25.100 / 54. 25.100
      libavformat    54.  6.101 / 54.  6.101
      libavdevice    54.  0.100 / 54.  0.100
      libavfilter     2. 81.100 /  2. 81.100
      libswscale      2.  1.100 /  2.  1.100
      libswresample   0. 15.100 /  0. 15.100
      libpostproc    52.  0.100 / 52.  0.100
    Input #0, avi, from 'test.avi':
      Metadata:
        encoder         : Lavf54.6.101
      Duration: 00:00:01.70, start: 0.000000, bitrate: 4258 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (DIVX / 0x58564944), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 29.97 tbn, 30k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 128 kb/s
    [buffer @ 0000000004115600] w:1280 h:720 pixfmt:yuv420p tb:1001/30000 fr:30000/1001 sar:1/1 sws_param:flags=2
    [ffmpeg_buffersink @ 00000000041157a0] No opaque field provided
    [libx264 @ 000000000411f120] using SAR=1/1
    [libx264 @ 000000000411f120] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
    [libx264 @ 000000000411f120] profile High, level 3.1
    [libx264 @ 000000000411f120] 264 - core 125 r2200 999b753 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - 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=36 lookahead_threads=6 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 keOutput #0, mp4, to 'test.mp4':
      Metadata:
        encoder         : Lavf54.6.101
        Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 30k tbn, 29.97 tbc
        Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (mpeg4 -> libx264)
      Stream #0:1 -> #0:1 (mp3 -> libvo_aacenc)
    Press [q] to stop, [?] for help
    [libvo_aacenc @ 0000000001ebe240] Que input is backward in time
    Last message repeated 8 times
    frame=   35 fps=0.0 q=-1.0 Lsize=     466kB time=00:00:01.10 bitrate=3466.6kbits/s dup=1 drop=0    
    
    video:436kB audio:28kB global headers:0kB muxing overhead 0.558509%
    [libx264 @ 000000000411f120] frame I:1     Avg QP:24.93  size: 92398
    [libx264 @ 000000000411f120] frame P:28    Avg QP:26.82  size: 12010
    [libx264 @ 000000000411f120] frame B:6     Avg QP:30.37  size:  2764
    [libx264 @ 000000000411f120] consecutive B-frames: 74.3%  5.7%  8.6% 11.4%
    [libx264 @ 000000000411f120] mb I  I16..4: 41.5% 40.1% 18.4%
    [libx264 @ 000000000411f120] mb P  I16..4:  3.9%  1.4%  0.6%  P16..4: 14.3%  4.7%  3.2%  0.0%  0.0%    skip:72.0%
    [libx264 @ 000000000411f120] mb B  I16..4:  1.1%  0.4%  0.1%  B16..8: 14.2%  2.8%  0.6%  direct: 1.1%  skip:79.8%  L0:49.8% L1:39.5% BI:10.8%
    [libx264 @ 000000000411f120] 8x8 transform intra:29.9% inter:76.4%
    [libx264 @ 000000000411f120] coded y,uvDC,uvAC intra: 31.1% 34.4% 18.7% inter: 10.2% 6.3% 3.0%
    [libx264 @ 000000000411f120] i16 v,h,dc,p: 62% 34%  3%  0%
    [libx264 @ 000000000411f120] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 23% 38%  4%  4%  3%  3%  2%  5%
    [libx264 @ 000000000411f120] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 40% 35% 16%  1%  2%  2%  1%  1%  1%
    [libx264 @ 000000000411f120] i8c dc,h,v,p: 52% 20% 24%  3%
    [libx264 @ 000000000411f120] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 000000000411f120] ref P L0: 70.5% 10.1% 12.1%  7.3%
    [libx264 @ 000000000411f120] ref B L0: 81.1% 16.9%  2.0%
    [libx264 @ 000000000411f120] ref B L1: 89.7% 10.3%
    [libx264 @ 000000000411f120] kb/s:3050.18
    

    Why am I not getting an I-Frame every second frame? Is there something else I can set to do enforce this? If not, can you suggest how to do this using the mpeg4 codec. It's vital that I can extract what type of frame has been encoded during the encoding process and that I can set a specific GOP structure.

  • FFMPEG not recognizing "-x264opts"

    12 juin 2012, par user1338254

    I use FFMPEG to convert my videos to mp4 format.I am using the following FFMPEG CLI ,

     ffmpeg -i {i/p file} 
     -vcodec libx264 
     -x264opts vbv-maxrate=364:vbv-bufsize=182
     {o/p file}
    

    But i get "ffmpeg: unrecognized option '-x264opts' " error when trying to execute the above CLI. My FFMPEG version id 0.5.

    What am I doing wrong?