【问题标题】:How do I check video codec in Flutter?How do I check video codec in Flutter?
【发布时间】:2022-12-01 23:21:36
【问题描述】:

I am using flutter. I'm working on using a file-picker to select a video and then upload it. But I want to filter the video of h.265 codec, how can I do that?

It's frustrating because you can't filter codecs with just the mp4 extension.

I can't found method in VideoPlayerController. pls help. thx

【问题讨论】:

    标签: flutter dart video video-processing video-codecs


    【解决方案1】:

    You can use https://pub.dev/packages/ffmpeg_kit_flutter package.

    File file = File('/storage/emulated/0/folder_name/out.mp4');
    
    await FFprobeKit.getMediaInformation(file.path).then((info) async {
       if (information == 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  
    });
    

    You can try this one. this is the only option in flutter I think.

    【讨论】:

      猜你喜欢
      • 2022-12-04
      • 2022-01-04
      • 2022-12-27
      • 2022-12-01
      • 2022-12-01
      • 2022-12-01
      • 2022-12-27
      • 2022-12-16
      • 2022-11-09
      相关资源
      最近更新 更多