video-dev / clappr-rtmp-plugin

📺 RTMP support for Clappr player.
http://clappr.io
Apache License 2.0
105 stars 46 forks source link

Facebook live streams not working #56

Closed albertogasparin closed 8 years ago

albertogasparin commented 8 years ago

I've found two issues while trying to view Fabecook live streams. The first one is that rtmps streams are not being recognised as supported because the code just looks for rtmp:// (easy one to solve).

The second issue is the real one: Facebook rtmps streams are not playing. The source is correctly sent to Flash but then nothing shows up (just black screen). Have a look with this stream (available for another 3 hours.):

rtmps://edgetee.xx.fbcdn.net:443/live-md/1282731655104706?api=1&s_p=1&o=lla2&a=AfDrx0WuwBQbFnDh

The stream works with both rtmpdump and this test player.

gfronza commented 8 years ago

@albertogasparin sorry for the delay. Can you provide a new live stream URL? I'll enable detailed logs to try to identify the issue.

albertogasparin commented 8 years ago

Hi @gfronza, this page might provide you more links: https://www.facebook.com/livemap/ Let me say that I've tried to debug the problem on another player that has the same issue (VideoJS) and I've discovered 2 things:

  1. CDN stream servers require FCSubscribe call as they deny direct connections
  2. People behind enterprise firewalls (like me) need proxyType = 'best' otherwise the connection is prevented.

I haven't checked if your code already handles those 2 scenarios.
FYI, this is the PR I've submitted to VideoJS with the changes in order to make FBLive videos work.

gfronza commented 8 years ago

@albertogasparin nice! The original OSMF.swc library was not calling FCSubscribe, but I already changed this. So what may be causing the issue is indeed this proxyType attribute. I'm thinking about exposing this as an option in rtmpConfig (player setup) instead of hardcoding it.

albertogasparin commented 8 years ago

That would be great 👍 BTW, I would make the most compatible value (best) as the default option, allowing people to set it to something else if they know what they are doing. By looking around I saw that also JWPlayer does that.

gfronza commented 8 years ago

@albertogasparin I drafted a new pre-release (https://github.com/flavioribeiro/clappr-rtmp-plugin/releases/tag/0.0.15-rc1). Could you test if that works for you? I don't have easy access to an enterprise proxy to validate the solution.

I added the proxyType option, the default option is none though (since none is the default option of NetConnection too).

You can close the issue if the solution works for you.

albertogasparin commented 8 years ago

Great! Waiting for an updated version on npm. Cheers 👍

gfronza commented 8 years ago

👍 0.0.16 is now on npm. Thanks!

vienntbna commented 5 years ago

Hello @albertogasparin , google search bring me here, I have a question not related to clappr. How can I get the rtmp link for view video from facebook livestream ? It's 2019 now, is it still possible ?

seisdr commented 5 years ago

How to download Facebook live videos again?

seisdr commented 5 years ago

Hello @albertogasparin , google search bring me here, I have a question not related to clappr. How can I get the rtmp link for view video from facebook livestream ? It's 2019 now, is it still possible ?

Yes

boygiandi commented 5 years ago

Hello @albertogasparin , google search bring me here, I have a question not related to clappr. How can I get the rtmp link for view video from facebook livestream ? It's 2019 now, is it still possible ?

Yes

How ? How to get the rtmp link for watching ? From the API, I can only get the rtmp for publishing video. I can't play video from the same rtmp url.

seisdr commented 5 years ago

rtmps://live-api-s.facebook.com:443/rtmp/<url>

Ex:rtmps://live-api-s.facebook.com:443/rtmp/https://www.facebook.com/100009064483809/videos/2311553325823461/?app=fbl

boygiandi commented 5 years ago

I tried but not work, I get a live video link from facebook search. And try check it with ffmpeg

[root@ns3152819 ~]# ffmpeg -i 'rtmps://live-api-s.facebook.com:443/rtmp/https://www.facebook.com/hillsongchurch/videos/2587944051289605/?app=fbl' ffmpeg version N-95534-gac0f5f4 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs='-ldl -lm -lpthread -lstdc++' --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfreetype --enable-libspeex --enable-libtheora --enable-libass --enable-libxcb --enable-openssl --extra-libs=-lasound --enable-libpulse --enable-libaom --enable-libxml2 libavutil 56. 35.101 / 56. 35.101 libavcodec 58. 59.102 / 58. 59.102 libavformat 58. 33.100 / 58. 33.100 libavdevice 58. 9.100 / 58. 9.100 libavfilter 7. 64.100 / 7. 64.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 [rtmps @ 0x3266340] Unexpected reply on getStreamLength() rtmps://live-api-s.facebook.com:443/rtmp/https://www.facebook.com/hillsongchurch/videos/2587944051289605/?app=fbl: Input/output error

boygiandi commented 5 years ago

rtmps://live-api-s.facebook.com:443/rtmp/<url>

Ex:rtmps://live-api-s.facebook.com:443/rtmp/https://www.facebook.com/100009064483809/videos/2311553325823461/?app=fbl

Your video is live, but the rtmp link not works with ffmpeg

seisdr commented 5 years ago

Try with rtmpdumb

boygiandi commented 5 years ago

please send me full command, I tried typical command but not works

rtmpdump -r 'rtmps://live-api-s.facebook.com:443/rtmp/https://www.facebook.com/workpoint/videos/936968613369341/?app=fbl' -o test.mp4

RTMPDump v2.4 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL Connecting ... INFO: Connected... ERROR: RTMP_ReadPacket, failed to read RTMP packet header

seisdr commented 5 years ago

It will work now cuz the broadcast is over man you have to see it a girl with a weapon laugh at poor guy and other stuff ,, anyway if this didn't work then hopefully this project might do https://github.com/scivision/PyLivestream/ it didn't working for me just because I'm Android but for you it will :)

boygiandi commented 5 years ago

I know your link is stopped. Then I use another link in my example. But it not works :(

seisdr commented 5 years ago

Check the project it's special for livestream and Facebook

boygiandi commented 5 years ago

this PyLivestream is a broadcaster, what I want is a player :( I mean I want to play (download) livestream video from Facebook via rtmp protocol

seisdr commented 5 years ago

oh ,then Try with ffmpeg static build

boygiandi commented 5 years ago

I think you don't understand my question. What I'm looking for is the right rtmp link that ffmpeg can play

seisdr commented 5 years ago

I know you do maybe something missing with your ffmpeg ,try with static build Or you want to do with ffplay?

seisdr commented 4 years ago

Yea pylivestream open xserver to watch the live video

flavioribeiro commented 4 years ago

hey guys, this is not the right venue for this kind of conversation. Locking the thread.