Newest 'x264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • encode x264(libx264) raw yuv frame data

    26 juin 2015, par Mohamed El-Sayed

    I am trying to encode an MP4 video using raw YUV frames data, but I am not sure how can I fill the plane data (preferably without using other libraries like ffmpeg)

    The frame data is already encoded in I420, and does not need conversion.

    Here is what I am trying to do:

    const char *frameData = /* Raw frame data */;
    
    x264_t *encoder = x264_encoder_open(&param);
    x264_picture_t imgInput, imgOutput;
    x264_picture_alloc(&imgInput, X264_CSP_I420, width, height);
    
    // how can I fill the struct data of imgInput
    
    x264_nal_t *nals;
    int i_nals;
    int frameSize = x264_encoder_encode(encoder, &nals, &i_nals, &imgInput, &imgOutput);
    

    The equivalent command line that I have found is :

     x264 --output video.mp4 --fps 15 --input-res 1280x800 imgdata_01.raw 
    

    But I could not figure out how the app does it.

    Thanks.

  • Windows : How to build X264.lib instead of .dll

    25 juin 2015, par user1884325

    I downloaded the X264 source and installed mingw.

    Step 1:

    Executed this in the MINGW bash:

    ./configure --disable-cli --enable-shared --enable-win32thread - -extra-ldflags=-Wl,--output-def=libx264.def

    and then 'make'

    Step 2:

    Renamed the libx264-142.dll to libx264.dll and Opened up VS2012 Command Prompt and executed this:

    LIB /DEF:libx264.def

    which gave me libx264.lib and object libx264.exp

    Step 3:

    Included the lib file in a VS2012 project which uses the X264 API.

    Problem:

    When I start the project I get the following error message:

    "The program can't start because libx264.dll is missing from your computer"

    Question:

    Why is it looking for the dll when I'm linking the static library in?

    How do I resolve this? I would like to build a static X264 library which I can link in with my project.

    EDIT:

    I just had to put the dll in the same directory as the project executable.

    However - My question still stands: How do I build a static x264 library? So I don't need the dll?

  • x264 failed to load avisynth - ubuntu 14.04

    23 juin 2015, par Shoham

    Im trying to reduce a video.mov file (taken with canon dslr). Im using x264 like so:

    x264 -o '/home/user/Desktop/MVI_0390.mp4'  '/home/user/Desktop/MVI_0390.MOV'
    

    And Im getting following error:

    avs [error]: failed to load avisynth
    raw [error]: raw input requires a resolution.
    x264 [error]: could not open input file `/home/user/Desktop/MVI_0390.MOV' via any method!
    

    What am I doing wrong?

  • Decode mJPEG to a format usable by libx264

    16 juin 2015, par Dan Tumaykin

    I am compressing frames coming from webcam with libx264. So far I used YUY2 raw frames and swscale to transcode the frames to I420, which is usable by x264.

    Anyway I would like to add support for mJPEG webcams (usually webcam provides both, but mJPEG allows higher frame rates and resolutions). What can I use to transcode mJPEG to some format, that can be used by x264?

  • Why av_find_encoder(AV_CODEC_ID_H264) has no profiles

    14 juin 2015, par SabinManiac

    I have this code:

    int32_t codecs[ ] = { AV_CODEC_ID_H264, AV_CODEC_ID_VP8,   AV_CODEC_ID_VP9 };
    AVCodec* codec;
    const AVProfile* profile=nullptr;
    for ( int32_t i=0;isizeof(codecs[0]);++i) {
    codec = avcodec_find_encoder(static_cast(codecs[i]));
    if (codec) {
      profile = codec->profiles;
      printf("%s\n",codec->name);
      if(!profile)
          printf("\t NO PROFILE\n");
      while (profile &&
             profile->profile!=FF_PROFILE_UNKNOWN){
        printf("\t:%s\n",profile->name);
        profile++;
      }
    } else {
      printf("No codec.\n");
    }
    }
    return true;
    

    Why doesn't the encoder have a list of profiles. If I replace avcodec_find_encoder with avcodec_find_decoder I have the profiles listed. I know that the decoder is implemented inside ffmpeg and the encoder in x264, but is there any way to make this work. I need to know what profiles are available(at least for AV_CODEC_ID_H264).