youtube / api-samples

Code samples for YouTube APIs, including the YouTube Data API, YouTube Analytics API, and YouTube Live Streaming API. The repo contains language-specific directories that contain the samples.
5.49k stars 2.98k forks source link

Youtube Live Stream directly from iOS app using camera #284

Open PrashantGaikwad-iOS opened 4 years ago

PrashantGaikwad-iOS commented 4 years ago

Hi, Is there any resource that I can refer to to implement the Youtube live stream in my iOS app? I'm using swift 4.2. My requirement is when the user clicks a button inside app then the youtube live stream should start. Thank you in advance.

rahul0tripathi commented 4 years ago

hi @PrashantGaikwad-iOS , there's no direct way to achieve this ; One possible way could be to Create a live broadcast -> create a new liveStream -> bind them together -> get The ingestionAddress and streamKey using youtube live apis and then using ffmpeg to stream directly to ingest Server (eg:RTMP) using camera as source .

PrashantGaikwad-iOS commented 4 years ago

Hi @rahultripathidev , Thanks for the reply. Yes, as you mentioned I'm using YouTube Api's to get the final RTMP url. Now I have RTMP url but not sure how to live stream my RTSP url data to this RTMP url. I tried using ffmpeg mobile pod but the command I'm using is not correct. Using LFLiveKit we can stream camera feed but I want to stream my RTSP url which I am getting from an IoT device.

rahul0tripathi commented 4 years ago

@PrashantGaikwad-iOS , a quick search on stackoverflow revealed a ffmpeg command ffmpeg -i "[your rtsp link]" -f flv -r -s -an "[Your rtmp link]" Here you can directly replace rtmp url with youtube ingestaddress/streamKey

PrashantGaikwad-iOS commented 4 years ago

I'll try this 👍 and let you know. thank you.

PrashantGaikwad-iOS commented 4 years ago

Hi @rahultripathidev , I tried this command ffmpeg -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov" -f flv -r -s -an "rtmp://a.rtmp.youtube.com/live2/wbj7-qzhq-g49t-7km6-f2w1- but in cmd, it gets stuck and shows this dquote>

vihatsoft commented 4 years ago

how to bind device? can you please give me reference link for bellow two steps ? where get BROADCAST_ID? -> bind them together -> get The ingestionAddress and streamKey using youtube live apis

rahul0tripathi commented 4 years ago

@vihatsoft we are no binding the device to the stream. here we're binding the created live broadcast to the live stream . https://developers.google.com/youtube/v3/live/getting-started

siddharth3293 commented 4 years ago

hi place the notes a connection a probans

siddharth3293 commented 4 years ago

covrn -19