我用的是颤音。我正在使用文件选择器选择一个视频,然后上传它。但是我想过滤h.265编解码器的视频,我怎么做呢?
这是令人沮丧的,因为您不能只过滤mp4扩展的编解码器。
我在VideoPlayerController中找不到方法。请帮帮忙。thx
发布于 2022-12-01 14:43:16
您可以使用https://pub.dev/packages/ffmpeg_kit_flutter包。
File file = File('/storage/emulated/0/folder_name/out.mp4');
await FFprobeKit.getMediaInformation(file.path).then((info) async {
if (info== null) {
// CHECK THE FOLLOWING ATTRIBUTES ON ERROR
final state = FFmpegKitConfig.sessionStateToString(await session.getState());
final returnCode = await session.getReturnCode();
final failStackTrace = await session.getFailStackTrace();
final duration = await session.getDuration();
final output = await session.getOutput();
print(
"State: $state,ReturnCode: $returnCode,FailStackTrace: $failStackTrace,Duration: $duration, 0utPut: $output",
);
}
Map<dynamic, dynamic>? properties = info.getAllProperties();
print(properties); //this will print all data
});你可以试试这个。我认为这是唯一的选择。
https://stackoverflow.com/questions/74640179
复制相似问题