Newest 'x264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • when i compile x264, get error undefined reference to sync_fetch_and_add_4

    9 juin 2013, par 任琦磊

    i use mingw and msys on windows 7(64 bit) to compile x264. the following is the error showed: libx264.a(frame.o):frame.c:(.text+0x2c2d): undefined reference to `__sync_fetch_ and_add_4' collect2.exe: error:ld reutrn 1 Makefile:182: recipe for target 'x264.exe' failed make: * [x264.exe] Error 1

  • Encode h264 to match existing stream

    6 juin 2013, par Diego Sánchez

    In short: I have to encode a tiny amount of video frames and stitch them in front of a much bigger h.264 stream without reencoding said stream.

    The details: I receive a multi GB transport stream containing a h.264 es and an audio es. Currently the h.264 streams are always generated using x264, and I can assume this will be the case in the future. Now I have to prepend some video frames to this stream, but am not allowed to decode/encode the whole stream; which leaves me with the only option to find out the exact parameters I need to pass x264_encoder_open so both streams match.

    Currently what I'm doing is :

    1. Demux the original ts and extract h.264 NAL packets.
    2. When I find the first "user data unregistered" SEI packet, I parse it and find a bunch of x264 parameters.
    3. Use libavcodec to start decoding the video. That gives me the dimensions of the picture and the h264 profile and level in the AVCodecContext structure.
    4. Match all of that as best as I can in the x264_param_t structure.

    I can do some encoding with that, and the encoded video plays correctly up to the join point. When VLC is reaching the stitch point it starts throwing out the following sequence of messages and soon after stops playing:

    [h264 @ 0x7fe36cd75be0] decode_slice_header error
    [h264 @ 0x7fe36cd75be0] no frame!
    [h264 @ 0x7fe36ccc9080] Width/height changing with threads is not implemented. Update your Libav version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    

    which clearly shows that my encoded frames do not match the original ones. I've been browsing the source code and can't seem to find a way of doing this. What I have currently (besides not working), involves a lot of guesswork, so even if I could make it work with the handful of example files I have, I would be scared to deploy this in production servers.

    So the obvious question is: Is there a safe, formal way of doing this?

    Thanks in Advance

  • Need Help to modify and change motion vectors and DCT coefficients in x264

    30 mai 2013, par farzadz

    I'm new to x264 and I need to find motion vectors and DCT coeeficients in H.264 videos and change them (or encrypt them). These changes have to be after the encoding of the raw video. I mean I need to change the coded values for motion vectors and DCT coefficients. Where can I find the variables ??

  • libx264.dll exposes function x264_encoder_open_130, shouldnt this be x264_encoder_open ?

    18 mai 2013, par Kim Kardashian

    I checked in my version of x264 dll file that the open function is named 'x264_encoder_open_130' and 130 happens to be the specific build number of x264 that i use. I build using minGW on windows and link to it, so my program would crash if i try to use a newer dll.. is there a way to get around this ?

  • Decode h264 stream with ffmpeg introduces a delay, how to avoid ?

    17 mai 2013, par Jonas Jongejan

    I'm working on some code that encodes a video feed, sends it over UDP to a client that then decodes the stream. It working fine using a x264 encoder, my only problem is that when i call avcodec_decode_video2 on the incomming frame, the decoder introduces a delay as if it has an internal buffer. How can i avoid this? What is controlling this behavior? Is it the encoder that should be changed, or is it missing settings in the decoder context? Currently i just create the decoder context with defaults avcodec_get_context_defaults3.

    The encoder has the following parameters:

    x264_param_t param;
    x264_param_default_preset(&param, preset.c_str(), "zerolatency");
    param.i_frame_reference = 1;
    
    param.i_threads = 1;
    param.b_sliced_threads = 5;
    param.i_slice_max_size = 8192;
    param.i_width = width;
    param.i_height = height;
    param.i_fps_num = 30;
    param.i_fps_den = 1;
    param.i_sync_lookahead = 0;
    
    param.i_bframe = 0;
    // Intra refres:
    param.i_keyint_max = 30;
    param.b_intra_refresh = 1;
    //Rate control:
    param.rc.i_rc_method = X264_RC_CRF;
    param.rc.i_lookahead = 0;
    param.rc.i_bitrate = bitrate;
    param.rc.i_vbv_max_bitrate = bitrate;
    param.rc.i_vbv_buffer_size = bitrate/30;
    
    //For streaming:
    param.b_repeat_headers = 1;
    param.b_annexb = 1;