cordova-rtc / cordova-plugin-iosrtc

Cordova iOS plugin exposing the WebRTC W3C API
MIT License
688 stars 340 forks source link

Video is absent (H.264), Ionic 2 #193

Closed bushev closed 8 years ago

bushev commented 8 years ago

I'm trying to get work Ionic 2 application on iOS. Stream comes from Raspberry pi (gStreamer + Janus WebRTC gateway)

Application is a streaming application with the following logic:

  1. Create connection to RPi using Janus WebRTC gateway
  2. Obtain stream and create video tag with src: URL.createObjectURL(stream)

I'm getting WebRTC support by the following plugin: https://github.com/eface2face/cordova-plugin-iosrtc

Streaming works great in FireFox browser by ionic serve --platform=ios command.

Streaming is NOT works inside iOS emulator and on a real device. I just got a green rectangle instead of stream, like on the picture below:

7935075e-4d25-11e6-88ac-88124d9d2881

gStreamer command:

raspivid --verbose --nopreview --width 640 --height 480 --framerate 15 --bitrate 1000000 --profile main --timeout 0 -o - | 
gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=8004

Janus config:

[gst-rpwc]
type = rtp
id = 1
description = RPWC H264 test streaming
audio = no
video = yes
videoport = 8004
videopt = 96
videortpmap = H264/90000
videofmtp = profile-level-id=4D401F\;packetization-mode=1

I have googled a similar problem (http://stackoverflow.com/questions/21120717/h-264-video-wont-play-on-ios).

They say iOS safari support Main profile with AVC level 3.1. I'm tried this proposal but it doesn't help me too..

I'm also tried the following "pairs" (profile-level-id + profile) without success:

"42e028 + baseline"  
"640028 + hight"

No any errors in console. Traffic for the app is also OK (~100kbps). But I see green square instead of image..

ibc commented 8 years ago

This is not a specific bug report but a usage problem. Please use the mailing list, but don't expect others to check your whole code and thirdy party libraries.

saghul commented 8 years ago

@ibc the tutorial uses H264, which might actually be the problem here. @bushev what version of the plugin are you using?

bushev commented 8 years ago

@saghul I use latest version: 3.1.0

I also suspect that is can be some encoding related problem.. I have described my case here more detailed: http://stackoverflow.com/questions/38447053/embed-h264-stream-using-html5-video-tag-on-ios

I have updated this topic as well.

saghul commented 8 years ago

@bushev I'm afraid you might have ran into https://github.com/eface2face/cordova-plugin-iosrtc/issues/170

bushev commented 8 years ago

@saghul I just tested 2.2.4 with the same result..

bushev commented 8 years ago

@ibc So, I suspect that cordova-plugin-iosrtc is not fully support H.264 streams. What do you think?

ibc commented 8 years ago

Honestly I've no idea. This is something related to libwebrtc that will be suddenly and magically fixed.

saghul commented 8 years ago

Since H264 works in Chrome I guess there is something we are not doing right somewhere. So far nobody has found the cause though :-(

murillo128 commented 8 years ago

Chrome uses Cisco h264 encoder while libwebrtc should use Apple h264 hardware codecs on iOS, not sure if it is ready for prime time.

saghul commented 8 years ago

Good point! It did work at some point, albeit with a very low FPS, IIRC.

murillo128 commented 8 years ago

FWIW https://groups.google.com/d/msgid/discuss-webrtc/51da720d-4e44-4152-8294-ebe2c34f999d%40googlegroups.com?utm_medium=email&utm_source=footer

El 20/7/2016 21:04, "Saúl Ibarra Corretgé" notifications@github.com escribió:

Good point! It did work at some point, albeit with a very low FPS, IIRC.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/eface2face/cordova-plugin-iosrtc/issues/193#issuecomment-233929996, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBW889RSp0p0H73v2J7zfUbvtLm2UN6ks5qXg68gaJpZM4JO8cp .

saghul commented 8 years ago

Looks like we're not alone!

x3mall1986 commented 8 years ago

Have the same problem. Revision libWebRTC 13524 img_3509

charllie commented 8 years ago

any news?

antoniotuzzi commented 7 years ago

Any news ? ;)

saghul commented 7 years ago

I'm afraid not.

menelike commented 7 years ago

I'm not an expert on this stack, anyone tried the suggestion from https://groups.google.com/d/msg/discuss-webrtc/HR20Q611sYc/OpmRc5XbBQAJ ?

For those who still facing this issue: libjingle_peerconnection (talk/app/objc) is outdated now, use new files: src/webrtc/sdk/objc You can compile a static library or framework using script available at : src/webrtc/build/ios/build_ios_libs.sh https://chromium.googlesource.com/external/webrtc/+/master/webrtc/build/ios/build_ios_libs.sh

saghul commented 7 years ago

Thanks for the heads up, I'll add a note to #170, hopefully I can give it a shot in the upcoming weeks.

sezerkorkmaz commented 7 years ago

any news?

saghul commented 7 years ago

Alas, no.

krishnaclouds commented 6 years ago

Any Solution? Facing black video problem even in Android too!!