# How to store video in Iphone while publishig video with RTMPStreamPublisher?

**URL:** https://community.wowza.com/t/how-to-store-video-in-iphone-while-publishig-video-with-rtmpstreampublisher/41634
**Category:** Wowza Streaming Engine
**Created:** [November 25, 2013, 1:16pm UTC](https://community.wowza.com/t/how-to-store-video-in-iphone-while-publishig-video-with-rtmpstreampublisher/41634 "2013-11-25T13:16:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Bhavik\_Kama](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@Bhavik\_Kama](https://community.wowza.com/u/Bhavik_Kama)
#### Post date: [November 25, 2013, 1:16pm UTC](https://community.wowza.com/t/how-to-store-video-in-iphone-while-publishig-video-with-rtmpstreampublisher/41634/1 "2013-11-25T13:16:26Z")

</div>

Right now am using `RTMPStreamPublisher` to publish the video at wowzaserver its uploading there successfully but can anyone tell me …how can i store the same video at iphone while uploading at server .i need to store at iphone as well as at wowzaserver at same time??

I am using this GitHub Project [https://github.com/slavavdovichenko/MediaLibDemos](https://github.com/slavavdovichenko/MediaLibDemos)

but there is no much documentation available .if i can just retrieve the data which they sending for publishing then even my work will be successful…

following is the method they using to upload the stream but cant find option from which i can store the same video to my iphone device…

```auto
     // ACTIONS
    
    -(void)doConnect {
        
    #if 0 // use ffmpeg rtmp
        
        NSString *url = [NSString stringWithFormat:@"%@/%@", hostTextField.text, streamTextField.text];
        upstream = [[BroadcastStreamClient alloc] init:url resolution:RESOLUTION_LOW];
        upstream.delegate = self;
        upstream.encoder = [MPMediaEncoder new];
        [upstream start];
        
        socket = [[RTMPClient alloc] init:host]
        btnConnect.title = @"Disconnect";
        
        return;
    
    #endif
        
    #if 0 // use inside RTMPClient instance
        
        upstream = [[BroadcastStreamClient alloc] init:hostTextField.text resolution:RESOLUTION_LOW];
        //upstream = [[BroadcastStreamClient alloc] initOnlyAudio:hostTextField.text];
        //upstream = [[BroadcastStreamClient alloc] initOnlyVideo:hostTextField.text resolution:RESOLUTION_LOW];
    
    #else // use outside RTMPClient instance
        
        if (!socket) {
            socket = [[RTMPClient alloc] init:hostTextField.text];
            if (!socket) {
                [self showAlert:@"Socket has not be created"];
                return;
            }
            
            
          
            [socket spawnSocketThread];
       }
        
        upstream = [[BroadcastStreamClient alloc] initWithClient:socket resolution:RESOLUTION_LOW];
        
    #endif
        
        [upstream setVideoOrientation:AVCaptureVideoOrientationLandscapeRight];
        //[upstream setVideoOrientation:AVCaptureVideoOrientationLandscapeLeft];
        //[upstream setVideoBitrate:512000];
        
        upstream.delegate = self;
        
        [upstream stream:streamTextField.text publishType:PUBLISH_LIVE];
        //[upstream stream:streamTextField.text publishType:PUBLISH_RECORD];
        //[upstream stream:streamTextField.text publishType:PUBLISH_APPEND];
        
        btnConnect.title = @"Disconnect"; 
        
    }

```

///One thing i found taht with instance of `BroadcastStreamClient` named as upstream i can get the `AVCaptureSession` with the following line

```auto
   [upstream getCaptureSession] 

```

so can anybody now guide me how to use this `AVCaptureSession` for recording the video on iphone

Please guide me…

---

<div class="post-metadata">

### Author: ![Jason\_Hilton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/jason_hilton/32/437_2.png) [@Jason\_Hilton](https://community.wowza.com/u/Jason_Hilton)
#### Post date: [November 25, 2013, 10:54am UTC](https://community.wowza.com/t/how-to-store-video-in-iphone-while-publishig-video-with-rtmpstreampublisher/41634/2 "2013-11-25T10:54:03Z")

</div>

Hi,

Wowza Media Server is a streaming server which does not support download or progressive download to clients.

We do not support 3rd part products and our support team can’t help you with this matter.

Jason
