chipweinberger / flutter_quick_video_encoder

Quickly encode raw RGB images & PCM audio to MP4 video using the hardware h264 encoder
The Unlicense
7 stars 0 forks source link

iPhone: SampleBufferAppendFailed #1

Closed jtkeyva closed 7 months ago

jtkeyva commented 7 months ago

Getting this running the example

flutter: Error: PlatformException(SampleBufferAppendFailed, Failed to append video sample buffer, The operation could not be completed, null)

chipweinberger commented 7 months ago

wow love how quickly you are already using this plugin =)

I was getting that error too and I needed to make sure the output directory actually existed.

can you try adding this code and then opening a PR?

  void _createIntermediateDirectories(String filepath) {
    File file = File(filepath);
    Directory dir = file.parent;
    if (!dir.existsSync()) {
      dir.createSync(recursive: true);
    }
  }
chipweinberger commented 7 months ago

should be fixed in 1.0.2 now

jtkeyva commented 7 months ago

yeah thanks for doing this. i'm excited about this and eliminating ffmpeg. media_tool seems cool too but still in early stages.

i'm still getting the same error in 1.0.4

i may make an example using the camera and share_plus package or something to show the original file size and the new encoded size

chipweinberger commented 7 months ago

I haven't tested ios yet. only mac.

so maybe there's some difference

jtkeyva commented 7 months ago

anything i can do to help?

chipweinberger commented 7 months ago

if you find the problem open a PR :)

chipweinberger commented 7 months ago

iOS is now fixed in 1.1.0