VideoCore-Inactive
VideoCore-Inactive copied to clipboard
crashing when trying to open an RTMP stream several times
test case: device in airplane mode.
code path:
- try opening the connection with
startRtmpSessionWithURL: andStreamKey:
- get a
VCSessionStateError
followed byVCSessionStateEnded
through the session delegate - as soon as we get
VCSessionStateEnded
we schedule a selector to retry connecting the session, after 1 second, on the main thread
let the above run for a while and the app will crash out in some C++ code (not always at the same place).
I also tried before each reconnect to call endRtmpSession
and create a new instance of the VCSimpleSession
class, but the result was the same. Crashes somewhere in C++ land.
Example of the call stack of the last scenario I described:
#0 0x00000001000aa96c in std::__1::enable_if<(is_move_constructiblevideocore::IOutputSession*::value) && (is_move_assignablevideocore::IOutputSession*::value), void>::type std::1::swapvideocore::IOutputSession*(videocore::IOutputSession&, videocore::IOutputSession&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:3205
#1 0x00000001000aa94c in std::__1::shared_ptrvideocore::IOutputSession::shared_ptr() [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4568
#2 0x00000001000aa934 in std::__1::shared_ptrvideocore::IOutputSession::reset() [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4577
#3 0x00000001000aa934 in -[VCSimpleSession startSessionInternal:streamKey:]::$_0::operator()(videocore::RTMPSession&, ClientState_t) const at VideoCore/api/iOS/VCSimpleSession.mm:508
#4 0x00000001000aa5a0 in decltype(std::__1::forward<-[VCSimpleSession startSessionInternal:streamKey:]::$_0&>(fp)(std::__1::forward<videocore::RTMPSession&, ClientState_t>(fp0))) std::__1::__invoke<-[VCSimpleSession startSessionInternal:streamKey:]::$_0&, videocore::RTMPSession&, ClientState_t>(-[VCSimpleSession startSessionInternal:streamKey:]::$_0&&&, videocore::RTMPSession&&&, ClientState_t&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413
#5 0x00000001000aa574 in std::__1::__function::__func<-[VCSimpleSession startSessionInternal:streamKey:]::$_0, std::__1::allocator<-[VCSimpleSession startSessionInternal:streamKey:]::$_0>, void (videocore::RTMPSession&, ClientState_t)>::operator()(videocore::RTMPSession&, ClientState_t&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1370
#6 0x00000001000847d8 in std::__1::function<void (videocore::RTMPSession&, ClientState_t)>::operator()(videocore::RTMPSession&, ClientState_t) const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1755
#7 0x0000000100072d40 in videocore::RTMPSession::setClientState(ClientState_t) at VideoCore/rtmp/RTMPSession.cpp:322
#8 0x0000000100074590 in videocore::RTMPSession::streamStatusChanged(long) at VideoCore/rtmp/RTMPSession.cpp:350
#9 0x000000010007fdf8 in videocore::RTMPSession::RTMPSession(std::__1::basic_string<char, std::__1::char_traits
Enqueued from com.videocore.session.graph (Thread 7)Queue : com.videocore.session.graph (serial)
#0 0x000000010048a0bc in _dispatch_barrier_async_f ()
#1 0x00000001000913dc in videocore::Apple::StreamSession::connect(std::__1::basic_string<char, std::__1::char_traits
Enqueued from com.apple.main-thread (Thread 1)Queue : com.apple.main-thread (serial) #0 0x000000010048ff80 in _dispatch_barrier_async_f_slow () #1 0x00000001000a19a4 in -[VCSimpleSession startRtmpSessionWithURL:andStreamKey:] at VCSimpleSession.mm:472 #2 0x00000001000123bc in -[ViewController startBroadcast] at ViewController.mm:179
I am using code I got through cocoapods.
What is the server you are trying to connect to? (Wowza, nginx, red5?)
youtube
From: james h <[email protected]mailto:[email protected]> Reply-To: jgh-/VideoCore <[email protected]mailto:[email protected]> Date: Monday 13 April 2015 18:02 To: jgh-/VideoCore <[email protected]mailto:[email protected]> Cc: Joris Mans <[email protected]mailto:[email protected]> Subject: Re: [VideoCore] crashing when trying to open an RTMP stream several times (#125)
What is the server you are trying to connect to? (Wowza, nginx, red5?)
Reply to this email directly or view it on GitHubhttps://github.com/jgh-/VideoCore/issues/125#issuecomment-92411332.
oh this is in airplane mode, ok I'll do some testing on this today.
getting the same error, how do we fix this?
Hi I am also facing same issue can you please help me out I am using Wowza server and i am giving my RTMP like [_session startRtmpSessionWithURL:urlForStream andStreamKey:streamID]; urlForStream like rtmp;//some.tv/some/userid/userid and stream Id generated by my server but unable to start the session same as above can you please help me out
My solution was straightforward: I used this codebase as a basis to write everything myself from scratch
thanks for the replay but if i give some other url it is working fine like mp4 formats is there any thing we need to pass to the server that video type is flv format and how to pass the h264 to server then it cover it into flv
Hey! Probably I fixed this issue #348