Newest 'x264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • HTML5 - ffmpeg encoded x264 video fails to play in Chrome/IE

    11 août 2014, par Saren Arterius

    I have totally no idea why http://jiro.wtako.net/video/39 does work in all browsers while http://jiro.wtako.net/video/40 only works in Firefox.

    1 is encoded by MediaCoder (x264 + Nero encoder) and 2 is encoded by Arch Linux ffmpeg.

    ffmpeg version: ffmpeg 1:2.3.1-1

    x264 version: libx264 1:142.20140311-6

    It seems that video size, frame rate, profile, level, bitrate does not affect whether the video can be played, because I have tried all these parameters, none of these works:

    $ ffmpeg -i in.avi -c:v libx264 -crf 25 -pix_fmt yuv420p -preset veryslow -vf scale=640:360 -c:a aac -strict -2 -b:a 192k out.mp4
    
    $ ffmpeg -i in.avi -c:v libx264 -crf 25 -pix_fmt yuv420p -preset veryslow -vf scale=640:360 -c:a aac -strict -2 -b:a 128k out.mp4
    
    $ ffmpeg -i in.avi -c:v libx264 -crf 28 -pix_fmt yuv420p -preset veryslow -c:a aac -strict -2 -b:a 192k out.mp4
    
    $ ffmpeg -i in.avi -c:v libx264 -b:v 2000k -pix_fmt yuv420p -preset veryslow -c:a aac -strict -2 -b:a 192k out.mp4
    
    $ ffmpeg -i in.avi -c:v libx264 -crf 28 -pix_fmt yuv420p -level:v 3.2 -preset veryslow -c:a aac -strict -2 -b:a 192k out.mp4
    
    $ ffmpeg -i in.avi -c:v libx264 -crf 28 -pix_fmt yuv420p -profile:v baseline -preset veryslow -c:a aac -strict -2 -b:a 192k out.mp4
    

    Here is the media info of the video that does work in all browsers.

    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 12.5 MiB
    Duration                                 : 1mn 52s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 932 Kbps
    Encoded date                             : UTC 2014-05-01 13:14:37
    Tagged date                              : UTC 2014-05-01 13:14:37
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L3.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 15 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 1mn 52s
    Bit rate                                 : 768 Kbps
    Maximum bit rate                         : 1 307 Kbps
    Width                                    : 640 pixels
    Height                                   : 360 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 60.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.056
    Stream size                              : 10.7 MiB (86%)
    Writing library                          : x264 core 128 r2216 198a7ea
    Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=tesa / subme=11 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=9 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=16 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=abr / mbtree=1 / bitrate=768 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Encoded date                             : UTC 2014-05-01 13:14:37
    Tagged date                              : UTC 2014-05-01 13:14:37
    
    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 1mn 52s
    Bit rate mode                            : Variable
    Bit rate                                 : 124 Kbps
    Maximum bit rate                         : 133 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 1.66 MiB (13%)
    Encoded date                             : UTC 2014-05-01 13:14:37
    Tagged date                              : UTC 2014-05-01 13:14:37
    

    Here is the media info of the video that does work only in Firefox.

    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 57.4 MiB
    Duration                                 : 2mn 48s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 2 856 Kbps
    Writing application                      : Lavf55.33.100
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L5.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 16 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 2mn 48s
    Bit rate                                 : 2 655 Kbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 60.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.048
    Stream size                              : 53.3 MiB (93%)
    Writing library                          : x264 core 142 r2397M b7a50c1
    Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    
    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 2mn 48s
    Duration_LastFrame                       : -19ms
    Bit rate mode                            : Variable
    Bit rate                                 : 192 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 3.79 MiB (7%)
    
  • undefined reference error in using libx264 in another project

    10 août 2014, par Hadi Rasekh

    When I used the x264 DLL in another project, the "undefined reference error" is reported when making that project!

    This is my (example_exe.cpp) code:

    #include 
    #include 
    #include 
    
    #define X264_API_IMPORTS
    #include "x264.h"
    
    
    int main(void)
    {
        x264_param_t *t;
        x264_encoder_open(t);
        return 0;
    }
    

    and This is how I compile and make my code:

    g++ -c example_exe.cpp
    g++ -o example_exe.exe example_exe.o -L. -llibx264-142
    

    and I got the following error:

    example_exe.o:example_exe.cpp:(.text+0x22): undefined reference to `x264_encoder_open_142(x264_param_t*)`
    
  • Error when using x264 DLL [closed]

    7 août 2014, par Nematollah Zarmehi

    When I used the x264 DLL in another project, the "undefined reference error" is reported when making that project!

    I downloaded the dll file from the following website: http://sourceforge.net/projects/muldersoft/files/x264%20Library%20%28DLL%29/.

  • 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];
                 ^
    
  • H264 : decode series of nal units with ffmpeg

    1er août 2014, par jsim

    I tried to decode a series of nal units with ffmpeg (libavcodec) but I get a "no frame" error. I produced the nal units with the guideline at http://stackoverflow.com/questions/2940671/how-to-encode-series-of-images-into-h264-using-x264-api-c-c. I tried the following strategy for decoding:

    avcodec_init();  
    avcodec_register_all();  
    AVCodec* pCodec;  
    pCodec=lpavcodec_find_decoder(CODEC_ID_H264);  
    AVCodecContext* pCodecContext;  
    pCodecContext=lpavcodec_alloc_context();  
    avcodec_open(pCodecContext,pCodec);  
    AVFrame *pFrame;  
    pFrame=avcodec_alloc_frame();
    //for every nal unit:    
        int frameFinished=0;  
        //nalData2 is nalData without the first 4 bytes
        avcodec_decode_video(pCodecContext,pFrame,&frameFinished,(uint8_t*) nalData2,nalLength);
    

    I passed all units I got to this code but frameFinished stays 0. I guess there must be something wrong with the pCodecContext setup. Can someone send me a working example?

    Thank you