Newest 'x264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How to get x264.pc windows ?

    30 mars 2021, par NO_GUI

    I am trying to build the pion mediadevices webrtc example utilizing x264 as my video encoder. I am building on a Windows 10 PC. The pion/mediadevices library utilizes pkg-config to locate x264 to build the program. I keep getting this error when building though:

    # pkg-config --cflags  -- x264
    Package x264 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `x264.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'x264' found
    pkg-config: exit status 1
    

    I downloaded the source code for x264, but there is no x264.pc included. And from my research, it appears x264.pc is only included with libx264. I can't find any way to get libx264 on Windows either. Lastly, what is x264.pc, and what is a .pc file? Thanks for the help!

    Edit: I think I have to build the x264 library first, and I almost got it to work. MinGW was able to compile x264 and give me the x264.pc. But it was all compiled in 32bit, how can I compile the x264 library for 64bit on windows?

  • MPEG4 X264 vs NVENC H264 encoding play compatibility on old devices

    28 mars 2021, par Root

    I always encoding videos on x264, this encoding work well on old devices or mobile phones.
    To increase the encoding speed I try to replace encoding method with NVENC H264 with nVidia GPU.

    Question 1 : Device combability for play the NVENC H264 is different with x264 ?
    Question 2 : Old devices can play NVENC H264 file same as x264 ?

    Old devices : (All devices that can play x264) Android 6+, TV Setup box, TV, Google chrome 48+

  • Why is ffmpeg transcoding speed going down over time ?

    24 mars 2021, par Nikola R.

    I'm executing basic ffmpeg command to transcode input MP4 video to output MP4 video (both using H264 as video codec, and stripping out audio, for simplicity):

    ffmpeg -i input-video.mp4 -b:v 20000k -an -vcodec libx264 output-video.mp4
    

    Transcoding is initially pretty fast (around 60-70 fps for first 20 or so frames), and then starts dropping steadily, ending at around 30 fps after 5000 frames.

    Is this inherent behavior? If so, why does it happen? Also, is there any better option for the command line that would improve speed (besides using -threads)?

    Would it be better to cut the input video and process it as smaller chunks, getting overall higher speed per sequence? (I'm afraid that chunking might affect encoder's RD optimization)

  • FFMPEG vs Gstreamer, performance/filesize ?

    10 février 2021, par kepitto

    I'm looking for a tool to record a udp stream and store it as efficiently as possible. So far I've tried gstreamer and ffmpeg. They key difference I noticed so far is that ffmpeg uses way less storage space while using the same codec.

    I capture a mjpeg stream and convert it to x264. Shouldn't x264 be the same compression regarding size accross platforms?

    Following commands were run:

    ffmpeg -i udp://192.168.2.100:52000 -c:v libx264 -c:a aac out.mp4

    filesize: 2,4MB/s
    avg cpu usage: 68%

    gst-launch-1.0 udpsrc port=52000 do-timestamp=true caps=image/jpeg,framerate=30/1 blocksize=4096 ! queue ! jpegparse ! queue ! jpegdec ! queue ! videoconvert ! x264enc ! queue ! matroskamux ! filesink location=x.mkv

    filesize: 12,5MB/s
    avg cpu usage: 95%

    There's no visual difference which get's noticed with bare eyes between the two videos.

    Why is there such a huge difference? Anything wrong with my pipelines or is ffmpeg just a better tool?
    Extra question: When doing these types of encoding, if i have an h264 hardware encoder on my cpu, is it used automatically or do I have to do something in order to enable that?

  • Generating all P frame intra refresh H264 with x264

    3 février 2021, par Andrew

    I am trying to generate a periodic intra refresh h264 stream with only P frames using ffmpeg and x264 but I always get an I frame at the start.

    Is there a way with x264 to create a P frame only stream?

    Commands I am using:

    ffmpeg -f lavfi -re -i testsrc=duration=5:size=1920x1080:rate=30000/1001 -s 1920x1080 -pix_fmt yuv420p -f rawvideo out.yuv
    x264 --input-res 1920x1080 --intra-refresh out.yuv --b-pyramid none -b 0 --ref 0  -o out.264
    

    Verification:

        ffprobe -show_frames out.264 |grep pict_type=I
    

    Or just looking at the x264 output e.g.

    yuv [info]: 1920x1080p 0:0 @ 25/1 fps (cfr)
    x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    x264 [info]: profile High, level 4.0, 4:2:0, 8-bit
    x264 [info]: frame I:1     Avg QP:13.63  size: 12189
    x264 [info]: frame P:149   Avg QP:13.59  size:   874
    x264 [info]: mb I  I16..4: 78.7% 18.6%  2.7%
    x264 [info]: mb P  I16..4:  2.3%  0.1%  0.0%  P16..4:  3.2%  0.3%  0.0%  0.0%  0.0%    skip:94.1%
    x264 [info]: 8x8 transform intra:7.6% inter:91.5%
    x264 [info]: coded y,uvDC,uvAC intra: 1.3% 18.9% 3.6% inter: 0.1% 1.1% 0.1%
    x264 [info]: i16 v,h,dc,p: 86%  6%  1%  7%
    x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 42% 22% 36%  0%  0%  0%  0%  0%  0%
    x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 30% 32%  3%  1%  3%  0%  3%  0%
    x264 [info]: i8c dc,h,v,p: 28%  7% 55%  9%
    x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
    x264 [info]: kb/s:189.96
    
    encoded 150 frames, 66.76 fps, 189.96 kb/s