Recherche avancée

Médias (1)

Mot : - Tags -/stallman

Sur d’autres sites (24)

  • FFMpeg with PHP-7.0 on Ubuntu

    25 octobre 2018, par Gabriel Bueno Lemes da Silva

    I have a NGINX server with PHP-7.0 and I would like to install the ffmpeg-php extension. I’ve been trying for a few days now and in many ways.

    The method that worked so far was compiling ffmpeg (https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2) manually, but when trying to compile ffmpeg-php (https: // sourceforge. net / projects / ffmpeg-php / files / ffmpeg-php / 0.6.0 / ffmpeg-php-0.6.0.tbz2 / download) I am encountering the following error message :

    root@zumbiserver-mercury : /php7-ffmpeg# make /bin/bash

    /root/php7-ffmpeg/libtool —mode=compile cc -I. -I/root/php7-ffmpeg
    -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /root/php7-ffmpeg/ffmpeg-php.c -o ffmpeg-php.lo libtool : compile : cc
    -I. -I/root/php7-ffmpeg -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /root/php7-ffmpeg/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o In
    file included from /usr/include/x86_64-linux-gnu/sys/stat.h:104:0,
    from /usr/include/php/20151012/Zend/zend_stream.h:28,
    from /usr/include/php/20151012/Zend/zend.h:41,
    from /usr/include/php/20151012/main/php.h:36,
    from /root/php7-ffmpeg/ffmpeg-php.c:40 : /usr/include/x86_64-linux-gnu/bits/stat.h:91:21 : error : field
    ‘st_atim’ has incomplete type
    struct timespec st_atim ; /* Time of last access. /
    ^ /usr/include/x86_64-linux-gnu/bits/stat.h:92:21 : error : field
    ‘st_mtim’ has incomplete type
    struct timespec st_mtim ; /
    Time of last modification. /
    ^ /usr/include/x86_64-linux-gnu/bits/stat.h:93:21 : error : field
    ‘st_ctim’ has incomplete type
    struct timespec st_ctim ; /
    Time of last status change. /
    ^ /usr/include/x86_64-linux-gnu/bits/stat.h:152:21 : error : field
    ‘st_atim’ has incomplete type
    struct timespec st_atim ; /
    Time of last access. /
    ^ /usr/include/x86_64-linux-gnu/bits/stat.h:153:21 : error : field
    ‘st_mtim’ has incomplete type
    struct timespec st_mtim ; /
    Time of last modification. /
    ^ /usr/include/x86_64-linux-gnu/bits/stat.h:154:21 : error : field
    ‘st_ctim’ has incomplete type
    struct timespec st_ctim ; /
    Time of last status change. /
    ^ In file included from /usr/include/php/20151012/Zend/zend_stream.h:28:0,
    from /usr/include/php/20151012/Zend/zend.h:41,
    from /usr/include/php/20151012/main/php.h:36,
    from /root/php7-ffmpeg/ffmpeg-php.c:40 : /usr/include/x86_64-linux-gnu/sys/stat.h:364:31 : error : array type has
    incomplete element type ‘struct timespec’
    const struct timespec __times[2],
    ^ /usr/include/x86_64-linux-gnu/sys/stat.h:371:54 : error : array type has
    incomplete element type ‘struct timespec’ extern int futimens (int
    __fd, const struct timespec __times[2]) __THROW ;
    ^ In file included from /usr/include/php/20151012/main/php.h:395:0,
    from /root/php7-ffmpeg/ffmpeg-php.c:40 : /usr/include/php/20151012/Zend/zend_virtual_cwd.h:218:2 : error :
    unknown type name ‘time_t’ time_t expires ;
    ^ /usr/include/php/20151012/Zend/zend_virtual_cwd.h:248:86 : error :
    unknown type name ‘time_t’ CWD_API realpath_cache_bucket

    realpath_cache_lookup(const char *path, int path_len, time_t t) ;
    ^ /root/php7-ffmpeg/ffmpeg-php.c : In function ‘zm_startup_ffmpeg’ :
    /root/php7-ffmpeg/ffmpeg-php.c:108:5 : warning : implicit declaration of
    function ‘avcodec_init’ [-Wimplicit-function-declaration]
    avcodec_init() ;
    ^ /root/php7-ffmpeg/ffmpeg-php.c:111:5 : warning : ‘av_register_all’ is deprecated [-Wdeprecated-declarations]
    av_register_all() ;
    ^ In file included from /root/php7-ffmpeg/ffmpeg-php.c:43:0 : /usr/local/include/libavformat/avformat.h:2025:6 : note : declared here
    void av_register_all(void) ;

     ^ Makefile:194: recipe for target 'ffmpeg-php.lo' failed make: *** [ffmpeg-php.lo] Error 1

    Can someone give me a light ? I do not know what else to do !

  • FFmpeg error : ratecontrol_init : can't open stats file

    6 octobre 2017, par oldo.nicho

    I’ve setup an AWS EC2 instance running Ubuntu 14.04 and have installed FFmpeg so that I can compress and transcode video.

    I’m trying to do a two pass conversion with the following code :

    ffmpeg -i input-file.avi -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=702:-1 -threads 0 -pass 1 -an -f mp4 ~/encoded/null

    and second pass :

    ffmpeg -i input-file.avi -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=702:-1 -threads 0 -pass 2 -codec:a libfdk_aac -b:a 128k -f mp4 output-file.mp4

    However I get the following error :

    ffmpeg version N-77283-g91c2a33 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
     configuration: --prefix=/home/ubuntu/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/ubuntu/ffmpeg_build/include --extra-ldflags=-L/home/ubuntu/ffmpeg_build/lib --bindir=/home/ubuntu/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree
     libavutil      55. 11.100 / 55. 11.100
     libavcodec     57. 17.100 / 57. 17.100
     libavformat    57. 20.100 / 57. 20.100
     libavdevice    57.  0.100 / 57.  0.100
     libavfilter     6. 21.100 /  6. 21.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    Input #0, avi, from 'input-file.avi':
     Duration: 01:18:05.29, start: 0.000000, bitrate: 2025 kb/s
       Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 720x480 [SAR 1:1 DAR 3:2], 1789 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
       Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 224 kb/s
    [libx264 @ 0x1e04240] using SAR=1/1
    [libx264 @ 0x1e04240] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x1e04240] ratecontrol_init: can't open stats file
    Output #0, mp4, to '/home/ubuntu/encoded/null':
       Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 29.97 fps
       Metadata:
         encoder         : Lavc57.17.100 libx264
    Stream mapping:
     Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    The command as written above works fine on my local computer (running OSX). Would anyone have any suggestions as to how to fix this problem ?

  • ffmpeg - Concat multi mp4 files with audio file not working

    29 mars 2017, par Thanh Dao

    I follow this thread to concat multi mp4 files with audio file.
    But its not success. Have a lots error notifications had been displayed. I dont know how to fix it.
    Below is my command :

    "ffmpeg" -f concat -safe 0 \
    -i /path/to/text.txt \
    -i /path/to/audio.mp3 -vsync vfr -vf scale="640:640" -pix_fmt yuv420p \
    /path/to/output.mp4 2>&1

    The detail contents of text.txt

    file '/path/to/file1.mp4'
    file '/path/to/file2.mp4'
    file '/path/to/file3.mp4'
    file '/path/to/file4.mp4'
    file '/path/to/file5.mp4'
    file '/path/to/file6.mp4'
    file '/path/to/file7.mp4'
    file '/path/to/file8.mp4'
    file '/path/to/file9.mp4'
    file '/path/to/file10.mp4'
    file '/path/to/file11.mp4'
    file '/path/to/file12.mp4'
    file '/path/to/file13.mp4'
    file '/path/to/file14.mp4'
    file '/path/to/file15.mp4'
    file '/path/to/file16.mp4'
    file '/path/to/file17.mp4'
    file '/path/to/file18.mp4'

    And some lines of output errors :

    [concat @ 0x357e620] DTS 192000 < 229888 out of order
    [h264 @ 0x36920e0] top block unavailable for requested intra mode -1
    [h264 @ 0x36920e0] error while decoding MB 32 0
    [h264 @ 0x36920e0] concealing 2025 DC, 2025 AC, 2025 MV errors in I frame
    [h264 @ 0x36b7a80] concealing 1449 DC, 1449 AC, 1449 MV errors in P frame
    [h264 @ 0x36ff440] corrupted macroblock 26 1 (total_coeff=-1)
    [h264 @ 0x36ff440] error while decoding MB 26 1
    [h264 @ 0x36ff440] concealing 2003 DC, 2003 AC, 2003 MV errors in P frame
    [h264 @ 0x371af40] concealing 1456 DC, 1456 AC, 1456 MV errors in P frame
    [h264 @ 0x3736a40] ref 5 overflow
    [h264 @ 0x3736a40] error while decoding MB 1 1
    [h264 @ 0x3736a40] concealing 2025 DC, 2025 AC, 2025 MV errors in P frame
    [h264 @ 0x3752520] concealing 1449 DC, 1449 AC, 1449 MV errors in P frame
    [h264 @ 0x376dfa0] P sub_mb_type 8 out of range at 2 1
    [h264 @ 0x376dfa0] error while decoding MB 2 1
    [h264 @ 0x376dfa0] concealing 2025 DC, 2025 AC, 2025 MV errors in P frame
    [h264 @ 0x37a55a0] ref 6 overflow
    [h264 @ 0x37a55a0] error while decoding MB 3 1
    [h264 @ 0x37a55a0] concealing 2025 DC, 2025 AC, 2025 MV errors in P frame
    [h264 @ 0x3789aa0] concealing 1449 DC, 1449 AC, 1449 MV errors in P frame
    [h264 @ 0x36b7a80] ref 5 overflow
    [h264 @ 0x36b7a80] error while decoding MB 4 1
    [h264 @ 0x36b7a80] concealing 2025 DC, 2025 AC, 2025 MV errors in P frame
    [h264 @ 0x36920e0] concealing 1449 DC, 1449 AC, 1449 MV errors in P frame