Newest 'libx264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Ffmpeg libx264rgb and libx264 yuv444p gives very different results

    1er février 2020, par Mustafa Akın Yılmaz

    I am trying to create a lossy compressed video from several .png files. I am using the following ffmpeg commdans:

    ffmpeg -i %8d.png -frames:v 4 -c:v libx264rgb -pix_fmt rgb24 -g 4 -qp 30 -r 25 out.mp4
    

    and

    ffmpeg -i %8d.png -frames:v 4 -c:v libx264 -pix_fmt yuv444p -g 4 -qp 30 -r 25 out.mp4
    

    Then I am extracting frames from the videos with the command:

    ffmpeg -i out.mp4 -r 25 %8d.png
    

    When I compare the bitrate and PSNR, I found that the yuv444p gives about 2 db gain at the same bitrate. Why such a huge difference is observed even I did set yuv444p which does not apply chroma subsampling?

  • ffmpeg - How to configure ref param for h264_nvenc encoder

    31 janvier 2020, par ItamarP

    I'm trying to configure and replace libx264 encoder with h264_nvenc NVIDIA encoder. I want to replace the parameter -x264-params ref=4 with it's parallel nvenc parameter. I used ffmpeg -hide_banner -h encoder=h264_nvenc to see all available options but couldn't find any proper replacement. Any advice?

  • Unable to use FFMPEG to transcode video

    30 janvier 2020, par Mathew Paret

    I am getting the below error while transcoding videos automatically using nzbtomedia (https://github.com/clinton-hall/nzbToMedia/).

    Transcoder returned:b"Unknown encoder 'libx264'\n" has failed

    How do I install this encoder?

    Raspbain (Raspberry PI)

    Additional Info:

    FFMPEG Version

    ffmpeg version N-96192-g2ff687c17f Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 8 (Raspbian 8.3.0-6+rpi1)
    configuration: 
    libavutil      56. 38.100 / 56. 38.100
    libavcodec     58. 65.100 / 58. 65.100
    libavformat    58. 35.101 / 58. 35.101
    libavdevice    58.  9.101 / 58.  9.101
    libavfilter     7. 69.101 /  7. 69.101
    libswscale      5.  6.100 /  5.  6.100
    libswresample   3.  6.100 /  3.  6.100
    

    ffmpeg -encoders | grep 264

    ffmpeg version N-96192-g2ff687c17f Copyright (c) 2000-2019 the FFmpeg developers
      built with gcc 8 (Raspbian 8.3.0-6+rpi1)
      configuration: 
      libavutil      56. 38.100 / 56. 38.100
      libavcodec     58. 65.100 / 58. 65.100
      libavformat    58. 35.101 / 58. 35.101
      libavdevice    58.  9.101 / 58.  9.101
      libavfilter     7. 69.101 /  7. 69.101
      libswscale      5.  6.100 /  5.  6.100
      libswresample   3.  6.100 /  3.  6.100
     V..... h264_v4l2m2m         V4L2 mem2mem H.264 encoder wrapper (codec h264)
    
  • FFMPEG : Stream in Stream aka Picture in Picture

    29 janvier 2020, par F O X

    Any chance that i could make picture in picture with ffmpeg (ubuntu)?

    My single stream is working with this command very well:

    ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i rtsp://.......... -b:v 800k -maxrate 900k -bufsize 600k -vcodec copy -crf 35 -preset veryfast -pix_fmt + -c:a aac -f flv rtmp://a.rtmp.youtube.com/live2/........

    Tried several ideas but all of them are using libx264 instead of just -vcodec copy and i don't know why but with libx264 my bitrate stream and fps are terrible low. So is there any way to just copy both streams and scale one of them to lowerleft corner?

    photo here

    Of course i would be using two different streams.

  • Recording with libx264 results in audio muting prior to recording being stopped depending on preset

    24 janvier 2020, par Pyon
    ffmpeg -thread_queue_size 512 -f dshow -i audio="AudioDevice" -thread_queue_size 512 -f gdigrab -rtbufsize 100000000 -hwaccel auto -framerate 60 -offset_x 332 -offset_y 720 -video_size 340x162 -probesize 10000000 -i desktop -c:v libx264 -preset veryslow -crf 23 -pix_fmt yuv420p "output.mp4"
    

    I'm using the above command to record desktop video/audio in a defined region. The video is being recorded using gdigrab while the audio is being recorded using dshow with a custom loopback driver.

    When the libx264 preset is set to anything below "ultrafast" like "veryslow", the audio will be muted around 80% into the recording (varies depending on video size and the preset selected, worsening for slower presets). By muted I mean: If I record a 10 second video, the video will be 10 seconds in length but the audio will only be audible for the first 8 seconds.

    I'm not really sure what could be causing this, but is there any way around it?

    Below are simplified versions which produces same results..

    Veryslow preset (audio issue):

    ffmpeg -thread_queue_size 512 -f dshow -i audio="PriAudio" -thread_queue_size 512 -f gdigrab -i desktop -c:v libx264 -preset veryslow -crf 23 -pix_fmt yuv420p "output.mp4"
    

    Ultrafast preset (no audio issue):

    ffmpeg -thread_queue_size 512 -f dshow -i audio="PriAudio" -thread_queue_size 512 -f gdigrab -i desktop -c:v libx264 -preset ultrafast -crf 23 -pix_fmt yuv420p "output.mp4"
    

    I don't want to use ultrafast because it results in poor quality/compression ratio.