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
12.05k stars 1.51k forks source link

DJI Drone streaming issue when audio is enabled #928

Closed darvin closed 2 years ago

darvin commented 2 years ago

We try to stream video from DJI Go app running on iOS device connected to DJI Mavic 2s to a rtsp-simple-server running locally in the docker

2022/04/25 22:46:49 INF [RTMP] [conn 172.17.0.1:63322] opened
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63322] closed (unexpected packet (6))
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63324] opened
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63324] closed (unexpected packet (6))
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63326] opened
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63326] closed (unexpected packet (6))
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63328] opened
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63328] closed (unexpected packet (6))
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63330] opened
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63330] closed (unexpected packet (6))
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63332] opened
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63332] closed (unexpected packet (6))
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63334] opened
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63334] closed (unexpected packet (6))
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63336] opened
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63336] closed (unexpected packet (6))
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63338] opened
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63338] closed (unexpected packet (6))
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63340] opened
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63340] closed (unexpected packet (6))
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63342] opened
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63342] closed (unexpected packet (6))
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63344] opened
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63344] closed (unexpected packet (6))
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63346] opened
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63346] closed (unexpected packet (6))
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63348] opened
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63348] closed (unexpected packet (6))
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63350] opened
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63350] closed (unexpected packet (6))
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63352] opened
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63352] closed (unexpected packet (6))
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63354] opened
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63354] closed (unexpected packet (6))
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63356] opened
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63356] closed (unexpected packet (6))
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63358] opened
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63358] closed (unexpected packet (6))
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63360] opened
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63360] closed (unexpected packet (6))
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63362] opened
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63362] closed (unexpected packet (6))
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63364] opened
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63364] closed (unexpected packet (6))
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63366] opened
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63366] closed (unexpected packet (6))
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63368] opened
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63368] closed (unexpected packet (6))
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63370] opened
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63370] closed (unexpected packet (6))
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63372] opened
2022/04/25 22:47:00 INF [RTMP] [conn 172.17.0.1:63372] closed (unexpected packet (6))
2022/04/25 22:47:00 INF [RTMP] [conn 172.17.0.1:63374] opened
^C2022/04/25 22:47:01 INF shutting down gracefully
2022/04/25 22:47:01 INF [RTSP] [session 834561455] destroyed (terminated)
2022/04/25 22:47:01 INF [RTMP] [conn 172.17.0.1:63374] closed (terminated)
2022/04/25 22:47:01 INF [RTSP] listener is closing
2022/04/25 22:47:01 INF [HLS] listener is closing
2022/04/25 22:47:01 INF [RTMP] listener is closing
2022/04/25 22:47:01 INF waiting for external commands
darvin commented 2 years ago

https://zirukraine.github.io/

https://github.com/StandartTemplateConstruct/RtmpAI https://github.com/StandartTemplateConstruct/SkyEyeAI https://github.com/StandartTemplateConstruct/SkyEyeDJIMavicIOS

Marshmellow84 commented 2 years ago

We try to stream video from DJI Go app running on iOS device connected to DJI Mavic 2s to a rtsp-simple-server running locally in the docker

2022/04/25 22:46:49 INF [RTMP] [conn 172.17.0.1:63322] opened
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63322] closed (unexpected packet (6))
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63324] opened
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63324] closed (unexpected packet (6))
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63326] opened
2022/04/25 22:46:50 INF [RTMP] [conn 172.17.0.1:63326] closed (unexpected packet (6))
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63328] opened
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63328] closed (unexpected packet (6))
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63330] opened
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63330] closed (unexpected packet (6))
2022/04/25 22:46:51 INF [RTMP] [conn 172.17.0.1:63332] opened
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63332] closed (unexpected packet (6))
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63334] opened
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63334] closed (unexpected packet (6))
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63336] opened
2022/04/25 22:46:52 INF [RTMP] [conn 172.17.0.1:63336] closed (unexpected packet (6))
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63338] opened
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63338] closed (unexpected packet (6))
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63340] opened
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63340] closed (unexpected packet (6))
2022/04/25 22:46:53 INF [RTMP] [conn 172.17.0.1:63342] opened
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63342] closed (unexpected packet (6))
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63344] opened
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63344] closed (unexpected packet (6))
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63346] opened
2022/04/25 22:46:54 INF [RTMP] [conn 172.17.0.1:63346] closed (unexpected packet (6))
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63348] opened
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63348] closed (unexpected packet (6))
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63350] opened
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63350] closed (unexpected packet (6))
2022/04/25 22:46:55 INF [RTMP] [conn 172.17.0.1:63352] opened
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63352] closed (unexpected packet (6))
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63354] opened
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63354] closed (unexpected packet (6))
2022/04/25 22:46:56 INF [RTMP] [conn 172.17.0.1:63356] opened
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63356] closed (unexpected packet (6))
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63358] opened
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63358] closed (unexpected packet (6))
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63360] opened
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63360] closed (unexpected packet (6))
2022/04/25 22:46:57 INF [RTMP] [conn 172.17.0.1:63362] opened
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63362] closed (unexpected packet (6))
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63364] opened
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63364] closed (unexpected packet (6))
2022/04/25 22:46:58 INF [RTMP] [conn 172.17.0.1:63366] opened
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63366] closed (unexpected packet (6))
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63368] opened
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63368] closed (unexpected packet (6))
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63370] opened
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63370] closed (unexpected packet (6))
2022/04/25 22:46:59 INF [RTMP] [conn 172.17.0.1:63372] opened
2022/04/25 22:47:00 INF [RTMP] [conn 172.17.0.1:63372] closed (unexpected packet (6))
2022/04/25 22:47:00 INF [RTMP] [conn 172.17.0.1:63374] opened
^C2022/04/25 22:47:01 INF shutting down gracefully
2022/04/25 22:47:01 INF [RTSP] [session 834561455] destroyed (terminated)
2022/04/25 22:47:01 INF [RTMP] [conn 172.17.0.1:63374] closed (terminated)
2022/04/25 22:47:01 INF [RTSP] listener is closing
2022/04/25 22:47:01 INF [HLS] listener is closing
2022/04/25 22:47:01 INF [RTMP] listener is closing
2022/04/25 22:47:01 INF waiting for external commands

What port are you using? I have a dji spark and it tried to use port 1935, never worked, changed to 8554 and has worked since

pbi1 commented 2 years ago

Same here. Stream is working with DJI M210 and Mavic 2 Enterprise. Getting a closed (unexpected packet (6)) with an DJI Mavic 3

aler9 commented 2 years ago

Please (anyone) provide a network dump, that can be generated in this way:

1) Download wireshark (https://www.wireshark.org/) 2) Start capturing on the interface used for exchanging RTSP (if the server and the target software are both installed on your pc, the interface is probably "loopback", otherwise it's the one of your network card) 3) Start the server and replicate the issue 4) Stop capturing, save the result in .pcap format 5) Attach

ilterpehlivan commented 2 years ago

I have mavic 2 Enterprise and I tested with its mobile SDK -> https://developer.dji.com/api-reference/android-api/Components/LiveStreamManager/DJILiveStreamManager.html , it works fine! simple-server receives the RTMP succesfully convert it to HLS or RTSP no problem!
@pbi1 are you using the same SDK as above ?

aler9 commented 2 years ago

The problem is that the server receives an AACDecoderConfig (packet type 6) before receiving the track list (Metadata packet), i.e. it receives audio data before receiving the track list. We need to find a smarter way to find out what the tracks are, even if the drone doesn't send the track list.

ilterpehlivan commented 2 years ago

The problem is that the server receives an AACDecoderConfig (packet type 6) before receiving the track list (Metadata packet), i.e. it receives audio data before receiving the track list. We need to find a smarter way to find out what the tracks are, even if the drone doesn't send the track list.

Himm that is your expertise @aler9 :) but based on what you are saying, it works for me because my audio is disabled ?

aler9 commented 2 years ago

Himm that is your expertise @aler9 :) but based on what you are saying, it works for me because my audio is disabled ?

Probably yes :)

This is what normally happens when a publisher wants to publish something to the server, with RTSP or RTMP:

1) it connects to the server 2) it sends the track list 3) it starts streaming

Some RTMP clients (like the DJI one) skip the second point, therefore we don't know what exactly they are streaming (video? audio? both?). I already edited the code in order to support streaming video without sending the track list, not audio, but evidently this is not enough. The current code is here:

https://github.com/aler9/rtsp-simple-server/blob/7ecd52808a27e782ce3748e682a4cdf2716a88a3/internal/rtmp/conn.go#L226

pbi1 commented 2 years ago

Here is a pcapng from a DJI Mavic DJIMavic3.zip 3

won't work either audio is turned on or off

Simple Server is running well with a Mavic 2 oder a Matrice 210 @ilterpehlivan i use a standard controller and integrated live streaming function connected with a LTE router using VPN

DonKingMat commented 2 years ago

Same issue here with Mavic Air 2 (Firmware updated today) with default controller using the iOS DJI Fly App (App updated today) in Version 1.6.2 on an iPhone X with latest iOS 15.5 (updated today).

[RTMP] opened
[RTMP] is publishing to path 'dji', 1 track
[RTMP] closed (received an AAC packet, but track is not set up)
[RTMP] opened
[RTMP] closed (unexpected packet (6))
[RTMP] opened
[RTMP] closed (unexpected packet (6))

... endless repeating until stopping the broadcast in DJI Fly App.

See also .pcap.

Another idea is that @all of us open a ticket at DJI support forum but what should we explain to them what they have to fix in detail!? I still open a ticket by DJI support (4262609) in my words and some snippets from this issue here.

Update 28.05.: DJI is interested in some screenshots and all SW and FW versions to presenting that to their dev team. I'll keep you updated here. New DJI Ticket Number 4276625

aler9 commented 2 years ago

I've changed the track detection algorithm: now, when metadata is not provided by the client (like in case of DJI), the server analyzes 1 second of packets - if it founds video packets, it creates a video track, and if it founds audio packets, it creates an audio track. After 1 second, the analysis is stopped.

Please try this nightly release and let me know if it works: [link removed]

pbi1 commented 2 years ago

Tried today with a DJI Mavic 3. The Drone was able to establish a connection and deliever a quick stream. However the server crashed afterwards:

10.20.100.161 is the drone 10.10.0.22 is a Synology VMS Surveillance Station

2022/06/08 11:52:44 INF [RTMP] [conn 10.20.100.161:55402] is publishing to path 'live', 2 tracks 2022/06/08 11:52:45 INF [RTSP] [conn 10.10.0.25:48268] opened 2022/06/08 11:52:45 INF [RTSP] [session 443287507] created by 10.10.0.25:48268 2022/06/08 11:52:45 INF [RTSP] [session 443287507] is reading from path 'live', 2 tracks with TCP 2022/06/08 11:52:45 INF [RTSP] [conn 10.10.0.25:48268] closed (terminated) 2022/06/08 11:52:45 INF [RTSP] [session 443287507] destroyed (teared down by 10.10.0.25:48268) 2022/06/08 11:52:45 INF [RTSP] [conn 10.10.0.22:48210] opened 2022/06/08 11:52:45 INF [RTSP] [session 621718310] created by 10.10.0.22:48210 2022/06/08 11:52:45 INF [RTSP] [session 621718310] is reading from path 'live', 2 tracks with TCP 2022/06/08 11:52:45 INF [RTSP] [conn 10.10.0.22:48214] opened 2022/06/08 11:52:45 INF [RTSP] [session 255273248] created by 10.10.0.22:48214 2022/06/08 11:52:45 INF [RTSP] [session 255273248] is reading from path 'live', 2 tracks with TCP 2022/06/08 11:52:45 INF [RTSP] [conn 10.10.0.22:48214] closed (terminated) 2022/06/08 11:52:45 INF [RTSP] [session 255273248] destroyed (teared down by 10.10.0.22:48214) 2022/06/08 11:52:45 INF [RTSP] [conn 10.10.0.25:48274] opened 2022/06/08 11:52:45 INF [RTSP] [session 470762644] created by 10.10.0.25:48274 2022/06/08 11:52:45 INF [RTSP] [session 470762644] is reading from path 'live', 2 tracks with TCP 2022/06/08 11:52:49 INF [RTSP] [conn 10.10.0.22:48210] closed (terminated) panic: runtime error: index out of range [0] with length 0

goroutine 184 [running]: github.com/aler9/gortsplib/pkg/h264.IDRPresent({0xc0000b8ca8, 0xc0000b8ca8, 0x1}) /go/pkg/mod/github.com/aler9/gortsplib@v0.0.0-20220604232719-2fa3148a2751/pkg/h264/idrpresent.go:6 +0x6b github.com/aler9/rtsp-simple-server/internal/core.(rtmpConn).runPublish(0xc0005b41a0, {0x2, 0x0}) /s/internal/core/rtmp_conn.go:613 +0xfbb github.com/aler9/rtsp-simple-server/internal/core.(rtmpConn).runInner(0xc0005b41a0, {0xcdd638, 0xc0005b0d80}) /s/internal/core/rtmp_conn.go:218 +0x159 github.com/aler9/rtsp-simple-server/internal/core.(rtmpConn).run.func1.3() /s/internal/core/rtmp_conn.go:182 +0x2e created by github.com/aler9/rtsp-simple-server/internal/core.(rtmpConn).run.func1 /s/internal/core/rtmp_conn.go:181 +0x2bd

aler9 commented 2 years ago

Thanks for the report, please try this new release: [link removed]

pbi1 commented 2 years ago

Thanks for your great work! Now everything works fine!

aler9 commented 2 years ago

Thanks for your great work! Now everything works fine!

Thank you for the feedback, i don't own a DJI drone, so it would have been impossible to solve the issue.

DonKingMat commented 2 years ago

Dears.

I've got feedback from DJI support that they was trying to fix that issue by iOS Fly-App version v1.6.6 but neither this DJI app nor the rtsp-simple-server v.1.19.1 will allow me to stream direct from the DJI Fly App via RTSP to the rtsp-simple-server.

Nearby same log entries:

<13>1 2022-06-18T16:03:34.563489+02:00 rtsp-simple-server - - - - -  2022/06/18 16:03:34 INF rtsp-simple-server v0.19.1 - EOM
<13>1 2022-06-18T16:03:34.576234+02:00 rtsp-simple-server - - - - -  2022/06/18 16:03:34 INF [RTSP] listener opened on x.x.x.x:8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP) - EOM
<13>1 2022-06-18T16:03:34.576828+02:00 rtsp-simple-server - - - - -  2022/06/18 16:03:34 INF [RTMP] listener opened on x.x.x.x:1935 - EOM
<13>1 2022-06-18T16:03:34.577491+02:00 rtsp-simple-server - - - - -  2022/06/18 16:03:34 INF [HLS] listener opened on x.x.x.x:8888 - EOM
<13>1 2022-06-18T16:03:44.402002+02:00 rtsp-simple-server - - - - - Jun 18 16:03:39 localhost systemd[1]: systemd-hostnamed.service: Succeeded. - EOM
<13>1 2022-06-18T16:03:59.504394+02:00 rtsp-simple-server - - - - -  2022/06/18 16:03:59 INF [RTMP] [conn y.y.y.y:51753] opened - EOM
<13>1 2022-06-18T16:04:00.089170+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:00 INF [RTMP] [conn y.y.y.y:51753] is publishing to path 'dji', 1 track - EOM
<13>1 2022-06-18T16:04:00.282858+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:00 INF [RTMP] [conn y.y.y.y:51753] closed (received an AAC packet, but track is not set up) - EOM
<13>1 2022-06-18T16:04:00.434461+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:00 INF [RTMP] [conn y.y.y.y:51756] opened - EOM
<13>1 2022-06-18T16:04:00.654822+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:00 INF [RTMP] [conn y.y.y.y:51756] closed (unexpected packet (6)) - EOM
<13>1 2022-06-18T16:04:00.766431+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:00 INF [RTMP] [conn y.y.y.y:51758] opened - EOM
<13>1 2022-06-18T16:04:01.005942+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:00 INF [RTMP] [conn y.y.y.y:51758] closed (unexpected packet (6)) - EOM
<13>1 2022-06-18T16:04:01.069526+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:01 INF [RTMP] [conn y.y.y.y:51760] opened - EOM
<13>1 2022-06-18T16:04:01.309942+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:01 INF [RTMP] [conn y.y.y.y:51760] closed (unexpected packet (6)) - EOM
<13>1 2022-06-18T16:04:01.377771+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:01 INF [RTMP] [conn y.y.y.y:51761] opened - EOM
<13>1 2022-06-18T16:04:01.833312+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:01 INF [RTMP] [conn y.y.y.y:51761] closed (unexpected packet (6)) - EOM
<13>1 2022-06-18T16:04:01.855640+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:01 INF [RTMP] [conn y.y.y.y:51763] opened - EOM
<13>1 2022-06-18T16:04:02.246004+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:02 INF [RTMP] [conn y.y.y.y:51763] closed (unexpected packet (6)) - EOM
<13>1 2022-06-18T16:04:02.279931+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:02 INF [RTMP] [conn y.y.y.y:51765] opened - EOM
<13>1 2022-06-18T16:04:02.618294+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:02 INF [RTMP] [conn y.y.y.y:51765] is publishing to path 'dji', 1 track - EOM
<13>1 2022-06-18T16:04:02.648190+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:02 INF [RTMP] [conn y.y.y.y:51765] closed (received an AAC packet, but track is not set up) - EOM
<13>1 2022-06-18T16:04:02.700497+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:02 INF [RTMP] [conn y.y.y.y:51767] opened - EOM
<13>1 2022-06-18T16:04:03.145339+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:03 INF [RTMP] [conn y.y.y.y:51767] closed (unexpected packet (6)) - EOM
<13>1 2022-06-18T16:04:03.194812+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:03 INF [RTMP] [conn y.y.y.y:51771] opened - EOM
<13>1 2022-06-18T16:04:03.668143+02:00 rtsp-simple-server - - - - -  2022/06/18 16:04:03 INF [RTMP] [conn y.y.y.y:51771] closed (unexpected packet (6)) - EOM
aler9 commented 2 years ago

fixed in v0.19.2.

DonKingMat commented 2 years ago

Confirmed!

@aler9 I may thank you A LOT! Now it is working (mostly) like expected.

Now ... after a couple of minutes (four or five mins) of RTSP streaming to the rtsp-simple-server ... the DJI Fly App unecpectedly crashes on iPhone X (with latest iOS 15.5 and latest DJI Fly app version 1.6.6(645)).

I will report this behavior to DJI and let this community know if any result is coming back ...

pbi1 commented 2 years ago

After an DJI update the stream with a Mavic 3 is crashing again with the following error :-(

2022/08/03 18:41:00 INF [RTMP] [conn 10.20.100.161:43412] is publishing to path 'live', 1 track panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x8bf6e0]

goroutine 836 [running]: github.com/aler9/gortsplib/pkg/rtph264.(Encoder).Encode(0x0, {0xc0006164e0, 0x2, 0x0}, 0xc000378605) /go/pkg/mod/github.com/aler9/gortsplib@v0.0.0-20220624182352-793cea631b0d/pkg/rtph264/encoder.go:73 +0x240 github.com/aler9/rtsp-simple-server/internal/core.(rtmpConn).runPublish(0xc0003e85b0, {0x2, 0x0}) /s/internal/core/rtmp_conn.go:578 +0xa56 github.com/aler9/rtsp-simple-server/internal/core.(rtmpConn).runInner(0xc0003e85b0, {0xc955d8, 0xc00031b280}) /s/internal/core/rtmp_conn.go:218 +0x159 github.com/aler9/rtsp-simple-server/internal/core.(rtmpConn).run.func1.3() /s/internal/core/rtmp_conn.go:182 +0x2e created by github.com/aler9/rtsp-simple-server/internal/core.(*rtmpConn).run.func1 /s/internal/core/rtmp_conn.go:181 +0x2bd

@aler9 would it be possible to have a look at this? :-)

aler9 commented 2 years ago

@pbi1 please open another issue and provide relevant infos (which version are you using, and if the issue is still present on latest version). thanks.