I'm trying to upload RTSP stream
from one IP camera to Server
. I'm using "FFmpeg
" third-party c library for uploading.Is it possible to continue uploading in background?Currently the live streaming got disconnected after 3 minutes in background.I want to continue the live streaming with out any interruption,if the user locked his iPhone.I've enabled:
我正在尝试将RTSP流从一台IP摄像机上传到服务器。我正在使用“FFmpeg”第三方c库进行上传。是否有可能继续在后台上传?目前在后台播放3分钟后实时流媒体已断开连接。我希望在没有任何中断的情况下继续直播,如果用户锁定了他的iPhone。我启用了:
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?
是否可以在3分钟后继续流媒体而没有任何中断,用户锁定他的iPhone?
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()
}
}
1 个解决方案
#1
0
No.
The only apps that are allowed to continue to run in the background are VoIP apps, but if you abuse that background mode, your app will be rejected on submission.
允许继续在后台运行的唯一应用是VoIP应用,但如果您滥用该背景模式,您的应用将在提交时被拒绝。
Why do you need the iOS device to stand between the camera and the server? Why no have the camera send directly to the server?
为什么你需要iOS设备站在相机和服务器之间?为什么没有相机直接发送到服务器?
#1
0
No.
The only apps that are allowed to continue to run in the background are VoIP apps, but if you abuse that background mode, your app will be rejected on submission.
允许继续在后台运行的唯一应用是VoIP应用,但如果您滥用该背景模式,您的应用将在提交时被拒绝。
Why do you need the iOS device to stand between the camera and the server? Why no have the camera send directly to the server?
为什么你需要iOS设备站在相机和服务器之间?为什么没有相机直接发送到服务器?