shogo4405 / HaishinKit.swift

Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS.
BSD 3-Clause "New" or "Revised" License
2.77k stars 614 forks source link

rtmp can connect to Youtube live, but default stream is stuck on Receiving...(default stream can not publish/show on Default stream.) #68

Closed MrZero8888 closed 8 years ago

MrZero8888 commented 8 years ago

Hi guys, I am getting stuck on Youtube live stream when running yr sample in this git, only change the uri and streamName : `struct Preference { static let defaultInstance:Preference = Preference()

var uri:String? = "rtmp://a.rtmp.youtube.com/live2"
var streamName:String? = "xxxx-xxxx-xxxx-xxxx"  // my default streamName

}`

The Youtube screen all time shows with black screen : "This stream is OFFLINE" and status "Receiving your content...", even I am starting on my Iphone 6+, ios 9.3.2 during 5 minutes. My ss here: https://s32.postimg.org/jsjx7wjnp/Screen_Shot_2016_06_20_at_17_18_56.png The log screen on Xcode 7.3 shows

g0,0,255;g;2016-06-20 17:11:29.169 [Info] [VideoIOComponent.swift:112] fps > (30.0, __C.CMTime(value: 100, timescale: 3000, flags: __C.CMTimeFlags(rawValue: 1), epoch: 0))[; g0,0,255;g;2016-06-20 17:11:49.200 [Info] [AACEncoder.swift:64] inSourceFormat > Optional(__C.AudioStreamBasicDescription(mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 12, mBytesPerPacket: 2, mFramesPerPacket: 1, mBytesPerFrame: 2, mChannelsPerFrame: 1, mBitsPerChannel: 16, mReserved: 0))[; g0,0,255;g;2016-06-20 17:12:22.662 [Info] [VideoIOComponent.swift:112] fps > (30.0, __C.CMTime(value: 100, timescale: 3000, flags: __C.CMTimeFlags(rawValue: 1), epoch: 0))[; g0,0,255;g;2016-06-20 17:12:24.309 [Info] [VideoIOComponent.swift:112] fps > (15.0, __C.CMTime(value: 100, timescale: 1500, flags: __C.CMTimeFlags(rawValue: 1), epoch: 0))[; g0,0,255;g;2016-06-20 17:12:45.100 [Info] [AACEncoder.swift:64] inSourceFormat > nil[;

I had tried many times with other encodings like OBS on mac, youtube creator, Live now on ios, they works fine after starting 2-5 seconds.

Can you have any ideas on this? Thanks

shogo4405 commented 8 years ago

I'll look into it. I got the same condition.

"Receiving your content..." Then I click browser Reload Button(F5), after works fine.

jrahaim commented 8 years ago

Same issue.

I have used a different library (VideoCore) and it works as expected.

it seems like something is missing from the stream.

triwav commented 8 years ago

I assumed this was an issue on YouTube's side since it works fine once you reload the page. It only shows that offline video if you previously were online. If it doesn't show the offline video then it seems to start fine.

shogo4405 commented 8 years ago

I think fixed it. probably, @setDataFrame is required. https://github.com/shogo4405/lf.swift/commit/d7adc8f324aa3967d310b229f6e132f0fece1a4b After I published video (5sec), status was online and displayed video.

MrZero8888 commented 8 years ago

Updated : still not working. only work when select 30 fps before click record button but live video appears after a long time ( 10-15s). Have you ever considered to add more beautiful mode like Bigo.tv? Live stream is a new trends :) I found this : https://github.com/chenliming777/LMLiveStreaming have beautiful mode, but not really good. May be you can do better : )

shogo4405 commented 8 years ago

Thanks. I will ask Youtube.

Have you ever considered to add more beautiful mode

No. But I wanna support GPUImage.

shogo4405 commented 8 years ago

Posted stackoverflow :) http://stackoverflow.com/questions/38321576/timing-of-youtubelive-dashboard-video-display

MrZero8888 commented 8 years ago

Hi Shogo4405, is there new updates on this? :)

shogo4405 commented 8 years ago

@MrZero8888 no answers (Google, stackoverflow) :-(

Other product(OBS) is the same that video appears after a long time . I think YouTube specifications.

OBS (wifi)

- Offline→Online Displayed Video
30FPS 5sec 10-15sec
15FPS 5sec 20-25sec

framework (4G)

- Offline→Online DisplayedVideo
30FPS 5sec 10-15sec
15FPS 5sec 20-25sec