Newest 'libx264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Given an x264 stream and an ogg vorbis stream, how do I make a muxed stream that mplayer/VLC can read ?

    14 avril 2012, par dascandy

    I'm confused and a bit stuck with this question. All I can find on Google is basic usage of transcoding software, which is not related to the question.

    I'm making a game and I'd like to include native capture ability to stream video. I would much like to stream this to a standard-ish client, such as VLC. It needs to be both in a format it recognizes and it needs to be multiplexed in order for this to work.

    My question therefore is, I know how to encode stuff from raw video frames to x264 (see also How to encode series of images into H264 using x264 API? (C/C++) ). I know how to encode raw audio samples into ogg/vorbis. Now, how do I put one and one together for VLC?

  • Tune FFMPEG h264 decoder

    9 avril 2012, par user1002473

    I use FFMPEG avcodec for decode live video. avcodec_decode_video2 function if be more exactly (libx264). How can i make a less decoding time for each frame? Now I have 20 ms by each frame (frame size about 1,5 kbyte)

    Thanks

  • x264 Faster decode speed

    26 mars 2012, par ddlshack

    I'm using x264 to encode videos for a flash video streaming site. I use -tune fastdecode, which turns off cabac and deblock, which I've heard are the features which take most cpu to decode. However, I've still had reports of jerky video playback and high cpu usage.

    Heres a typical encode command:

    ffmpeg -y -i $infile -c:v libx264 -crf 28 -preset slow -vprofile main -tune fastdecode -f h264 -r:v 29.970 -vf "..." $outfile
    

    My users view the videos using flash, on all desktop OSes and a wide variety of hardware.

    Which encoding options are the most cpu-intense, and what are the recommended options for 'reasonable' playback on most machines?

  • Encoding video only FLV

    25 mars 2012, par NadavRub

    I am trying to generate a video only FLV file, I am using:

    1. libx264 + ffmpeg
    2. 30 fps ( fixed )
    3. playback is done using VLC 2.0.1 and flowplayer

    When playing the FLV the frame-rate seems ~1 frame per sec, following is the way I cfg ffmpeg:

    AVOutputFormat* fmtOutput = av_oformat_next(0);
    while((0 != fmtOutput) && (0 != strcmp(fmtOutput->name, "flv")))
        fmtOutput = av_oformat_next(fmtOutput);
    m_pFmtCtxOutput          = avformat_alloc_context();
    m_pFmtCtxOutput->oformat = fmtOutput;
    
    AVStream* pOutVideoStream= av_new_stream(m_pFmtCtxOutput, pInVideoStream->id);
    AVCodec*  videoEncoder   = avcodec_find_encoder(CODEC_ID_H264);
    
    pOutVideoStream->codec->width    = 640;
    pOutVideoStream->codec->height   = 480;
    pOutVideoStream->codec->level    = 30;
    pOutVideoStream->codec->pix_fmt  = PIX_FMT_YUV420P;
    pOutVideoStream->codec->bit_rate = 3000000;
    
    pOutVideoStream->cur_dts         = 0;
    pOutVideoStream->first_dts       = 0;
    pOutVideoStream->index           = 0;
    pOutVideoStream->avg_frame_rate  = (AVRational){ 30, 1 };
    pOutVideoStream->time_base       =
    pOutVideoStream->codec->time_base= (AVRational){ 1, 30000 };
    pOutVideoStream->codec->gop_size = 30;
    %% Some specific libx264 settings %%
    m_dVideoStep                     = 1000;// packet dts/pts is incremented by this amount each frame
    
    pOutVideoStream->codec->flags   |= CODEC_FLAG_GLOBAL_HEADER;
    avcodec_open(pOutVideoStream->codec, videoEncoder);
    

    The resulting file seems OK, with the exception of the playback frame-rate.
    having in mind that:

    1. pOutVideoStream->avg_frame_rate = (AVRational){ 30, 1 };
    2. pOutVideoStream->time_base = (AVRational){ 1, 30000 };
    3. pOutVideoStream->codec->time_base= (AVRational){ 1, 30000 };
    4. For each frame I increment the dts/pts by 1000

    What am I doing wrong here? why the file is playing choppy ( ~1 fps )?

    Any help will be appreciated.

    Nadav at Sophin

  • VLC libx264 streaming muxed as FLV

    24 mars 2012, par Jan Novák

    I have a question on streaming output of libx264. My scenario is that Iam capturing video from webcam, encoding with x264 and then streaming data to flash, muxed as FLV. For muxing, Im using output/flv_bitstream.h, included in libx264 budle. The only modification of muxer, that I made, is that instead of fwrite() im usig send() to transfer data via socket... Encoding library is working fine. If I save output (even muxed), vlc player is able to play it. But, when it goes to data transfer via socket, vlc and flash are not cooperating. The weird thig is, that if Im sending data to vlc player thru socket, it waits till transmission end and then plays video from buffer. But what I need is to play live stream.

    I also tryed to read flv file and send it to vlc of flash tag by tag and it is working fine.

    Any suggestions?