Newest 'libx264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • how to use x264 encoder with directshow

    14 octobre 2014, par habibhassani

    i can't figure out how to use x264 with directshow. i installed many thinks that pretend to have x264 encoder in with no use i downloaded the videoLAN x264 binary and when i run it, it shows so fast a console windows, and nothing happen after that

    these is the encoders that i have

    enter image description here

    i am working on windows 8.1 x64

    please help with this issue it's just going to make me crazy hhh, i wanna use x264 because the other encoders that i have installed, either didn't work or encode with so big size.

  • FFMPEG x264 encoder Android

    24 septembre 2014, par DundeeDave

    I've compiled an FFMPEG library for use on Android with libx264 and using the NDK.

    I want to encode an MPEG video file however the application is failing when opening the encoder codec, in avcodec_open2.

    The FFMPEG logs I receive from avcodec_open2 are below with the function returning -22.

    • Picture size %ux%u is invalid.
    • ignoring invalid width/height values
    • Specified pix_fmt is not supported

    On windows this code works fine, it's only on Android that there is a failure. Any ides why this would fail on Android?

    if (!(codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO)))
        {
            return -1;
        }
    
        //Allocate context based on codec
        if (!(context = avcodec_alloc_context3(codec)))
        {
            return -2;
        }
    
        //Setup Context
        // put sample parameters
        context->bit_rate = 4000000;
        // resolution must be a multiple of two
        context->width = 1280;
        context->height = 720;
        // frames per second
        context->time_base = (AVRational){1,25};
        context->inter_quant_bias = 96;
        context->gop_size = 10;
        context->max_b_frames = 1;
        //IDs
        context->pix_fmt = AV_PIX_FMT_YUV420P;
        context->codec_id = AV_CODEC_ID_MPEG1VIDEO;
        context->codec_type = AVMEDIA_TYPE_VIDEO;
    
    
        if (AV_CODEC_ID_MPEG1VIDEO == AV_CODEC_ID_H264)
        {
            av_opt_set(context->priv_data, "preset", "slow", 0);
        }
    
        if ((result = avcodec_open2(context, codec, NULL)) < 0)
        {
            //Failed opening Codec!
        }
    
  • ffmpeg libx264 non-existing PPS 0 referenced

    18 août 2014, par k961

    hello i have installed ffmpeg and libx264 based in the offical tutorial on ffmpeg installation here : https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

    i want to get an stream from mumudvb and pass it to ffmpeg for h264 encoding when i use

    ffserver -f /path/to/config -d
    

    i get this output :

    [h264 @ 0x1ab32c0] non-existing PPS 0 referenced
    [mpegts @ 0x2c7cca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [h264 @ 0x1ab32c0] non-existing SPS 0 referenced in buffering period
    [h264 @ 0x1ab32c0] non-existing PPS 0 referenced
    [h264 @ 0x1ab32c0] decode_slice_header error
    [h264 @ 0x1ab32c0] no frame!
    [mpegts @ 0x1aadca0] 
    decoding for stream 0 failed
    [mpegts @ 0x1aadca0] decoding for stream 1 failed
    Input #0, mpegts, from 'http://127.0.0.1:9097':
      Duration: N/A, start: 45508.714822, bitrate: N/A
      Program 107 
    [mpegts @ 0x1aadca0]     Stream #0:0[0x42e]: Video: h264 ([27][0][0][0] / 0x001B)[mpegts @ 0x30b0ca0] decoding for stream 1 failed
    , 50 fpsitech@itech-All-Series:~$ , 50 tbr, 90k tbn, 180k tbc
    [mpegts @ 0x1cd5ca0]     Stream #0:1Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [0x42f](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
    http://127.0.0.1:8888/tv7.ffm: Input/output error
    Input #0, mpegts, from 'http://127.0.0.1:9093':
      Duration: N/A, start: 25560.704144, bitrate: N/A
      Program 103 
        Stream #0:0[0x406]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
        Stream #0:1[0x407](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
        Stream #0:2[0x40b](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Received signal 2: terminating.
    [mpegts @ 0x30b0ca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    http://127.0.0.1:8888/tv3.ffm: Input/output error
    [mpegts @ 0x1aadca0] Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mpegts, from 'http://127.0.0.1:9094':
    Received signal 2: terminating.
    Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
      Duration: N/A, start: 43409.427056, bitrate: N/A
      Program 104 
        Stream #0:0[0x410]Input #0, mpegts, from 'http://127.0.0.1:9098':
    : Video: h264 ([27][0][0][0] / 0x001B), 50 fps, 50 tbr, 90k tbn, 180k tbc
        Stream #0:1[0x411](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
        Stream #0:2[0x415](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    http://127.0.0.1:8888/tv4.ffm: Input/output error
    Received signal 2: terminating.
      Duration: N/A, start: 26351.744300, bitrate: N/A
      Program 108 
        Stream #0:0[0x438]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
        Stream #0:1[0x439](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
        Stream #0:2[0x43d](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    http://127.0.0.1:8888/tv8.ffm: Input/output error
    Received signal 2: terminating.
    

    ffmpeg will gime me the output. but the prooblem is that the outputs bitrate is around 2000k to 3000k it should be 512k

    this is my ffserver config :

    Port 8888
    BindAddress 0.0.0.0
    MaxHTTPConnections 20000
    MaxClients 10000
    MaxBandwidth 1000000
    CustomLog -
    
    File /tmp/ch1.ffm
    FileMaxSize 100M
    ACL allow 127.0.0.1
    launch ffmpeg -i http://127.0.0.1:9094
    
    
    
    Feed ch1.ffm
    Format mpegts
    AudioBitRate 64
    AudioChannels 2
    AudioSampleRate 44100
    #AVOptionAudio flags +global_header
    VideoBitRate 512
    VideoBufferSize 400
    VideoFrameRate 25
    VideoBitRateTolerance 100
    VideoSize 720x576
    VideoGopSize 12
    AudioCodec aac
    VideoCodec libx264
    AVOptionVideo bsf h264_mp4toannexb
    #AVOptionVideo threads 0
    AVOptionVideo threads_type frame
    AVOptionVideo coder 0
    AVOptionVideo bf 0
    AVOptionVideo flags +loop
    AVOptionVideo partitions +parti8x8+parti4x4+partp8x8+partb8x8
    AVOptionVideo me_method hex
    AVOptionVideo subq 7
    AVOptionVideo me_range 16
    AVOptionVideo g 250
    AVOptionVideo keyint_min 10
    AVOptionVideo sc_threshold 40
    AVOptionVideo i_qfactor 0.71
    AVOptionVideo b_strategy 1
    AVOptionVideo qcomp 0.6
    AVOptionVideo qmin 10
    AVOptionVideo qmax 51
    AVOptionVideo qdiff 4
    AVOptionVideo refs 3
    AVOptionVideo directpred 1
    AVOptionVideo trellis 1
    AVOptionVideo wpredp 0
    #AVOptionVideo flags +global_header
    
    StartSendOnKey
    
    
  • how to use x264 dll in another project

    5 août 2014, par Hadi Rasekh

    enter code here I want to use x264 in my project. There is some line in the code said:

    /* Application developers planning to link against a shared library version of * libx264 from a Microsoft Visual Studio or similar development environment * will need to define X264_API_IMPORTS before including this header. * This clause does not apply to MinGW, similar development environments, or non * Windows platforms. */

    But I don't get this line: define X264_API_IMPORTS before including this header

    We can create x264 dll by its configuration and make

        ./configure --enable-shared
        make
    

    but I can not use the dll in my Qt Project.

    I can make my own dll (in another code) and use it in the project. But when I start to use x264 dll in my project I get the following error:

        C:\DataHiding\SourceCode2\GUI\DataHiding\mainwindow.cpp:10: error:
        'pulldown_frame_duration' was not declared in this scope
        qDebug() << pulldown_frame_duration[1];
                 ^
    
  • How to integrate libx264 in ffmpeg for android ?

    5 août 2014, par user3665376

    I am working with integrating ffmpeg for android .

    Since I needed H.264 encoding I need to integrate libx264 with ffmpeg . Given below are the steps I followed .

    1) Build the latest libx264 using android compiler tool-chain to obtain libx264.so.142 .

    2) Build ffmpeg v 2.3 referring to this with --enable -libx264 option while configuring ffmpeg . The method explained in the blog included some editing in configure file of ffmpeg to generate shared object files with extension format [lib name].so rather than the generating shared object file with extension format [lib name].so.[version] (Since android build system supports files with extension .so only).

    The building process was successful but since the generated .so files (after building ffmpeg) has dynamic dependency with libx264.so.142,I need to package libx264.so.142 also with the android .apk file . But since the above format (.so.142) is not supported with android apk building system I cannot package it with the .apk .

    So I think the only option I have is to make some changes in configure file of ffmpeg to change the dynamic dependency of libx264.so.142 to libx264.so . Am I right??

    What changes do I need to make to ffmpeg configure file to achieve this?