Giter Club home page Giter Club logo

Comments (5)

liyunqin avatar liyunqin commented on July 18, 2024 2

I can build this project successfully. When I run on my iphone device, I click the button to push stream then I can see some error in logs.

[Error] [com.haishinkit.SRTHaishinKit] [SRTSocket.swift:102] createConnectionException() > Connection setup failure: connection time out

i cann't push stream, I don't know how to fix this bug,I need your help.
Thanks very much.

from srthaishinkit.swift.

kellerma avatar kellerma commented on July 18, 2024

Hello Please help me with this issue i try to use your example demo to connect to srt server but have this log

2021-01-11 13:02:21.557 [Info] [com.haishinkit.HaishinKit] [VideoIOComponent.swift:96] fps > (fps: 30.0, duration: __C.CMTime(value: 100, timescale: 3000, flags: __C.CMTimeFlags(rawValue: 1), epoch: 0)) 2021-01-11 13:02:32.126 [Info] [com.haishinkit.SRTHaishinKit] [SRTSocket.swift:42] status > SRT Socket Connected 2021-01-11 13:02:35.130 [Error] [com.haishinkit.SRTHaishinKit] [SRTSocket.swift:93] connect(_:options:) > Connection setup failure: connection time out

and then i try to create srt local server by ffplay -i "srt://0.0.0.0:3000?mode=listener" and try to connect again , but can't connect too

2021-01-11 13:02:21.557 [Info] [com.haishinkit.HaishinKit] [VideoIOComponent.swift:96] fps > (fps: 30.0, duration: __C.CMTime(value: 100, timescale: 3000, flags: __C.CMTimeFlags(rawValue: 1), epoch: 0)) 2021-01-11 13:02:32.126 [Info] [com.haishinkit.SRTHaishinKit] [SRTSocket.swift:42] status > SRT Socket Connected 2021-01-11 13:02:35.130 [Error] [com.haishinkit.SRTHaishinKit] [SRTSocket.swift:93] connect(_:options:) > Connection setup failure: connection time out

The step i try to run step 1 : download your source step 2: install cmake step 3. install carthage update --use-xcframeworks --platform iOS step 4 : run your sh command : build-openssl-iOS & build-srt-iOS step 5 : build SRTHaishinkit step 6: run example demo for ios

but i can't connect to any server , but another app in appstore can , i don't know why, please help , sorry for my bad english

`import UIKit import HaishinKit import SRTHaishinKit import AVFoundation

final class LiveViewController: UIViewController { private static let maxRetryCount: Int = 5

@IBOutlet private weak var lfView: MTHKView!
@IBOutlet private weak var currentFPSLabel: UILabel!
@IBOutlet private weak var publishButton: UIButton!
@IBOutlet private weak var pauseButton: UIButton!
@IBOutlet private weak var videoBitrateLabel: UILabel!
@IBOutlet private weak var videoBitrateSlider: UISlider!
@IBOutlet private weak var audioBitrateLabel: UILabel!
@IBOutlet private weak var zoomSlider: UISlider!
@IBOutlet private weak var audioBitrateSlider: UISlider!
@IBOutlet private weak var fpsControl: UISegmentedControl!
@IBOutlet private weak var effectSegmentControl: UISegmentedControl!

private var connection: SRTConnection!
private var stream: SRTStream!
private var currentPosition: AVCaptureDevice.Position = .back

override func viewDidLoad() {
    super.viewDidLoad()

   
    
    
    connection = .init()
    stream = SRTStream(connection)
    stream.captureSettings = [
        .sessionPreset: AVCaptureSession.Preset.hd1280x720,
        .continuousAutofocus: true,
        .continuousExposure: true
    ]
    stream.videoSettings = [
        .width: 720,
        .height: 1280
    ]
    connection.attachStream(stream)
    lfView.attachStream(stream)
}

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    stream.attachAudio(AVCaptureDevice.default(for: .audio)) { _ in
        // logger.warn(error.description)
    }
    stream.attachCamera(DeviceUtil.device(withPosition: currentPosition)) { _ in
        // logger.warn(error.description)
    }
}

@IBAction func rotateCamera(_ sender: UIButton) {
}

@IBAction func toggleTorch(_ sender: UIButton) {
}

@IBAction func on(slider: UISlider) {
}

@IBAction func on(pause: UIButton) {
}

@IBAction func on(close: UIButton) {
    self.dismiss(animated: true, completion: nil)
}

@IBAction func on(publish: UIButton) {
    if publish.isSelected {
        UIApplication.shared.isIdleTimerDisabled = false
        stream.close()
        connection.close()
        publish.setTitle("●", for: [])
    } else {
        UIApplication.shared.isIdleTimerDisabled = true
        connection.connect(URL(string: Preference.shared.url))
        stream.publish(Preference.shared.streamName)
        publish.setTitle("■", for: [])
    }
    publish.isSelected.toggle()
}

func tapScreen(_ gesture: UIGestureRecognizer) {
}

@IBAction private func onFPSValueChanged(_ segment: UISegmentedControl) {
}

@IBAction private func onEffectValueChanged(_ segment: UISegmentedControl) {
}

@objc
private func on(_ notification: Notification) {
}

@objc
private func didEnterBackground(_ notification: Notification) {
}

@objc
private func didBecomeActive(_ notification: Notification) {
}

} `

I am having exactly the same issue. Has anyone been able to solve the socket disconnection ?

from srthaishinkit.swift.

kellerma avatar kellerma commented on July 18, 2024

Issue solved in branch version #22

from srthaishinkit.swift.

gxg-886 avatar gxg-886 commented on July 18, 2024

master and SRT-Listener-Support branch That's still the problem,Connection setup failure: connection time out

from srthaishinkit.swift.

shogo4405 avatar shogo4405 commented on July 18, 2024

might be fixed it 6c0b680

from srthaishinkit.swift.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.