Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vinitha

macrumors newbie
Original poster
Nov 16, 2015
1
0
Hi,

I'm trying to upload RTSP stream from one IP camera to Server . I'm using "FFmpeg" thirdparty c library for uploading.Is it possible to continue uploading in background?Currently the live streaming got disconncted after 3 minutes in background.I want to continue the live streaming with out any interuption,if the user locked his iPhone.I've enabled Project Target -> Capabilities ->Background modes ->External Accessory Communications and Background Fetch.Is it possible to continue streaming without any interruption after 3 minutes ,the user lock his iPhone?


Code:
let queue:dispatch_queue_t = dispatch_queue_create("streaming", DISPATCH_QUEUE_SERIAL)


  dispatch_async(queue, { () -> Void in

  self.startStreaming()

  })

  func startStreaming()

  {

  let taskId = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler { () -> Void in
  }

  start_stream()  // This will call FFmpeg code for live streaming


  if(taskId != UIBackgroundTaskInvalid)

  {

  UIApplication.sharedApplication().endBackgroundTask(taskId)

  self.clearStreamingDefaults()

  }

}

Thanks .
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.