Newest 'x264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How to write a Live555 FramedSource to allow me to stream H.264 live

    22 juillet 2015, par Garviel

    I've been trying to write a class that derives from FramedSource in Live555 that will allow me to stream live data from my D3D9 application to an MP4 or similar.

    What I do each frame is grab the backbuffer into system memory as a texture, then convert it from RGB -> YUV420P, then encode it using x264, then ideally pass the NAL packets on to Live555. I made a class called H264FramedSource that derived from FramedSource basically by copying the DeviceSource file. Instead of the input being an input file, I've made it a NAL packet which I update each frame.

    I'm quite new to codecs and streaming, so I could be doing everything completely wrong. In each doGetNextFrame() should I be grabbing the NAL packet and doing something like

    memcpy(fTo, nal->p_payload, nal->i_payload)
    

    I assume that the payload is my frame data in bytes? If anybody has an example of a class they derived from FramedSource that might at least be close to what I'm trying to do I would love to see it, this is all new to me and a little tricky to figure out what's happening. Live555's documentation is pretty much the code itself which doesn't exactly make it easy for me to figure out.

  • buffering period sei in JM reference codec

    14 juillet 2015, par Nani

    Can I know how to encode yuv420 video using JM such that each IDR frame must be associated with Buffering period SEI and picture timing SEI messages. I went through the "encoder.cfg" configure file but i coudn't find any options to enable buffering period SEI and picture timing SEI messages. Also when I went through the encoder code, I observed that nowhere they are updating the parameter "seiBufferingPeriod.nal_initial_cpb_removal_delay" present in buffering period SEI. I would like to know whether JM supports Buffering period and picture timing SEI's or not. If supports how to configure encoder and where they are updating the buffering period SEI parameters in the JM encoder.

  • Unknown encoder 'libx264'

    10 juillet 2015, par why

    I installed ffmpeg 0.8.9 on ubuntu11 by

    ./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libx264

    When I run it

    ffmpeg -y -i test.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -vcodec libx264 -b 250k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 250k -maxrate 250k -bufsize 250k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 320:240 -g 30 -async 2 a.ts
    

    It said

    Unknown encoder 'libx264'

    (Note: the same error could occour with avconv)

    How can I fix this? Thanks!

  • Writing numpy arrays using cv2 VideoWriter

    8 juillet 2015, par JustInTime

    I have a problem with writing a toy example video using opencv2.3.1 VideoWriter, here is how I do it:

    writer = cv2.VideoWriter('test1.avi',cv.CV_FOURCC('P','I','M','1'),25,(640,480))
    for i in range(1000):
        x = np.random.randint(10,size=(480,640)).astype('uint8')
        writer.write(x)
    #del writer (with or without tested)
    

    I tried every possible combination resulting with a 0 bytes file if the extension was mpg, and 5.5kb if it was avi. I should say that some pointed out that I should build the ffmpeg library from source and not apt-get it. Well I did that on a fresh machine based on the help of this site http://vinayhacks.blogspot.com/2011/11/installing-opencv-231-with-ffmpeg-on-64.html. which also presented an error while compiling opencv(the error was related to ffmpeg). Now I am really out of ideas, How to generate a video using OPENCV?

    Thanks in advance

  • x264 rate control set

    2 juillet 2015, par chinayin

    I have been learning x264 encode for months. What I need is to control the rate and get an average bitrate. Following is my set, I got an average bitrate but the picture quality is bad, so I need your suggestion or something that can help me learn more about x264.

    Params.rc.i_rc_method = X264_RC_ABR ;
    Params.rc.i_bitrate = nBitRate*0.65/1000  ;
    Params.rc.i_vbv_buffer_size = nBitRate/1000;
    Params.rc.i_vbv_max_bitrate = nBitRate*0.65/1000 ;
    Params.rc.f_vbv_buffer_init = 1.0 ;
    Params.rc.f_rate_tolerance = 1.0 ;                              
    Params.i_fps_num =  ParamIn.dFrameRate*0.6 ;
    Params.i_fps_den = 1 ;
    Params.i_width = ParamIn.nWidth ;
    Params.i_height = ParamIn.nHeight ;