首页 > 解决方案 > Flutter ffmpeg:视频合并不起作用

问题描述

我一直在尝试在颤振中使用 ffmpeg 合并两个视频文件,但是一个视频文件合并了两次并且视频的声音不起作用

这是我的代码

 final appDir = await getExternalStorageDirectory();
 String rawDocumentPath = appDir!.path;
 final outputPath = '$rawDocumentPath/videomerge.mp4';

 final FlutterFFmpeg _flutterFFmpeg = new FlutterFFmpeg();

 String commandToExecute = '-y -i ${VideoFiles[0].path} -i ${VideoFiles[1].path} 
  -filter_complex \'[0:v][0:v]concat=n=2:v=1:a=0[out]\' -map \'[out]\' $outputPath';

 _flutterFFmpeg.execute(commandToExecute).then((rc) => print("FFmpeg process exited with 
 rc $rc"));

任何帮助将不胜感激 :)

标签: flutterdartffmpegflutter-dependenciesvideo-editing

解决方案


推荐阅读