When php uses php-ffmpeg to convert a flv file to mp4 format, he reports an error. What's the problem?

my code:

$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open($save_path . "www.flv");
$format = new FFMpeg\Format\Video\X264();
$video->save($format, $save_path . "test.mp4");

report
error during execution: line 106 of Encoding failed;/home/ljg/workspace/tools.51safety/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractVideo.php; retro:

then I went to line 106 of debug to log out, and found that the command he executed was the following:

"/usr/local/bin/ffmpeg" "-y" "-i" "/home/ljg/workspace/tools.51safety/upload/anquanwuyouwang/professional/resource/learning/www.flv" "-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-passes5be4fc1ec9c1auy3kq/pass-5be4fc1ec9cae" "/home/ljg/workspace/tools.51safety/upload/anquanwuyouwang/professional/resource/learning/test.mp4"

then I execute this command separately under cli in ubuntu14.04. The error message is as follows:
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Nov 9 2018 11:02:30 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration:-- enable-nonfree-- enable-libfaac-- enable-gpl-- enable-libx264
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input-sharp0, flv, from"/ home/ljg/workspace/tools.51safety/upload/anquanwuyouwang/professional/resource/learning/www.flv":
Metadata:

major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf57.41.100

Duration: 003kb/s

, start: 0.017000, bitrate: 389

Stream -sharp0:0: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 29.97 tbr, 1k tbn, 59.94 tbc
Stream -sharp0:1: Audio: mp3, 22050 Hz, stereo, s16p, 64 kb/s

[libx264 @ 0x2c87b60] using SAR=1/1
[1] 3067 segmentation fault (core dumped)"/ usr/local/bin/ffmpeg""- y"- i""- vcodec" "libx264""-acodec" "libfaac"

means to sign up for a segmentation fault (core dumped) . What does it mean? Is my environment not well configured?

Jun.05,2022

have you ever encountered the problem of estimating the version of the basic library


Hello! I also encountered this problem. Do you still remember how to solve it?

Menu