Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtp uri problem #2697

Closed
aboelf opened this issue May 26, 2022 · 19 comments
Closed

rtp uri problem #2697

aboelf opened this issue May 26, 2022 · 19 comments
Assignees
Labels

Comments

@aboelf
Copy link

aboelf commented May 26, 2022

Bug

in video.js
const isNetwork = !!(uri && uri.match(/^https?:/));
if video stream is rtsp,like 'rtsp://192.168.241.26/7/16/20220520/273743671/273743671.ts' or 'rtp://239.255.3.3:8000' ,isNetwork is wrong.

const isNetwork = !!(uri && uri.match(/^(https?|rtp|rtsp):/));

@hueniverse
Copy link
Contributor

Is rtp even supported?

@aboelf
Copy link
Author

aboelf commented May 27, 2022

Is rtp even supported

Yes, Old live system. MediaPlayer module in android can play rtp video. I think issue #2254 is the same question.

@hueniverse
Copy link
Contributor

Do Exoplayer and iOS support it?

@aboelf
Copy link
Author

aboelf commented May 27, 2022

Do Exoplayer and iOS support it?
I know it's old live solution protocol.
IOS support it, newerExoplayer supports it too. Exoplayer add RTSP module in 2.14.0

@hueniverse
Copy link
Contributor

Is it just a matter of supporting the http scheme? Nothing else needs to change to support it across Exoplayer and iOS?

@aboelf
Copy link
Author

aboelf commented May 28, 2022

If using mediaplayer, and iOS native player, nothing else needs to change. But I think it needs to change exoplayer part to support RTSP. The exoplayer in RNV is com.google.android.exoplayer:exoplayer:2.13.3.

@hueniverse
Copy link
Contributor

We are removing support for the Android mediaplayer. If this requires work for Exoplayer, then we need to also fix that in the PR.

@aboelf
Copy link
Author

aboelf commented May 30, 2022

Thanks a lot. I think rtsp is important. Please upgrade the exoplayer version.

@freeboub
Copy link
Collaborator

freeboub commented Aug 6, 2022

looks like a real issue, let's reopen.
I pull request is wellcome :)

@freeboub freeboub reopened this Aug 6, 2022
@freeboub
Copy link
Collaborator

@aboelf Just try to implement this feature, but it is not so simple :)
I pushed my changes here: #2824
I cannot figure out why this is not working, but it seems that exoplayer implementation is partial :/
see: https://exoplayer.dev/rtsp.html
Please let me know if you are able to test it. If this is sucessfull I can rework it to merge it.
Thank you

@aboelf
Copy link
Author

aboelf commented Aug 22, 2022

@aboelf Just try to implement this feature, but it is not so simple :) I pushed my changes here: #2824 I cannot figure out why this is not working, but it seems that exoplayer implementation is partial :/ see: https://exoplayer.dev/rtsp.html Please let me know if you are able to test it. If this is sucessfull I can rework it to merge it. Thank you

I will test it soon. I found that exoplayer implementation is partial which mattered my project critically, so I changed the module that using ijkplayer. I will help you check the android log.

@aboelf
Copy link
Author

aboelf commented Aug 26, 2022

@aboelf Just try to implement this feature, but it is not so simple :) I pushed my changes here: #2824 I cannot figure out why this is not working, but it seems that exoplayer implementation is partial :/ see: https://exoplayer.dev/rtsp.html Please let me know if you are able to test it. If this is sucessfull I can rework it to merge it. Thank you

I have tested your commit. I think the js part is correct.But the problem that not working is android part is not fitting rtsp. I checked adb log.According this log,I think exoplayer uses HttpDataSource to handle rtsp protocol.
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: Playback error
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: com.google.android.exoplayer2.ExoPlaybackException: Source error
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:641)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:613)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at android.os.Handler.dispatchMessage(Handler.java:102)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at android.os.Looper.loop(Looper.java:193)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at android.os.HandlerThread.run(HandlerThread.java:65)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Malformed URL
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.makeRequest(OkHttpDataSource.java:379)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:275)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1009)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at java.lang.Thread.run(Thread.java:764)
08-26 04:11:33.584 11031 11076 I ReactNativeJS: {"error":{"errorStackTrace":"com.google.android.exoplayer2.ExoPlaybackException: Source error\n\tat com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:641)\n\tat com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:613)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:193)\n\tat android.os.HandlerThread.run(HandlerThread.java:65)\nCaused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Malformed URL\n\tat com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.makeRequest(OkHttpDataSource.java:379)\n\tat com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:275)\n\tat com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)\n\tat com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)\n\tat com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1009)\n\tat com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)\n\tat java.lang.Thread.run(Thread.java:764)\n","errorCode":"21004","errorException":"com.google.android.exoplayer2.ExoPlaybackException: Source error","errorString":"ExoPlaybackException: ERROR_CODE_FAILED_RUNTIME_CHECK"}}

1 similar comment
@aboelf
Copy link
Author

aboelf commented Aug 26, 2022

@aboelf Just try to implement this feature, but it is not so simple :) I pushed my changes here: #2824 I cannot figure out why this is not working, but it seems that exoplayer implementation is partial :/ see: https://exoplayer.dev/rtsp.html Please let me know if you are able to test it. If this is sucessfull I can rework it to merge it. Thank you

I have tested your commit. I think the js part is correct.But the problem that not working is android part is not fitting rtsp. I checked adb log.According this log,I think exoplayer uses HttpDataSource to handle rtsp protocol.
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: Playback error
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: com.google.android.exoplayer2.ExoPlaybackException: Source error
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:641)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:613)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at android.os.Handler.dispatchMessage(Handler.java:102)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at android.os.Looper.loop(Looper.java:193)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at android.os.HandlerThread.run(HandlerThread.java:65)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Malformed URL
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.makeRequest(OkHttpDataSource.java:379)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:275)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1009)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
08-26 04:11:33.557 11031 11118 E ExoPlayerImplInternal: at java.lang.Thread.run(Thread.java:764)
08-26 04:11:33.584 11031 11076 I ReactNativeJS: {"error":{"errorStackTrace":"com.google.android.exoplayer2.ExoPlaybackException: Source error\n\tat com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:641)\n\tat com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:613)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:193)\n\tat android.os.HandlerThread.run(HandlerThread.java:65)\nCaused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Malformed URL\n\tat com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.makeRequest(OkHttpDataSource.java:379)\n\tat com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:275)\n\tat com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)\n\tat com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)\n\tat com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1009)\n\tat com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)\n\tat java.lang.Thread.run(Thread.java:764)\n","errorCode":"21004","errorException":"com.google.android.exoplayer2.ExoPlaybackException: Source error","errorString":"ExoPlaybackException: ERROR_CODE_FAILED_RUNTIME_CHECK"}}

@freeboub
Copy link
Collaborator

freeboub commented Jan 3, 2023

@aboelf I finally find time to investigate remaining issue! I can now stream a sample rtsp stream as added in the sample.
Please let me know if it is OK for you

@freeboub freeboub self-assigned this Jan 3, 2023
@aboelf
Copy link
Author

aboelf commented Jan 4, 2023

@aboelf I finally find time to investigate remaining issue! I can now stream a sample rtsp stream as added in the sample. Please let me know if it is OK for you

sorry I can't help you to test it. Our project uses ffmpeg framework because of the network type.Quote to https://exoplayer.dev/rtsp.html,multicast is not supported.I can't test in our rtsp stream.

@BILLXZY1215
Copy link

@aboelf I finally find time to investigate remaining issue! I can now stream a sample rtsp stream as added in the sample. Please let me know if it is OK for you

How about udp? Does this also supported? Thanks.

@freeboub
Copy link
Collaborator

I think this would need additional devs. Something similar to the opened rtsp feature !

@aboelf
Copy link
Author

aboelf commented Feb 17, 2023

@aboelf I finally find time to investigate remaining issue! I can now stream a sample rtsp stream as added in the sample. Please let me know if it is OK for you

How about udp? Does this also supported? Thanks.

udp is supported,tcp is too.
Supported network types
RTP over UDP unicast (multicast is not supported).
Interleaved RTSP, RTP over RTSP using TCP.

@freeboub
Copy link
Collaborator

rtsp intregrated in this PR: #3677
Let's close this issue ! (will be available in 6.0.0-beta.9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants