| Q | A |
| --- | --- |
| Bug? | yes |
| New Feature? | no |
| Version Used | 0.6.1 |
| FFmpeg Version | avconv version 11.7-6:11.7-1~deb8u1 |
| OS | Debian 8.0.4 Jessie: Linux storage 3.16.0-4-amd64 1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux |
| PHP-Version | PHP 7.0.8-1~dotdeb+8.1 (cli) ( NTS ) |
PHP-FFMpeg is sending me a PHP Fatal Error.
PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffmpeg failed to execute command '/usr/bin/avconv' '-y' '-i' '/media/disk/git/video-encoding/videos/test.mkv' '-vcodec' 'libx264' '-acodec' 'libfaac' '-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-passes579341d3262b8kkw4s/pass-579341d32643e' '/media/disk/git/video-encoding/test-X264.mp4' in /media/disk/git/video-encoding/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100
Stack trace:
#0 /media/disk/git/video-encoding/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner->doExecutionFailure(''/usr/bin/avcon...')
#1 /media/disk/git/video-encoding/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php(209): Alchemy\BinaryDriver\ProcessRunner->run(Object( in /media/disk/git/video-encoding/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php on line 168
As I'm executing the command PHP-FFMpeg ran on the console I see that avconv is complaining about the audio-encoder libfaac.
avconv version 11.7-6:11.7-1~deb8u1, Copyright (c) 2000-2016 the Libav developers
built on Jun 12 2016 21:51:35 with gcc 4.9.2 (Debian 4.9.2-10)
Input #0, matroska,webm, from '/media/disk/git/video-encoding/videos/test.mkv':
Metadata:
title : Test
Duration: 01:45:28.41, start: 0.000000, bitrate: N/A
Chapter #0.0: start 0.000000, end 340.833000
Metadata:
title : 00:00:00.000
Chapter #0.1: start 340.833000, end 668.292000
Metadata:
title : 00:05:40.833
Chapter #0.2: start 668.292000, end 1032.917000
Metadata:
title : 00:11:08.292
Chapter #0.3: start 1032.917000, end 1354.958000
Metadata:
title : 00:17:12.917
Chapter #0.4: start 1354.958000, end 1688.792000
Metadata:
title : 00:22:34.958
Chapter #0.5: start 1688.792000, end 2050.625000
Metadata:
title : 00:28:08.792
Chapter #0.6: start 2050.625000, end 2318.333000
Metadata:
title : 00:34:10.625
Chapter #0.7: start 2318.333000, end 2693.333000
Metadata:
title : 00:38:38.333
Chapter #0.8: start 2693.333000, end 3001.583000
Metadata:
title : 00:44:53.333
Chapter #0.9: start 3001.583000, end 3366.125000
Metadata:
title : 00:50:01.583
Chapter #0.10: start 3366.125000, end 3669.292000
Metadata:
title : 00:56:06.125
Chapter #0.11: start 3669.292000, end 3989.250000
Metadata:
title : 01:01:09.292
Chapter #0.12: start 3989.250000, end 4294.542000
Metadata:
title : 01:06:29.250
Chapter #0.13: start 4294.542000, end 4621.167000
Metadata:
title : 01:11:34.542
Chapter #0.14: start 4621.167000, end 4957.375000
Metadata:
title : 01:17:01.167
Chapter #0.15: start 4957.375000, end 5262.750000
Metadata:
title : 01:22:37.375
Chapter #0.16: start 5262.750000, end 5578.417000
Metadata:
title : 01:27:42.750
Chapter #0.17: start 5578.417000, end 5871.458000
Metadata:
title : 01:32:58.417
Chapter #0.18: start 5871.458000, end 6027.542000
Metadata:
title : 01:37:51.458
Chapter #0.19: start 6027.542000, end 6328.417000
Metadata:
title : 01:40:27.542
Stream #0.0(eng): Video: h264 (High), yuv420p, 720x390 [PAR 1:1 DAR 24:13], 24 fps, 1k tbn, 48 tbc (default)
Stream #0.1(ger): Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s (default)
Unknown encoder 'libfaac'
I also ran that command with ajusted parameters ('aac' instead of 'libfaac') and got the following:
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Here is my execution log created with monolog:
[2016-07-23 10:07:14] Execution.INFO: ffprobe running command '/usr/bin/avprobe' '-help' '-loglevel' 'quiet' [] []
[2016-07-23 10:07:14] Execution.INFO: ffprobe executed command successfully [] []
[2016-07-23 10:07:14] Execution.INFO: ffprobe running command '/usr/bin/avprobe' '/media/disk/git/video-encoding/videos/test.mkv' '-show_streams' '-of' 'json' [] []
[2016-07-23 10:07:15] Execution.INFO: ffprobe executed command successfully [] []
[2016-07-23 10:07:15] Execution.INFO: ffmpeg running command '/usr/bin/avconv' '-y' '-i' '/media/disk/git/video-encoding/videos/test.mkv' '-vcodec' 'libx264' '-acodec' 'libfaac' '-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-passes579341d3262b8kkw4s/pass-579341d32643e' '/media/disk/git/video-encoding/test-X264.mp4' [] []
[2016-07-23 10:07:15] Execution.INFO: ffprobe running command '/usr/bin/avprobe' '/media/disk/git/video-encoding/videos/test.mkv' '-show_format' '-of' 'json' [] []
[2016-07-23 10:07:15] Execution.INFO: ffprobe executed command successfully [] []
[2016-07-23 10:07:15] Execution.ERROR: ffmpeg failed to execute command '/usr/bin/avconv' '-y' '-i' '/media/disk/git/video-encoding/videos/test.mkv' '-vcodec' 'libx264' '-acodec' 'libfaac' '-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-passes579341d3262b8kkw4s/pass-579341d32643e' '/media/disk/git/video-encoding/test-X264.mp4' [] []
Save my file to desired location encoded with the expected codec (H.264) in .mp4 format.
Transcode mkv video to .mp4 (H.264) with PHP-FFMpeg on my platform:
$this->video->save(new \FFMpeg\Format\Video\X264(), $path);
At this time now I kind of think, that PHP-FFMpeg got this "libfaac" from some kind of previous command with avprobe. If not: might some deprecated relation between AAC-codec and libfaac.
Same problem here. Just can convert to webm. x264 lib is installed.
System: Debian Jessie arm64
ffmpeg -version
ffmpeg version 3.0.2-4~bpo8+1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --prefix=/usr --extra-version='4~bpo8+1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-chromaprint --enable-libx264
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Problem solved by installing newer libraries from multimedia rep. About the frame images bug I've created a new issue:
https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/235
@Ninos What did you do to get this to work? I now fully recompiled FFMpeg v 3.2.1 from source on my machine with following options:
./configure --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libx265 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-nonfree
Though --enable-libfaac is not available with this FFMpeg version anymore.
Before that I installed all libraries:
apt install libmp3lame-dev libvorbis-dev libtheora-dev libspeex-dev yasm pkg-config libfaac-dev libopenjpeg-dev libx264-dev libx265-dev
To now have the following ffmpeg output:
ffmpeg version 3.2.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libx265 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-nonfree
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
And it still does not work!
What could I try next?
I now fixed this.
I followed #137 and changed the constructor for /src/FFMpeg/Format/Video/X264.php
I updated /src/FFMpeg/Format/Video/X264.php to:
22: - public function __construct($audioCodec = 'libfaac', $videoCodec = 'libx264')
22: + public function __construct($audioCodec = 'aac', $videoCodec = 'libx264')
54: - return array('libvo_aacenc', 'libfaac', 'libmp3lame', 'libfdk_aac');
54: + return array('libvo_aacenc', 'libfaac', 'libmp3lame', 'libfdk_aac', 'aac');
I may now file a Pull Request for that.
I just installed latest packages on my debian jessie machine to get my problem fixed. Thx for the changes. Is it possible to create a PR for that? :)
Maybe. But I also found a already existing PR. Look here for my changes: jankal/PHP-FFMpeg and this PR #222 should already start to fix this.
@Ninos which ffmpeg version do you use?
I'm using following version:
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-libfaac --enable-nonfree
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Using this version I only have following issue with mkv's:
Okay. @Ninos Then you are not affected. Should be starting at like FFMpeg 3.2 to get that problem. Libav is affacted too, as I see now.
Most helpful comment
I now fixed this.
I followed #137 and changed the constructor for
/src/FFMpeg/Format/Video/X264.phpI updated
/src/FFMpeg/Format/Video/X264.phpto:I may now file a Pull Request for that.