已关闭
rawvideo pipe实时流有问题 #4
Asia52创建于  2025年7月15日关闭于  2025年8月15日
Asia52
Asia52
2025年7月15日 创建

FFmpegKit.executeAsync("-y -f rawvideo -pixel_format rgba -video_size image.widthx{image.width}x{image.width} -framerate $fps -i $pipe -c:v libx264 -g 5 -pix_fmt yuv420p -preset superfast -q 11 $path")
FFmpegKitConfig.registerNewFFmpegPipe().then((pipe) async {
_pipeWriter = File(pipe!).openWrite();

  FFmpegKit.executeAsync("-y -f rawvideo -pixel_format rgba -video_size ${image.width}x${image.width} -framerate $fps -i $pipe -c:v libx264 -g 5 -pix_fmt yuv420p -preset superfast -q 11 $path", (FFmpegSession session) async {
    _pipeWriter?.close();
    _pipeWriter = null;

    FFmpegKitConfig.closeFFmpegPipe(pipe);

    _isRecording = false;
    notifyListeners();

    if (Platform.isAndroid) {
      Future.delayed(const Duration(milliseconds: 300)).then((_) => PlatformPlugin.scanFile(path));
    }

    findLastImagePath();
  });

  Timer.periodic(const Duration(milliseconds: 50), (timer) {
    if (!_isRecording) {
      timer.cancel();
      return;
    }

    _getRenderImage()?.toByteData(format: ui.ImageByteFormat.rawRgba).then((value) {
      _pipeWriter?.add(value!.buffer.asUint8List());
    });

    frameIndex++;
    var recordTime = frameIndex ~/ fps;
    if (recordTime != _recordTime) {
      _recordTime = recordTime;
      notifyListeners();
    }
  });
}, onError: (_) {
  _isRecording = false;
  notifyListeners();
});

}

likedislike
哪都通哪都通成员
2025年7月18日 将 HDJKER 设为负责人
哪都通
哪都通成员
2025年7月22日 评论:

之前ffmpeg没加libx264,现在加上去了,用 1.0.3-rc1分支试一试

likedislike
哪都通哪都通成员
2025年7月24日 关联了pull request:feat: 支持更多 FFmpeg 能力
哪都通哪都通成员
2025年8月15日 关闭了 issue