google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.71k stars 6.02k forks source link

RTSP crash caused by sprop-parameter-sets empty #10067

Closed wingkingbobo closed 2 years ago

wingkingbobo commented 2 years ago

It looks like a crash caused by "sprop parameter sets" being empty. It can be played with VLC.

version: v2.17.1

rtsp log:

    RTSP/1.0 200 OK
    CSeq: 2
    Content-Base: rtsp://admin:DSBJRX@192.168.0.115:554/h264/ch1/main/av_stream/
    Content-Type: application/sdp
    Content-Length: 525

    v=0
    o=- 934117181649 934117181649 IN IP4 192.168.0.115
    s=Media Presentation
    e=NONE
    b=AS:5050
    t=0 0
    a=control:rtsp://admin:DSBJRX@192.168.0.115:554/h264/ch1/main/av_stream/
    m=video 0 RTP/AVP 96
    b=AS:5000
    a=control:rtsp://admin:DSBJRX@192.168.0.115:554/h264/ch1/main/av_stream/trackID=1
    a=rtpmap:96 H264/90000
    a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=
    a=Media_header:MEDIAINFO=494D4B48010100000400010000000000000000000000000000000000000000000000000000000000;
    a=appversion:1.0

crash log:

2022-03-14 15:38:40.672 13643-14091/com.ixlab.mapbox.wemap E/DEBUG: java.lang.IllegalArgumentException
2022-03-14 15:38:40.672 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
2022-03-14 15:38:40.673 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspMediaTrack.processH264FmtpAttribute(RtspMediaTrack.java:166)
2022-03-14 15:38:40.673 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspMediaTrack.generatePayloadFormat(RtspMediaTrack.java:119)
2022-03-14 15:38:40.673 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspMediaTrack.<init>(RtspMediaTrack.java:65)
2022-03-14 15:38:40.674 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspClient.buildTrackList(RtspClient.java:347)
2022-03-14 15:38:40.674 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspClient.access$1700(RtspClient.java:75)
2022-03-14 15:38:40.674 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.onDescribeResponseReceived(RtspClient.java:690)
2022-03-14 15:38:40.674 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.handleRtspResponse(RtspClient.java:598)
2022-03-14 15:38:40.675 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.handleRtspMessage(RtspClient.java:507)
2022-03-14 15:38:40.675 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.lambda$onRtspMessageReceived$0$RtspClient$MessageListener(RtspClient.java:500)
2022-03-14 15:38:40.675 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at com.google.android.exoplayer2.source.rtsp.-$$Lambda$RtspClient$MessageListener$9u5JvYWAdRxaQT3-zaI614vd2Qw.run(Unknown Source:4)
2022-03-14 15:38:40.675 13643-14091/com.ixlab.mapbox.wemap E/DEBUG:     at android.os.Handler.handleCallback(Handler.java:900)
claincly commented 2 years ago

It is failing as intended: we don't play H264 content when the sprop-parameter-sets is empty. The parameter set contains sps/pps for the decoder. That being said, you can try removing the checks for sprop-parameter-sets and see if it plays.

lotaviods commented 2 years ago

on my case, fmtpParameters is empty but is playing in vlc

claincly commented 2 years ago

Again, you can try remove the assertion for sprop-parameter-sets and see if it plays.

lotaviods commented 2 years ago

After removing the assertion, video does not play on exo player but does on vlc, i notice that after removing processH265FmtpAttribute, since has no atrr, codec fail on initCodec(codecInfo, crypto)

here is RTP DESCRIBE

v=0
o=- 1109162014219182 0 IN IP4 0.0.0.0
s=HIK Media Server V4.30.201
i=HIK Media Server Session Description : standard
e=NONE
c=IN IP4 0.0.0.0
t=0 0
a=control:*
b=AS:1034
a=range:npt=now-
m=video 0 RTP/AVP 96
i=Video Media
a=rtpmap:96 H265/90000
a=control:trackID=video
b=AS:1024
a=Media_header:MEDIAINFO=494D4B48020100000400050000000000000000000000000000000000000000000000000000000000;
a=appversion:1.0
claincly commented 2 years ago

Hey Luiz - could you try streaming an H264 video with the HIK server?

Or maybe share your test stream? if you're unable to share it publicly, please send them to dev.exoplayer@gmail.com using a subject in the format "Issue #10067". Please also update this issue to indicate you've done this.

google-oss-bot commented 2 years ago

Hey @wingkingbobo. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 2 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@wingkingbobo if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.