pinkfish / flutter_rtmppublisher

Publisher to rtmp using the camera plugin as a basis to do all the basic camera/record management.
BSD 3-Clause "New" or "Revised" License
95 stars 121 forks source link

Attempting to record video crashes app (iOS) #15

Open nwparker opened 4 years ago

nwparker commented 4 years ago

Issue description

Attempting to record video crashes app on iOS. Android is unaffected

How to reproduce

Version Info

Steps

  1. Run example via Xcode
  2. Select either front or rear camera
  3. Ensure audio is enabled
  4. Press Icons.videocam
  5. App will crash w/ exception

Exception:

2020-06-15 11:39:40.013797-0700 Runner[17722:864140] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVAssetWriterInput appendSampleBuffer:] Media type of sample buffer must match receiver's media type ("soun")'
*** First throw call stack:
(0x229ca927c 0x228e839f8 0x22fc071a0 0x100e04770 0x100e03b48 0x22fc6f7cc 0x22fc6f478 0x22d18f34c 0x22d1ac8ec 0x10332cc74 0x10332fffc 0x103342610 0x103334a4c 0x1033358ec 0x103334a4c 0x1033358b4 0x10333f77c 0x2298c9114 0x2298cbcd4)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
nwparker commented 4 years ago

update: only happens when audio is enabled

This appears to be the offending line: https://github.com/pinkfish/flutter_rtmppublisher/blob/master/ios/Classes/RtmppublisherPlugin.m#L628

orteidni commented 4 years ago

I don't know if this is related, but with the same configuration when pressing the fourth streaming button and either pressing "cancel" or "ok" the app crashes with:

2020-06-17 18:04:28.754916+0300 Runner[23373:6777158] -[NSNull length]: unrecognized selector sent to instance 0x20168a1a0 2020-06-17 18:04:28.755152+0300 Runner[23373:6777158] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x20168a1a0' First throw call stack: (0x1bf994164 0x1bf6a8c1c 0x1bf8927e0 0x1bf99885c 0x1bf99ab60 0x1bfc774dc 0x1bfc77480 0x1054a21dc 0x1054a15cc 0x1054a5ad0 0x1054a43fc 0x10554dd10 0x10554f18c 0x105556968 0x105557580 0x1055630f0 0x1bf69b714 0x1bf6a19c8) libc++abi.dylib: terminating with uncaught exception of type NSException

This happens with audio on or off.

graperaisin1 commented 3 years ago

Getting this issue as well. Does anyone have any updates?