bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
11.7k stars 1.47k forks source link

RTSP sessions sometimes terminate with Android ExoPlayer clients due to unsupported RTP AggregationPacket #2272

Closed machenmusik closed 1 year ago

machenmusik commented 1 year ago

Which version are you using?

v1.0.0

Which operating system are you using?

Describe the issue

RTSP sessions sometimes terminate with Android ExoPlayer clients due to unsupported RTP AggregationPacket. It's unclear exactly what the condition is that causes RTP AggregationPacket usage, so if it is possible to have a configuration option to avoid use of RTP AggregationPacket, that is probably best.

Describe how to replicate the issue

  1. start the server
  2. publish with camera using ffmpeg source and runOnDemand (unclear exactly what the condition is that causes RTP AggregationPacket usage)
  3. read with Android ExoPlayer client (e.g. demo app)
  4. when RTP AggregationPacket usage occurs, Android ExoPlayer client fails; this error can be found in adb logcat: java.lang.UnsupportedOperationException: need to implement processAggregationPacket

Did you attach the server logs?

no

Did you attach a network dump?

no

aler9 commented 1 year ago

Hello, RTP packets are generated by the publisher, in this case FFmpeg. The server just routes them from publisher to readers, so nothing can be done on server side.

Aggregated RTP packets are generated by FFmpeg in order to aggregate together multiple small H264 NALUs, typically SPS and PPS. They are really common and i don't think there's a FFmpeg option to disable them. My advice is to open an issue in ExoPlayer, since it's the only part that is lacking something.

machenmusik commented 1 year ago

Thanks for the quick response! I thought it might be an issue when publishing as RTSP from non-RTSP sources, as well.

aler9 commented 1 year ago

Yes, it might be an issue since in case of non-RTSP sources it's the server that generates RTP packets, but aggregated packets are not an optional feature, they are an essential part of RFC6184. ExoPlayer has to support them.

github-actions[bot] commented 6 months ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.