flutter_fbstorage_video_upload icon indicating copy to clipboard operation
flutter_fbstorage_video_upload copied to clipboard

Video Uploading issues

Open bsurji opened this issue 5 years ago • 12 comments
trafficstars

I tested it on an Android Simulator when downloading an MP4 video online and uploading it uploads fine but when uploading a video in the gallery recorded from the phone the video uploads but the VideoURL goes blank and outputs the following error:

I/flutter (22003): Too many packets buffered for output stream 0:1. I/flutter (22003): Conversion failed! I/flutter (22003): 'package:/models/encoder_provider.dart': Failed assertion: line 32 pos 12: 'rc == 0': is not true.

When running it on an ios simulator it does nothing after the video finishes compressing and gives me the error I posted previously:

flutter: NoSuchMethodError: The method '/' was called on null. Receiver: null Tried calling: /(null)

If you could support me in this matter I would highly appreciate it.

Kind Regards,

bsurji avatar Jun 19 '20 11:06 bsurji

Hi @bsurji , Did you get this error when running the code of this repo with no modifications?

syonip avatar Jun 19 '20 15:06 syonip

Hey @syonip,

Yes I am receiving this error when running the code of the Gallery Branch repo with no modifications done at all.

bsurji avatar Jun 20 '20 15:06 bsurji

Hey @syonip,

I hope you are well. I managed to fix the issue, when choosing from gallery the Aspect Ratio goes Null.

Kind Regards,

bsurji avatar Jun 23 '20 17:06 bsurji

That's weird, doesn't happen on my device. Maybe its a simulator issue? Glad to hear you fixed it :)

syonip avatar Jun 23 '20 18:06 syonip

I have wrote the code about flutter firebase storage video upload same as with your code , and it could run normally. But if I uploaded video, the command will show like this

I/flutter (17533): NoSuchMethodError: The getter 'path' was called on null. I/flutter (17533): Receiver: null I/flutter (17533): Tried calling: path

How to solve this problem ?

tua2542 avatar Jul 03 '20 14:07 tua2542

@tua2542 Did you try to debug? Which object is null?

syonip avatar Jul 12 '20 06:07 syonip

I/flutter (13327): Too many packets buffered for output stream 0:1. I/flutter (13327): Conversion failed! I/flutter (13327): 'package:flutter_video_sharing/apis/encoding_provider.dart': Failed assertion: line 31 pos 12: 'rc == 0': rc value is 1

I got the same issue above, it sometimes works fine but sometimes gives error like that. I don't know what exactly cause this problem.

hyobbb avatar Aug 26 '20 05:08 hyobbb

Hi @hyobbb , According to this SO question: https://stackoverflow.com/questions/49686244/ffmpeg-too-many-packets-buffered-for-output-stream-01 It looks like an issue with ffmpeg. You can try the solution suggested there.

syonip avatar Aug 26 '20 07:08 syonip

Hi @syonip Thank you. I added '-max_muxing_queue_size 1024' and seems like it works well.

but while I grab video with my AVD simulator camera module it doesn't play the video after recording and while processing video log says its duration is almost an hour although I just recorded 3sec. Maybe there's a bug in my simulator. I will let you know if I figure it out.

hyobbb avatar Aug 26 '20 07:08 hyobbb

Yeah I've also had that happen in the emulator, if you use an actual device it shouldn't happen

syonip avatar Aug 26 '20 08:08 syonip

@syonip somehow width and height comes on another stream on ios.

 double getAspectRatio(Map<dynamic, dynamic> info) {
    final int width = getWidth(info);
    final int height = getHeight(info);
    final double aspect = height / width;
    return aspect;
  }

  int getWidth(Map<dynamic, dynamic> info) {
    final int width = info['streams'][0]['width'] ?? info['streams'][1]['width'];
    return width;
  }

  int getHeight(Map<dynamic, dynamic> info) {
    final int height = info['streams'][0]['height'] ?? info['streams'][1]['height'];
    return height;
  }

flareso avatar Nov 09 '20 14:11 flareso

Yeah I did notice that. In the new flutter_ffmpeg version that API is a bit more organised, you might wanna try upgrading.

syonip avatar Nov 11 '20 17:11 syonip