我正在使用 FFmpeg 转换和压缩视频。一切都可以正常转换/压缩,但是当我尝试在移动设备上播放时,我的视频没有声音。但是当我在桌面上播放时它有声音。我不知道这是否与我使用的编解码器有关,我不知道。有人能帮我吗?我很感激。谢谢你。
我在 FFmpeg 中使用的格式:
$request->video->move(public_path('/app'), $filename);
$name_file=uniqid().'intro_video.mp4';
$ffp=FFMpeg::open($filename)
->addFilter(function ($filters) {
$filters->resize(new \FFMpeg\Coordinate\Dimension(640, 480));
})
->export()
->toDisk('s3')
->inFormat(new \FFMpeg\Format\Audio\Aac)
->save($name_file);
最佳答案
对于 FFmpeg 4.0 版,您需要将代码从
inFormat(new \FFMpeg\Format\Audio\Aac)
至
inFormat(new \FFMpeg\Format\Video\X264('aac', 'libx264'))
我希望这有帮助。
关于laravel - 使用 FFmpeg 转换和压缩视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53484480/