Wowza Community

Technical problem : iOS SDK write video while recording, bad mp4

Hello,

I have an issue with ios SDK while record video when broadcasting.

For a single video : start broadcast then stop, i have at least a good MP4 video.

But if broadcast again and stop again, the 2nd video is not good : the image is stuck.

Maybe i do something wrong with MP4Writer object…

Here how i start writing :

case WOWZBroadcastStateBroadcasting:

            self.writeMP4 = NO;

                self.mp4Writer = [MP4Writer new];

                self.writeMP4 = [self.mp4Writer prepareWithConfig:self.goCoder.config];

                if (self.writeMP4) {

                    [self.mp4Writer startWriting];

                }

            }

Here how i stop writing :

if (self.writeMP4 && self.mp4Writer.writing) {

                if (self.video_capture_queue) {

                    dispatch_async(self.video_capture_queue, ^{

                        [self.mp4Writer stopWriting];

                    });

                }

                else {

                    [self.mp4Writer stopWriting];

                }

            }

            self.writeMP4 = NO;

When view controller appear i initialize :

[self.goCoder registerVideoSink:self];

        [self.goCoder registerAudioSink:self];

        [self.goCoder registerVideoEncoderSink:self];

        [self.goCoder registerAudioEncoderSink:self];

        

        [self.goCoder registerDataSink:self eventName:@"onTextData"];

And i unregister only when i close the viewcontroller

[self.goCoder unregisterVideoSink:self];

            [self.goCoder unregisterAudioSink:self];

            [self.goCoder unregisterVideoEncoderSink:self];

            [self.goCoder unregisterAudioEncoderSink:self];

            [self.goCoder unregisterDataSink:self eventName:@"onTextData"];

Here you can see the video by download them here : https://we.tl/t-GFguFD1wsR

in attachment the 2nd video (because it is smaller that the first :slight_smile: )

I just tested your latest example project “Gocoder SDK 1.9.0” on iphone 8 ios 13.3? I get the same problem.

So it seems that is not coming from my code. (that i copy from your example :slight_smile: ).

Can you help me on this ?

Thank you :slight_smile:

Try it on a different device and see what happens. Our SDK is not fully compatible with iphone 13 OS- it’s their newest OS that had a lot of changes. There are some native encoders in that phone that don’t always work with all of our SDK libraries.

Thanks for your answer. It is great to have a fast reponse :-). I will try tomorrow and keep you in touch on a device with iOS 12.

Cool. You’re welcome and I’m always happy to try and help.

i tested on iOS 12 and it worked. So you are right. Your sdk is not working on iOS 13.
Do you plan to resolve this issue on iOS 13 ?

I do not have a timeline on that for you right now. I will have someone from our SDK team get in touch with you when we have an alternative for you that will work on that device. Thanks Jeremie! We appreciate your feedback.

I found a solution :

If the internet connection is lost.
i unregister all the object.
and I set GoCoder object to nil.
then I create another and relaunch the stream.
with this process all the other video works !

That is fantastic! I’ll mark this as accepted. Thanks very much for sharing.

I found a solution :

If the internet connection is lost.
i unregister all the object.
and I set GoCoder object to nil.
then I create another and relaunch the stream.
with this process all the other video works !