react-native-red5pro icon indicating copy to clipboard operation
react-native-red5pro copied to clipboard

Second time publish gives no output (ios)

Open stijnvanderlaan opened this issue 6 years ago • 4 comments

No video is shown on the other side and the following error is given repeatingly:

writer error Error Domain=AVFoundationErrorDomain Code=-11840 "Cannot Encode" UserInfo={NSLocalizedDescription=Cannot Encode, NSUnderlyingError=0x1c84565c0 {Error Domain=NSOSStatusErrorDomain Code=-12915 "(null)"}, NSLocalizedRecoverySuggestion=Stop any other actions that encode media and try again., NSLocalizedFailureReason=The encoder required for this media is busy.}

stijnvanderlaan avatar Apr 13 '18 14:04 stijnvanderlaan

@stijnvanderlaan Do you mean if you reuse the same Publisher, the second time you go to publish you receive this error?

bustardcelly avatar Apr 26 '18 13:04 bustardcelly

I don't know if it uses the same publisher under the hood, but I am not reusing the publisher, I remount a new R5VideoView. It even happens when I reload the bundle, I can only get back video once I rerun the app. The error is not consistent, the missing video on the other side is.

stijnvanderlaan avatar Apr 27 '18 09:04 stijnvanderlaan

We have noticed that using the Live Reload and Hot Reload features of React Native while in development do cause issues with the streaming - in most cases it not properly closing previous streams since componentWillUnmount is not consistently called when using those dev features.

As such, in development projects we have recommended to not use - or rather rely - on reloads when actively developing views with streaming. Instead we prefer to shake and Reload each time. I know it adds more time in development, but we cant trust React Native to properly clean up streams when using Live or Hot reloading.

bustardcelly avatar Apr 27 '18 12:04 bustardcelly

@bustardcelly We do use Hot reload indeed. I'll have @stijnvanderlaan check if this is also actually the case with an APK version rather than the development build.

rene-demonsters avatar May 17 '18 16:05 rene-demonsters