Newest 'libx264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Lib x : display problem related to window pixel color changes with the mlx_put_pixel() function [closed]

    15 janvier 2023, par Jordan Riga

    I'm stuck on a project that I have to return for school. I have to make a 3D game with the minilibx in C, the problem being that I try to make the graphic part work but it doesn't work (display pixels on the screen). And all this same with the examples that I found of school 42 on the internet in that link https://harm-smits.github.io/42docs/libs/minilibx. All configuration has been done.

    Could there be a possible configuration problem? I'm working on Kali Linux (Even using a VM on Ubuntu it didn't work).

    In short my question is what can be the different reasons why the graphical part of minilibx independently of events, loops and etc does not work without errors ?

  • libx264 codex not enabled in ffmpeg ubuntu 18.04

    23 novembre 2022, par Bendemann

    I have some weird codex installation issues with the following docker image.

    ARG PYTORCH="1.8.0"
    ARG CUDA="11.1"
    ARG CUDNN="8"
    FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
    
    ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 8.0+PTX"
    ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
    ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"
    
    # https://github.com/NVIDIA/nvidia-docker/issues/1632
    RUN apt-key del 7fa2af80
    RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
    RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub
    
    RUN apt-get update && apt-get install -y \
            git nano ninja-build p7zip-full imagemagick wget unzip \
            libglib2.0-0 libsm6 libxrender-dev libxext6 libturbojpeg \
            libxrender1 libfontconfig1 freeglut3-dev llvm-6.0-tools curl \
            amqp-tools ffmpeg libx264-dev \
        && apt --fix-broken install \
        && apt-get clean \
        && rm -rf /var/lib/apt/lists/* \
        # for visualizing
        && wget https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb \
        && dpkg -i ./mesa_18.3.3-0.deb || true \
        && apt install -f \
        && git clone https://github.com/mmatl/pyopengl.git \
        && pip install ./pyopengl
    

    First of all, libx264 is supposed to be installed by a simple apt-get install ffmpeg in ubuntu 18.04.5. Indeed I see that it is being installed in the installation instructions but for some reason, it's not enabled. This is confirmed when running ffmpeg -codecs | grep 264, which doesn't show libx264 (only h264, libopenh264 are there).

    In addition, I also compiled from source, explicitly enabling libx264 during installation. It didn't make a difference.

  • ERROR : X264 not found ustng pkg-config FFMPEG

    27 octobre 2022, par A GV

    I’m having lots of problems with Ffmpeg because it doesn’t recognize the options I use. I tried three different versions and none of them work. I finally installed the last version which is available (5.1) but when I used options like -present or -cq: 1 it tells that they are not recognize. I saw some others questions about, and the problem was that the libx264 was not enable.

    I tried to enable the lib (./configure —- enable gpl —-enable libx264) but it came out with: ERROR: X264 not found ustng pkg-config.

    I’m working on Linux Ubuntu.

  • How to cut video into 4M size mp4 video using ffmpeg

    13 octobre 2022, par fxsshiwo

    I have a *.mp4 video file, which is cut to a fixed size using ffmpeg, using the following commands

    '/usr/local/ffmpeg/bin/ffmpeg' '-y' '-ss' '00:00:00.00' '-i' '57066524-1.mp4' '-t' '00:00:05.00' '-vcodec' 'libx264' '-acodec' 'libmp3lame' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes6332bdc9814883qh89/pass-6332bdc98160c' '1.mp4'

    but I get an error saying -

    Unknown encoder 'libx264'

    Here is the complete error message:

    ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers
      built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
      configuration: --enable-shared --enable-swscale --enable-gpl --enable-nonfree --enable-pic --prefix=/usr/local/ffmpeg --enable-version3 --enable-postproc --enable-pthreads --enable-static --enable-libx264
      libavutil      57. 28.100 / 57. 28.100
      libavcodec     59. 37.100 / 59. 37.100
      libavformat    59. 27.100 / 59. 27.100
      libavdevice    59.  7.100 / 59.  7.100
      libavfilter     8. 44.100 /  8. 44.100
      libswscale      6.  7.100 /  6.  7.100
      libswresample   4.  7.100 /  4.  7.100
      libpostproc    56.  6.100 / 56.  6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '57066524-1.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 0
        compatible_brands: mp42mp41
        creation_time   : 2022-09-26T02:06:24.000000Z
      Duration: 00:00:26.11, start: 0.000000, bitrate: 6683 kb/s
      Stream #0:0[0x1](eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 720x720 [SAR 1:1 DAR 1:1], 6367 kb/s, 25 fps, 25 tbr, 25k tbn (default)
        Metadata:
          creation_time   : 2022-09-26T02:06:24.000000Z
          handler_name    : ?Mainconcept Video Media Handler
          vendor_id       : [0][0][0][0]
          encoder         : AVC Coding
      Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
        Metadata:
          creation_time   : 2022-09-26T02:06:24.000000Z
          handler_name    : #Mainconcept MP4 Sound Media Handler
          vendor_id       : [0][0][0][0]
    Unknown encoder 'libx264'
    
    

    I try to install libx264 and recompile, I still get this error

    [install libx264]
    git clone https://code.videolan.org/videolan/x264.git
    cd x264
    ./configure --prefix=/usr/local/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared
    ./configure --prefix=/usr/softinstall/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared
    
    [compile ffmpeg]
    wget http://www.ffmpeg.org/releases/ffmpeg-5.1.tar.gz
    tar -zxvf ffmpeg-5.1.tar.gz
    cd ffmpeg-5.1
    ./configure --enable-shared --enable-swscale --enable-gpl --enable-nonfree --enable-pic --prefix=/usr/local/ffmpeg --enable-version3 --enable-postproc --enable-pthreads --enable-static --enable-libx264 --enable-libmp3lame
    

    My questions :

    1. How to install ffmpeg with libx264
    2. How to cut video into fixed size with ffmpeg
  • ffmpeg conversion x264 [error] : malloc of size 769152 failed

    4 octobre 2022, par prashanthp

    I am trying to convert video recorded from Android smart watch (.mp4 format) to a format (.mp4) which playable on all browsers. The video recorded from smart watch is not playing in the browsers. so, i've used ffmpeg to convert in into a playable mp4 format.

    But sometimes it is showing error as x264 [error]: malloc of size 503008 failed

    What is the reason for this. Sometimes it's getting converted and sometimes it is showing error .

    Here is the console output.

     /usr/local/ffmpeg_build/ffmpeg/bin/ffmpeg  -i /home/xestatt1/public_html/app/webroot/mobile/uploads/in/Dec152014161945.mp4 -vcodec libx264   -r 24 -s 352*288 -acodec aac  -ab 12k -strict -2  /home/xestatt1/public_html/app/webroot/mobile/uploads/out/ot12.mp4
    
    ffmpeg version 2.5.git Copyright (c) 2000-2014 the FFmpeg developers
      built on Dec 13 2014 05:42:08 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-55)
      configuration: --prefix=/usr/local/ffmpeg_build/ffmpeg --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/ffmpeg_build/x264/include --extra-ldflags=-L/usr/local/ffmpeg_build/x264/lib
      libavutil      54. 15.100 / 54. 15.100
      libavcodec     56. 14.100 / 56. 14.100
      libavformat    56. 15.103 / 56. 15.103
      libavdevice    56.  3.100 / 56.  3.100
      libavfilter     5.  2.103 /  5.  2.103
      libswscale      3.  1.101 /  3.  1.101
      libswresample   1.  1.100 /  1.  1.100
      libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/xestatt1/public_html/app/webroot/mobile/uploads/in/Dec152014161945.mp4':
      Metadata:
        major_brand     : 3gp4
        minor_version   : 0
        compatible_brands: isom3gp4
        creation_time   : 2014-12-15 10:50:02
      Duration: 00:00:10.12, start: 0.000000, bitrate: 151 kb/s
        Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 135 kb/s, 13.14 fps, 50 tbr, 90k tbn, 200 tbc (default)
        Metadata:
          creation_time   : 2014-12-15 10:50:02
          handler_name    : VideoHandle
          encoder         :
        Stream #0:1(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default)
        Metadata:
          creation_time   : 2014-12-15 10:50:02
          handler_name    : SoundHandle
    File '/home/xestatt1/public_html/app/webroot/mobile/uploads/out/ot12.mp4' already exists. Overwrite ? [y/N] y
    [libx264 @ 0x13b69120] using SAR=12/11
    [libx264 @ 0x13b69120] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
    [libx264 @ 0x13b69120] profile High, level 1.3
    [libx264 @ 0x13b69120] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 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=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '/home/xestatt1/public_html/app/webroot/mobile/uploads/out/ot12.mp4':
      Metadata:
        major_brand     : 3gp4
        minor_version   : 0
        compatible_brands: isom3gp4
        encoder         : Lavf56.15.103
        Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 352x288 [SAR 12:11 DAR 4:3], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
        Metadata:
          creation_time   : 2014-12-15 10:50:02
          handler_name    : VideoHandle
          encoder         : Lavc56.14.100 libx264
        Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 8000 Hz, mono, fltp, 12 kb/s (default)
        Metadata:
          creation_time   : 2014-12-15 10:50:02
          handler_name    : SoundHandle
          encoder         : Lavc56.14.100 aac
    Stream mapping:
      Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
      Stream #0:1 -> #0:1 (amr_nb (amrnb) -> aac (native))
    Press [q] to stop, [?] for help
    Past duration 1.000000 too large
    Multiple frames in a packet from stream 1
    Past duration 1.000000 too large
    av_interleaved_write_frame(): Cannot allocate memory
    x264 [error]: malloc of size 769152 failed
    Video encoding failed
    [libx264 @ 0x13b69120] frame I:1     Avg QP:22.20  size:  3166
    [libx264 @ 0x13b69120] mb I  I16..4: 28.3% 70.5%  1.3%
    [libx264 @ 0x13b69120] 8x8 transform intra:70.5%
    [libx264 @ 0x13b69120] coded y,uvDC,uvAC intra: 47.5% 55.3% 12.4%
    [libx264 @ 0x13b69120] i16 v,h,dc,p: 16% 26%  6% 52%
    [libx264 @ 0x13b69120] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 19% 15% 12%  3%  3%  3%  5% 16%
    [libx264 @ 0x13b69120] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16%  2% 20% 10% 16% 14%  4% 11%  6%
    [libx264 @ 0x13b69120] i8c dc,h,v,p: 61% 17% 19%  4%
    [libx264 @ 0x13b69120] kb/s:607.87
    [aac @ 0x13b6a4c0] 2 frames left in the queue on closing
    Conversion failed!
    

    UPDATED

    When i execute this from shell it is working fine. But when i create a script file and trying to execute that script file from php , it is showing error's. I increased the memory limit in php, still it is showing error. Also , we are using ZEND framework. Is there any problems with ZEND??