I need to use php-ffmpeg to convert some other formats of video files into mp4 format files, please help!

1. My development environment is ubuntu14.04,php version 7.1
2. I have installed php-ffmpeg, on composer. Here is my test code:

$save_path = DOCROOT . "upload/anquanwuyouwang/professional/resource/learning/";
$path = [
    "ffmpeg.binaries" => "/usr/local/bin/ffmpeg",
    "ffprobe.binaries" => "/usr/local/bin/ffprobe"
];
$ffmpeg = FFMpeg\FFMpeg::create($path);
$video = $ffmpeg->open($save_path . "cz.flv");
$format = new FFMpeg\Format\Video\X264();
$format->on("progress", function ($video, $format, $percentage) {
    echo "$percentage % transcoded";
});
$video->save($format, $save_path . "test.mp4");

when executing, an error is reported:
error message: Encoding failed
File: / home/ljg/workspace/tools.51safety/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractVideo.php, Line 104

is my local ffmpeg installation. Is there a problem? I searched a lot of information on the Internet, there are all kinds of dependent packages, such as what xh264,libfaac, etc., I installed better, but still reported an error, looking for the correct installation method to meet my need to convert video to mp4 format.
Please give detailed steps, if there is an installation package, please give the download link, thank you!

Nov.24,2021

now the official "libfaac" code has been removed, so the default code cannot be used, and the original code is replaced by "libfdk_aac". Therefore, when you new here, you should use a new code: new FFMpegFormatVideoX264 ('libfdk_aac');
, when you install it at the same time, take this option-- with-fdk-aac

.

refer to this article for details.
https://codeshelper.com/a/11.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea42eb-1cb6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea42eb-1cb6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?