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

rtsp client is not working properly (AUD-5874) #1319

Open
alpha-alan opened this issue Nov 19, 2024 · 106 comments
Open

rtsp client is not working properly (AUD-5874) #1319

alpha-alan opened this issue Nov 19, 2024 · 106 comments

Comments

@alpha-alan
Copy link

Environment

  • Module or chip used: ESP32-S3-WROOM-1
  • IDF version v5.3
  • ADF version v2.7
  • Running log:
start 2 rtsp://110.1.1.189:8554/video/t1g711.wav
I (63071187) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Aug 15 2024-04:10:02
I (63071189) ESP_RTSP_CLIENT: Conecting...
I (63071189) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://110.1.1.189:8554/video/dl.wav
demo-chime> I (63071252) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://110.1.1.189:8554/video/dl.wav RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0

I (63071275) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Date: Fri, Nov 15 2024 02:52:33 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER

I (63071288) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://110.1.1.189:8554/video/dl.wav RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp

I (63071370) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Date: Fri, Nov 15 2024 02:52:33 GMT
Content-Base: rtsp://110.1.1.189:8554/video/dl.wav/
Content-Type: application/sdp
Content-Length: 398

v=0
o=- 1731639153368084 1 IN IP4 110.1.1.189
s=WAV Audio Stream, streamed by the LIVE555 Media Server
i=video/dl.wav
t=0 0
a=tool:LIVE555 Streaming Media v2024.10.31
a=type:broadcast
a=control:*
a=range:npt=0-332.801
a=x-qt-text-nam:WAV Audio Stream, streamed by the LIVE555 Media Server
a=x-qt-text-inf:video/dl.wav
m=audio 0 RTP/AVP 10
c=IN IP4 0.0.0.0
b=AS:1411
a=control:track1

I (63071418) ESP_RTSP_CLIENT: TX:

SETUP rtsp://110.1.1.189:8554/video/dl.wav/trackID=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=30950-30951;mode=record
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0
Session: 3609990

I (63071469) ESP_RTSP_CLIENT: RX:

RTSP/1.0 454 Session Not Found
CSeq: 2
Date: Fri, Nov 15 2024 02:52:33 GMT

I (63071471) ESP_RTSP_CLIENT: TX:

PLAY rtsp://110.1.1.189:8554/video/dl.wav RTSP/1.0
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0

I (63071579) ESP_RTSP_CLIENT: RX:

RTSP/1.0 454 Session Not Found
CSeq: 2
Date: Fri, Nov 15 2024 02:52:33 GMT

I (63071581) ESP_RTSP_CLIENT: TX:

TEARDOWN rtsp://110.1.1.189:8554/video/dl.wav RTSP/1.0
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0
Session: 3609990

I (63071605) RTSP_SERVICE: RTSP_STATE_TEARDOWN
I (63071605) ESP_RTSP_CLIENT: RTSP client task stoped

Problem Description

I use esp-rtsp in the example folder as the RTSP client and live555 as the server. One thing I discovered is that the SETUP sent by esp-rtsp to the server contains a session field, but the session is not found on the server side, so a “session not found” error is reported.

According to my understanding, generally in RTSP requests, the session field should not be included in SETUP requests. Why is there a session field here? How can I solve this "session not found" problem

Code to Reproduce This Issue

esp-adf\examples\protocols\esp-rtsp

@github-actions github-actions bot changed the title rtsp client is not working properly rtsp client is not working properly (AUD-5874) Nov 19, 2024
@TempoTian
Copy link
Contributor

I have just fixed the issue, you can verify use attach lib and replace into esp-adf-libs folder.
esp_media_protocols.zip

@ManikandanVaradharaj
Copy link

Can i use the rtsp client protocol in esp32-p4 module

@alpha-alan
Copy link
Author

@TempoTian

The new library solves the problem of SETUP carrying session. But there are still 2 problems, which makes esp-rtsp still unable to connect to a rtsp server.
Question 1:
When I use live555 as the server, I receive "404 Stream Not Found"

I think this is caused by the url suffix in SETUP

The url sent by esp-rtsp is:
SETUP rtsp://110.1.1.189:8554/video/t1g711.wav/trackID=0 RTSP/1.0

For live555, it does not recognize the suffix "trackID=0", and the url it expects to receive is
SETUP rtsp://110.1.1.189:8554/video/t1g711.wav/track1 RTSP/1.0
Here "track1" comes from sdp
a=control:track1

Considering that live555 is a widely used rtsp server, I hope esp-rtsp be compatible with its behavior.
All log

demo-chime> start 2 rtsp://110.1.1.189:8554/video/t1g711.wav
I (2566269) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Nov 20 2024-11:21:23
I (2566271) ESP_RTSP_CLIENT: Conecting...
I (2566272) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://110.1.1.189:8554/video/t1g711.wav
I (2566279) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://110.1.1.189:8554/video/t1g711.wav RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0


I (2566353) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Date: Wed, Nov 20 2024 07:59:53 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER


I (2566366) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://110.1.1.189:8554/video/t1g711.wav RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp


I (2566388) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Date: Wed, Nov 20 2024 07:59:53 GMT
Content-Base: rtsp://110.1.1.189:8554/video/t1g711.wav/
Content-Type: application/sdp
Content-Length: 402

v=0
o=- 1732089593547888 1 IN IP4 110.1.1.189
s=WAV Audio Stream, streamed by the LIVE555 Media Server

t=0 0
a=tool:LIVE555 Streaming Media v2024.10.31
a=type:broadcast
a=control:*
a=range:npt=0-29.983
a=x-qt-text-nam:WAV Audio Stream, streamed by the LIVE555 Media Server
a=x-qt-text-inf:video/t1g711.wav
m=audio 0 RTP/AVP 8
c=IN IP4 0.0.0.0
b=AS:64
a=control:track1

I (2566436) RTSP_SERVICE: RTSP_STATE_SETUP
I (2566446) ESP_RTSP_CLIENT: TX:

SETUP rtsp://110.1.1.189:8554/video/t1g711.wav/trackID=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=39923-39924;mode=record
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0


demo-chime> I (2566486) ESP_RTSP_CLIENT: RX:

RTSP/1.0 404 Stream Not Found
CSeq: 2
Date: Wed, Nov 20 2024 07:59:53 GMT


I (2566489) RTSP_SERVICE: RTSP_STATE_TEARDOWN
I (2566500) ESP_RTSP_CLIENT: RTSP client task stoped

Question 2:
When I use ZLMeiaKit as RTSP server, I encounter the error "454 Session Not Found", which occurs during the PLAY stage.
I think this is because the PLAY command of esp-rtsp does not carry session.

All log:

demo-chime> start 2 rtsp://110.1.1.189:554/live/test
I (43004) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Nov 20 2024-11:21:23
I (43006) ESP_RTSP_CLIENT: Conecting...
I (43006) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://110.1.1.189:554/live/test
I (43039) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://110.1.1.189:554/live/test RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0


I (43053) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Date: Wed, Nov 20 2024 07:00:16 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, ANNOUNCE, RECORD, SET_PARAMETER, GET_PARAMETER
Server: ZLMediaKit(git hash:226b87a/2024-11-18T14:08:53+08:00,branch:master,build time:2024-11-20T11:19:02)


I (43078) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://110.1.1.189:554/live/test RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp


demo-chime> I (43132) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
Content-Base: rtsp://110.1.1.189:554/live/test/
Content-Length: 252
Content-Type: application/sdp
CSeq: 1
Date: Wed, Nov 20 2024 07:00:16 GMT
Server: ZLMediaKit(git hash:226b87a/2024-11-18T14:08:53+08:00,branch:master,build time:2024-11-20T11:19:02)
Session: l9cBm10IEuaH
x-Accept-Dynamic-Rate: 1
x-Accept-Retransmit: our-retransmit

v=0
o=- 0 0 IN IP4 0.0.0.0
s=Streamed by ZLMediaKit(git hash:226b87a/2024-11-18T14:08:53+08:00,branch:master,build time:2024-11-20T11:19:02)
c=IN IP4 0.0.0.0
t=0 0
a=range:npt=now-
a=control:*
m=audio 0 RTP/AVP 8
b=AS:64
a=control:streamid=0

I (43180) RTSP_SERVICE: RTSP_STATE_SETUP
I (43191) ESP_RTSP_CLIENT: TX:

SETUP rtsp://110.1.1.189:554/live/test/trackID=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=32829-32830;mode=record
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0


I (43259) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 2
Date: Wed, Nov 20 2024 07:00:16 GMT
Server: ZLMediaKit(git hash:226b87a/2024-11-18T14:08:53+08:00,branch:master,build time:2024-11-20T11:19:02)
Session: l9cBm10IEuaH
Transport: RTP/AVP/UDP;unicast;client_port=32829-32830;mode=record;server_port=31140-31141;ssrc=7F105C79


I (43284) ESP_RTSP_CLIENT: RTSP Server arport 32829
I (43295) ESP_RTSP_CLIENT: TX:

PLAY rtsp://110.1.1.189:554/live/test RTSP/1.0
CSeq: 3
User-Agent: ESP32-RTSP-client 1.1.0


I (43353) ESP_RTSP_CLIENT: RX:

RTSP/1.0 454 Session Not Found
Connection: Close
CSeq: 3
Date: Wed, Nov 20 2024 07:00:16 GMT
Server: ZLMediaKit(git hash:226b87a/2024-11-18T14:08:53+08:00,branch:master,build time:2024-11-20T11:19:02)
Session: l9cBm10IEuaH


I (43377) ESP_RTSP_CLIENT: TX:

TEARDOWN rtsp://110.1.1.189:554/live/test RTSP/1.0
CSeq: 3
User-Agent: ESP32-RTSP-client 1.1.0
Session: l9cBm10IEuaH


I (43390) RTSP_SERVICE: RTSP_STATE_TEARDOWN
I (43391) ESP_RTSP_CLIENT: RTSP client task stoped

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj Of cource supported for P4. For esp_media_protocol is all software realization, it does not dependent on special platform. Currently it only dependent on media_lib_sal in esp-adf-libs, you can copy these two folder into your project components folder, and used it without ADF also. Just happy to use!

@TempoTian
Copy link
Contributor

TempoTian commented Nov 20, 2024

@alpha-alan I will download live555 and have a try, Thanks for your info, it is easy to fix, once finished I will notify to you. I try mediamtx, It works ok.

@ManikandanVaradharaj
Copy link

@TempoTian but in adf list of table it shows rtc and rtsp will not support for esp32-p4.can u give clear idea for me that how can i do the rtsp client in esp32-p4 with lvgl ui support.because esp32-p4 there is no option to check whether network is working or not through WiFi.

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj You need esp_wifi_remote https://github.com/espressif/esp-wifi-remote to use wifi on P4. The LWIP and socket related things still run on P4, so there is no need to do any change with the lib. Official document updated in delay. We have release P4 support for esp_media_protocols for long time.

@ManikandanVaradharaj
Copy link

ManikandanVaradharaj commented Nov 20, 2024

@TempoTian okay after the wifi connection.. For rtsp protocol in esp32-p4 which are the libraries needed.that i'll implement with lvgl ui support

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj follow this url https://components.espressif.com/components/lvgl/lvgl, you can use command idf.py add-dependency "lvgl/lvgl^9.2.2" in your project to download it directly.

@alpha-alan
Copy link
Author

@TempoTian
I also used mediamtx to test. The error I encountered this time was "400 bad request" esp-rtsp still cannot connect to mediamtx

I noticed a log from mediamtx pointing out the reason:
transport header contains a invalid mode (record)

At the same time, I also noticed that the SETUP of esp-rtsp contains a mode=record, but mediamtx does not recognize it.

SETUP rtsp://110.1.1.189:8554/live/test/trackID=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=35975-35976;mode=record

Hopefully this issue can be resolved along with the two issues I mentioned earlier, thank you.

esp-rtsp all log

demo-chime> start 2 rtsp://110.1.1.189:8554/live/test
I (840385) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Aug 15 2024-04:10:02
I (840387) ESP_RTSP_CLIENT: Conecting...
I (840387) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://110.1.1.189:8554/live/test
I (840398) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://110.1.1.189:8554/live/test RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0


I (840419) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN
Server: gortsplib


I (840432) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://110.1.1.189:8554/live/test RTSP/1.0
CSeq: 1
                                                                                                                                                                                           User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp


I (840511) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Content-Base: rtsp://110.1.1.189:8554/live/test/
Content-Length: 131
Content-Type: application/sdp
Server: gortsplib

v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 0.0.0.0
t=0 0
m=audio 0 RTP/AVP 8
a=control:trackID=0
a=rtpmap:8 PCMA/8000

I (840536) ESP_RTSP_CLIENT: TX:

SETUP rtsp://110.1.1.189:8554/live/test/trackID=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=35975-35976;mode=record
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0
Session: 6809774


I (840601) ESP_RTSP_CLIENT: RX:

RTSP/1.0 400 Bad Request
CSeq: 2
Server: gortsplib


I (840603) ESP_RTSP_CLIENT: TX:

PLAY rtsp://110.1.1.189:8554/live/test RTSP/1.0
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0


I (840615) ESP_RTSP_CLIENT: TX:

TEARDOWN rtsp://110.1.1.189:8554/live/test RTSP/1.0
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0
Session: 6809774


E (840628) TRANS_TCP: tcp_poll_write select error 104, errno = Connection reset by peer, fd = 54
E (840640) ESP_RTSP_CLIENT: Write failed, error: Socket is not connected
I (840651) RTSP_SERVICE: RTSP_STATE_TEARDOWN
I (840652) ESP_RTSP_CLIENT: RTSP client task stoped

mediamtx all log

alan@BUilderServer:~/mediamtx$ ./mediamtx mediamtx.yml
2024/11/20 18:00:55 INF MediaMTX v1.9.3
2024/11/20 18:00:55 INF configuration loaded from /home/alan/mediamtx/mediamtx.yml
2024/11/20 18:00:55 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2024/11/20 18:00:55 INF [RTMP] listener opened on :1935
2024/11/20 18:00:55 INF [HLS] listener opened on :8888
2024/11/20 18:00:55 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)
2024/11/20 18:00:55 INF [SRT] listener opened on :8890 (UDP)
2024/11/20 18:00:59 INF [RTSP] [conn 127.0.0.1:51330] opened
2024/11/20 18:00:59 INF [RTSP] [session 52b540c4] created by 127.0.0.1:51330
2024/11/20 18:00:59 INF [RTSP] [session 52b540c4] is publishing to path 'live/test', 1 track (G711)
2024/11/20 18:01:08 INF [RTSP] [conn 110.1.1.131:51472] opened
2024/11/20 18:01:08 INF [RTSP] [session b71ce285] created by 110.1.1.131:51472
2024/11/20 18:01:08 INF [RTSP] [conn 110.1.1.131:51472] closed: transport header contains a invalid mode (record)
2024/11/20 18:01:08 INF [RTSP] [session b71ce285] destroyed: not in use

@alpha-alan
Copy link
Author

@TempoTian ,Could you please let me know when I might receive the new library with all the issues resolved?

@TempoTian
Copy link
Contributor

@alpha-alan I am undertesting now. It won't take long time. It speeds me some time to setup the server for lib555 done. now it is ready to test.

@ManikandanVaradharaj
Copy link

@TempoTian for rtsp which of the source and header file we can implement in the project that will support for esp32-p4

@alpha-alan
Copy link
Author

@TempoTian
I understand you need to test before releasing a new library. On the other hand, we will also demonstrate the RTSP client function to customers next Tuesday. Could you please give us a new library before get off work tomorrow?

@TempoTian
Copy link
Contributor

You can try follow lib, I test if send and receive supported codec, both as puller and pusher OK.
esp_media_protocol.zip

@ManikandanVaradharaj
Copy link

I'm trying the rtsp protocol inside the video player app like enter the ip address and start the live stream for this i set upto the enter ip address..after ip address it should work through rtsp code for that which libraries would be useful.

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj You can use RTSP server, it will setup a local RTSP server then you can enter server URL and use common player to play it.

@ManikandanVaradharaj
Copy link

Any specific libraries needed for that rather than..esp_media_protocol & media_lib_sal.could i paste in my components that's enough.

@TempoTian
Copy link
Contributor

NO extra lib needed, just these 2 should OK.

@ManikandanVaradharaj
Copy link

In the lib,it has only esp_rtsp.h in esp_media_protocol, file which is not working with adaptability in the project.

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj
Copy link

ManikandanVaradharaj commented Nov 22, 2024 via email

@TempoTian
Copy link
Contributor

P4 Lib is under: https://github.com/espressif/esp-adf-libs/tree/master/esp_media_protocols/lib/esp32p4, ADF already support P4, you can try to use any rtsp example to do test firstly

@ManikandanVaradharaj
Copy link

For the rtsp example try we need to set the lvgl ui setup separately for rtsp right.

@TempoTian
Copy link
Contributor

@alpha-alan Attach new lib here.
libesp_media_protocols.zip

please modify APP as following also:

上层要配合做下面的一些改变:
1: 注册codec 的notify
if (mode == RTSP_CLIENT_PLAY) {
data_cb.receive_audio = _receive_audio;
data_cb.stream_codec = _stream_info_cb;
data_cb.send_audio = NULL;
data_cb.send_video = NULL;
rtsp_config.video_enable = false;
rtsp_config.trans = RTSP_TRANSPORT_UDP;
}

2:notify中改变av stream的codec设定
static int _stream_info_cb(uint8_t aud_codec, uint8_t vid_codec,void *ctx)
{
av_stream_handle_t av_stream = (av_stream_handle_t) ctx;
if (aud_codec == 0) {
av_audio_dec_change_codec(av_stream, AV_ACODEC_G711U);
} else if (aud_codec == 8) {
av_audio_dec_change_codec(av_stream, AV_ACODEC_G711A);
}
return 0;
}

3:av_stream添加API av_audio_dec_change_codec
/**

  • @brief Change audio decoder codec
  • @param[in] av_stream The av_stream handle
  • @param[in] acodec New audio codec
  • @return
  • - ESP_OK on success
    
  • - ESP_ERR_INVALID_ARG on wrong handle
    

*/
int av_audio_dec_change_codec(av_stream_handle_t av_stream, av_stream_acodec_t acodec);

int av_audio_dec_change_codec(av_stream_handle_t av_stream, av_stream_acodec_t acodec)
{
av_stream->config.acodec_type = acodec;
return ESP_OK;
}

4:enhance av_stream 退出的时候让等待写的操作及时返回
int av_audio_dec_stop(av_stream_handle_t av_stream)
{
AUDIO_NULL_CHECK(TAG, av_stream, return ESP_ERR_INVALID_ARG);
if (!av_stream->adec_run) {
return ESP_OK;
}

av_stream->adec_run = false;
if (av_stream->ringbuf_dec) {
    rb_abort(av_stream->ringbuf_dec);
}

@ManikandanVaradharaj
Copy link

@TempoTian could you please say how could i test example rtsp in esp32_p4 module

@TempoTian
Copy link
Contributor

@alpha-alan Please use following lib to test again. Add handle server timeout processing to avoid sever send FIN during RTP receiving.

libesp_media_protocols.zip

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj You can use https://github.com/espressif/esp-adf/tree/master/examples/protocols/esp-rtsp to do test. I think you can start another thread to ask your questions to avoid issue mixing together cause some confusing.

@TempoTian
Copy link
Contributor

For RTSP AAC support, use following lib and follow the readme to do test.
rtsp_aac.zip

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj Can you try with baseline below 640x480 resolution and fetch a log for me? I test baseline decode all right using the test code.

@ManikandanVaradharaj
Copy link

esp> start 2 rtsp://192.168.0.132:554/live
I (42545) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Nov 29 2024-11:42:50
I (42555) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://192.168.0.132:554/live
I (42555) ESP_RTSP_CLIENT: Connecting...
esp> I (48775) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://192.168.0.132:554/live RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0

I (48805) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER

I (48825) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://192.168.0.132:554/live RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp

I (48945) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Content-Type: application/sdp
Content-Base: rtsp://192.168.0.132:554
Content-Length: 416

v=0
o=- 10056366 0 IN IP4 192.168.0.132
s=ameba
c=IN IP4 192.168.0.134
t=0 0
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=control:streamid=0
a=fmtp:96 packetization-mode=0
m=audio 0 RTP/AVP 97
a=rtpmap:97 mpeg4-generic/8000/1
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1588; sizeLength=13; indexLength=3; indexDeltaLength=3; constantDuration=1024; Profile=1
a=control:streamid=1

Get video codec 96
Get video location streamid=0
Get audio codec 97
Get audio codec 129 sample rate 8000 channel 1
Get audio location streamid=1
I (49005) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.132:554/streamid=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=22574-22575
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0

I (49035) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 2
Session: 10056366;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=22574-22575;server_port=55608-55609

I (49055) ESP_RTSP_CLIENT: RTSP Server vrport 55608
Session timeout 40000
I (49065) RTSP_SERVICE: RTSP_STATE_SETUP
I (49065) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.132:554/streamid=1 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=34964-34965
CSeq: 3
User-Agent: ESP32-RTSP-client 1.1.0

I (49085) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 3
Session: 10056366;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=34964-34965;server_port=55608-55609

I (49095) ESP_RTSP_CLIENT: RTSP Server arport 55608
Session timeout 40000
I (49105) RTSP_SERVICE: RTSP_STATE_SETUP
I (49105) ESP_RTSP_CLIENT: TX:

PLAY rtsp://192.168.0.132:554 RTSP/1.0
CSeq: 4
User-Agent: ESP32-RTSP-client 1.1.0
Session: 10056366

I (49155) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 4
Session: 10056366

Open with no ADTS header...1 8000..............
I (49165) H264_DEC.SW: tinyh264 version: 1c7f584
I (49165) RTSP_SERVICE: RTSP_STATE_PLAY
00 00 00 01 21 e0 08 00 08 e4 af 94 57 fe cc a9
E (49195) H264_DEC: ACCESS UNIT BOUNDARY CHECK
E (49195) H264_DEC.SW: Serious error in decoding, failed to activate param sets
I (49215) RTSP_SERVICE: Video resolution 0x0
convert set to 0x4ff3b8d4
E (49225) RTSP_SERVICE: Fail to allocate color convert out buffer
I (49225) RTSP_SERVICE: video render task exited
00 00 00 01 21 e0 0a 00 0a e4 af 94 57 fe b1 51
00 00 00 01 21 e0 0c 00 0c e4 af 94 57 fe 87 40
00 00 00 01 21 e0 0e 00 0e e4 af 94 57 fe b1 51
00 00 00 01 21 e0 10 00 10 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 12 00 12 e4 af 94 57 fe 87 40
W (49615) ESP_RTP: drop 36

00 00 00 01 21 e0 14 00 14 e4 af 94 57 fe b1 51
W (49675) ESP_RTP: drop 44

00 00 00 01 21 e0 18 00 18 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 1a 00 1a e4 af 94 57 fe cc a9
00 00 00 01 21 e0 1c 00 1c e4 af 94 57 fe 87 40
00 00 00 01 21 e0 1e 00 1e e4 af 94 57 fe b1 51
00 00 00 01 21 e0 20 00 20 e4 af 94 57 fe cc a9
00 00 00 01 21 e0 22 00 22 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 24 00 24 e4 af 94 57 fe 87 40
W (49785) ESP_RTP: drop 81

58 9d f0 98 5e 12 34 30 cf 7b 1f dd 36 9b 81 f0
00 00 00 01 21 e0 28 00 28 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 2a 00 2a e4 af 94 57 fe 87 40
00 00 00 01 21 e0 2c 00 2c e4 af 94 57 fe 87 40
00 00 00 01 21 e0 2e 00 2e e4 af 94 57 fe 87 41
00 00 00 01 21 e0 30 00 30 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 32 00 32 e4 af 94 57 dc a6 8c
00 00 00 01 21 e0 34 00 34 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 36 00 36 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 38 00 38 e4 af 94 57 7b 6c bf
00 00 00 01 21 e0 3a 00 3a e4 af 94 57 fe 87 40
00 00 00 01 27 64 00 33 ac 13 1a a0 78 02 27 e5
00 00 00 01 21 e0 02 00 02 e4 af 94 57 c1 63 a4
00 00 00 01 21 e0 04 00 04 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 06 00 06 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 08 00 08 e4 af 94 57 8f 70 7d
00 00 00 01 21 e0 0a 00 0a e4 af 94 57 fe 87 40
00 00 00 01 21 e0 0c 00 0c e4 af 94 57 fe 87 40
00 00 00 01 21 e0 0e 00 0e e4 af 94 57 06 c6 f4
00 00 00 01 21 e0 10 00 10 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 12 00 12 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 14 00 14 e4 af 94 57 06 ef 0e
00 00 00 01 21 e0 16 00 16 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 18 00 18 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 1a 00 1a e4 af 94 57 06 ef 9b
00 00 00 01 21 e0 1c 00 1c e4 af 94 57 fe 87 40
00 00 00 01 21 e0 1e 00 1e e4 af 94 57 fe 87 40
00 00 00 01 21 e0 20 00 20 e4 af 94 57 06 ef 9b
00 00 00 01 21 e0 22 00 22 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 24 00 24 e4 af 94 57 fe 87 41
00 00 00 01 21 e0 26 00 26 e4 af 94 57 06 c7 9d
00 00 00 01 21 e0 28 00 28 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 2a 00 2a e4 af 94 57 fe 87 41
00 00 00 01 21 e0 2c 00 2c e4 af 94 57 1c 6e 81
00 00 00 01 21 e0 2e 00 2e e4 af 94 57 fe 87 40
00 00 00 01 21 e0 30 00 30 e4 af 94 57 fe 87 41
00 00 00 01 21 e0 32 00 32 e4 af 94 57 3c dc fa
00 00 00 01 21 e0 34 00 34 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 36 00 36 e4 af 94 57 fe 87 40
W (51285) ESP_RTP: drop 290

1e 84 d9 b8 7a cf 6a ef cd 25 8b 80 d7 b5 dc 5d
00 00 00 01 21 e0 3a 00 3a e4 af 94 57 fe 87 40
W (51295) ESP_RTP: drop 298

W (51395) ESP_RTP: drop 307

00 00 00 01 21 e0 02 00 02 e4 af 94 57 dc a6 8c
00 00 00 01 21 e0 04 00 04 e4 af 94 57 fe 87 40
W (51405) ESP_RTP: drop 320

00 00 00 01 21 e0 06 00 06 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 08 00 08 e4 af 94 57 ed 15 a8
00 00 00 01 21 e0 0a 00 0a e4 af 94 57 fe 87 40
W (51425) ESP_RTP: drop 335

00 00 00 01 21 e0 0c 00 0c e4 af 94 57 fe 87 40
W (51425) ESP_RTP: drop 341

W (51435) ESP_RTP: drop 348

00 00 00 01 21 e0 0e 00 0e e4 af 94 57 ed 59 63
W (51455) ESP_RTP: drop 356

05 39 f9 52 1a 26 e6 0f 59 71 c3 a6 8a 16 15 c0
00 00 00 01 21 e0 1a 00 1a e4 af 94 57 fe 87 40
00 00 00 01 21 e0 1c 00 1c e4 af 94 57 fe 87 40
00 00 00 01 21 e0 1e 00 1e e4 af 94 57 fe 87 40
00 00 00 01 21 e0 20 00 20 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 22 00 22 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 24 00 24 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 26 00 26 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 28 00 28 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 2a 00 2a e4 af 94 57 fe b1 51
00 00 00 01 21 e0 2c 00 2c e4 af 94 57 fe 87 40
00 00 00 01 21 e0 2e 00 2e e4 af 94 57 fe 87 40
00 00 00 01 21 e0 30 00 30 e4 af 94 57 fe b1 51
00 00 00 01 21 e0 32 00 32 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 34 00 34 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 36 00 36 e4 af 94 57 fe de 20
00 00 00 01 21 e0 38 00 38 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 3a 00 3a e4 af 94 57 fe 87 40
00 00 00 01 27 64 00 33 ac 13 1a a0 78 02 27 e5
00 00 00 01 21 e0 02 00 02 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 04 00 04 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 06 00 06 e4 af 94 57 fe 87 40
00 00 00 01 21 e0 08 00 08 e4 af 94 57 fe 87 41
00 00 00 01 21 e0 0a 00 0a e4 af 94 57 fe 87 40
00 00 00 01 21 e0 0c 00 0c e4 af 94 57 fe cc ca
00 00 00 01 21 e0 0e 00 0e e4 af 94 57 fe 87 40
00 00 00 01 21 e0 10 00 10 e4 af 94 57 fe 87 40

@Sindhuja-15
Copy link

Sindhuja-15 commented Dec 5, 2024

Currently we not support to decode high profile of H264, we have openh264 to support it, but not export it yet.

@TempoTian @ManikandanVaradharaj What was the issue of decoding in high profile format, In both jpeg and h264 u have upto 720p and 1080p right,then what is the use of MIPI 4k display without decoding the high-profile resolution. If h264 decode is not support means we can go through jpeg decode right?

@TempoTian
Copy link
Contributor

@Sindhuja-15 Yes, use JPEG codec we can support 1920x1080 30fps hardware decode and encode. For H264 we only support 1920x1080 encoder, not support decode. If you want to push data to server use high resolution both codec are OK, if want to decode high resolution better to choice JPEG.

@ManikandanVaradharaj
Copy link

@TempoTian could we get the test code using jpeg dec in rtsp client

@Sindhuja-15
Copy link

Sindhuja-15 commented Dec 5, 2024

@TempoTian Then okay, for that can we have a test code with jpeg dec in rtsp client for the p4 display,For video dec we can use jpeg and audio dec we should use again h264.

@ManikandanVaradharaj
Copy link

./ffmpeg -re -stream_loop -1 -i test.mp4 -vf "fps=25,scale=320:240" -c:v libx264 -profile:v baseline -acodec aac -ar 16000 -ac 1 -f rtsp rtsp://xxxxxx/test

@TempoTian Could u tell how to use this command to do transcode and stream video in display

@ManikandanVaradharaj
Copy link

@TempoTian After I changed my sever part into jpeg encoder with width=1280,height=720,fps=30.resolution=HD. esp> start 2 rtsp://192.168.0.132:554/live
I (28455) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Nov 29 2024-11:42:50
I (28455) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://192.168.0.132:554/live
I (28455) ESP_RTSP_CLIENT: Connecting...
I (28585) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://192.168.0.132:554/live RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0

I (28605) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER

esp> I (28615) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://192.168.0.132:554/live RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp

I (28635) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Content-Type: application/sdp
Content-Base: rtsp://192.168.0.132:554
Content-Length: 166

v=0
o=- 10058746 0 IN IP4 192.168.0.132
s=ameba
c=IN IP4 192.168.0.134
t=0 0
m=video 0 RTP/AVP 26
a=rtpmap:26 JPEG/90000
a=control:streamid=0
a=framerate:30

Get video codec 26
Get video location streamid=0
W (28655) RTSP_SERVICE: Already stopped
I (28665) RTSP_SERVICE: RTSP_STATE_TEARDOWN
I (28675) ESP_RTSP_CLIENT: RTSP client task stoped

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj Can you show, which server do you use, and how do you push your stream to server and convert the codec into JPEG?

@ManikandanVaradharaj
Copy link

@TempoTian esp> start 2 tsp://192.168.0.136:554/live
I (42293) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Nov 29 2024-11:42:50
I (42293) ESP_RTSP_CLIENT: RTSP Client URL:tsp://192.168.0.136:554/live
I (42293) ESP_RTSP_CLIENT: Connecting...
I (42423) ESP_RTSP_CLIENT: TX:

OPTIONS tsp://192.168.0.136:554/live RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0

I (42443) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER

esp> I (42453) ESP_RTSP_CLIENT: TX:

DESCRIBE tsp://192.168.0.136:554/live RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp

I (42473) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Content-Type: application/sdp
Content-Base: rtsp://192.168.0.136:554
Content-Length: 400

v=0
o=- 10070176 0 IN IP4 192.168.0.136
s=ameba
c=IN IP4 192.168.0.118
t=0 0
m=video 0 RTP/AVP 26
a=rtpmap:26 JPEG/90000
a=control:streamid=0
a=framerate:30
m=audio 0 RTP/AVP 97
a=rtpmap:97 mpeg4-generic/8000/1
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1588; sizeLength=13; indexLength=3; indexDeltaLength=3; constantDuration=1024; Profile=1
a=control:streamid=1

Get video codec 26
Get video location streamid=0
Get audio codec 97
Get audio codec 129 sample rate 8000 channel 1
Get audio location streamid=1
I (42533) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.136:554/streamid=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=20111-20112
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0

I (42563) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 2
Session: 10070176;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=20111-20112;server_port=55608-55609

I (42573) ESP_RTSP_CLIENT: RTSP Server vrport 55608
Session timeout 40000
I (42583) RTSP_SERVICE: RTSP_STATE_SETUP
I (42583) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.136:554/streamid=1 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=32442-32443
CSeq: 3
User-Agent: ESP32-RTSP-client 1.1.0

I (42603) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 3
Session: 10070176;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=32442-32443;server_port=55608-55609

I (42623) ESP_RTSP_CLIENT: RTSP Server arport 55608
Session timeout 40000
I (42623) RTSP_SERVICE: RTSP_STATE_SETUP
I (42633) ESP_RTSP_CLIENT: TX:

PLAY rtsp://192.168.0.136:554 RTSP/1.0
CSeq: 4
User-Agent: ESP32-RTSP-client 1.1.0
Session: 10070176

I (42653) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 4
Session: 10070176

Open with no ADTS header...1 8000..............
I (42663) RTSP_SERVICE: RTSP_STATE_PLAY
E (43143) jpeg.decoder: Sampling factor cannot be recognized
I (43143) RTSP_SERVICE: Video resolution 0x0
E (43153) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (43523) jpeg.decoder: Sampling factor cannot be recognized
E (43523) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (43873) jpeg.decoder: Sampling factor cannot be recognized
E (43873) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (44183) jpeg.decoder: jpeg_decoder_process(225): Given buffer size 614400 is smaller than actual jpeg decode output size 1843200the height and width of output picture size will be adjusted to 16 bytes aligned automatically
E (44233) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (44243) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (44803) cache: esp_cache_msync(36): wrong size, total size overflow

assert failed: jpeg_decoder_process jpeg_decode.c:237 (ret == ESP_OK)
--- Stack dump detected
Core 1 register dump:
MEPC : 0x4ff00bcc RA : 0x4ff0bb74 SP : 0x480de200 GP : 0x4ff17200
--- 0x4ff00bcc: panic_abort at /home/smartbuild/esp/esp-idf/components/esp_system/panic.c:463
0x4ff0bb74: __ubsan_include at /home/smartbuild/esp/esp-idf/components/esp_system/ubsan.c:311

TP : 0x480de470 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000082 S1 : 0x00000001 A0 : 0x480de23c A1 : 0x4ff199cd
A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x4ff1d000
A6 : 0x0000000c A7 : 0x76757473 S2 : 0x00000009 S3 : 0x480de355
S4 : 0x4ff199cc S5 : 0x00000bd5 S6 : 0x480de414 S7 : 0x4805665c
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00011880 MTVEC : 0x4ff00003 MCAUSE : 0x00000007 MTVAL : 0x00000000
--- 0x4ff00003: _vector_table at ??:?

MHARTID : 0x00000001

--- Backtrace:

@ManikandanVaradharaj
Copy link

@TempoTian How could i solve these errors...
Open with no ADTS header...1 8000..............
I (24523) RTSP_SERVICE: RTSP_STATE_PLAY
E (24593) jpeg.decoder: marker parsed by the decoder is not supported by the hardware
I (24593) RTSP_SERVICE: Video resolution 1280x720
E (24603) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (24613) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (27123) dma2d: dma2d_force_end(968): transaction not in-flight

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj you can print out the video data you received (first and last 16bytes) to check whether the received image is whole or not. So which server are you using now and how to you push the stream to your server? I can align the test env with you and fix the possible issues if needed.

@ManikandanVaradharaj
Copy link

@TempoTian I'm using camera rtsp server in different module,in esp32p4 we using as rtsp client with the ip address from rtsp server I'm trying to receive data and display

@ManikandanVaradharaj
Copy link

@TempoTian I (25) boot: ESP-IDF v5.3.1-638-ga0f798cfc4-dirty 2nd stage bootloader
I (26) boot: compile time Dec 8 2024 15:05:08
I (26) boot: Multicore bootloader
I (32) boot: chip revision: v0.1
I (34) boot.esp32p4: SPI Speed : 80MHz
I (39) boot.esp32p4: SPI Mode : DIO
I (44) boot.esp32p4: SPI Flash Size : 4MB
I (49) boot: Enabling RNG early entropy source...
I (54) boot: Partition Table:
I (58) boot: ## Label Usage Type ST Offset Length
I (65) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (72) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (80) boot: 2 factory factory app 00 00 00010000 00200000
I (88) boot: End of partition table
I (91) esp_image: segment 0: paddr=00010020 vaddr=40130020 size=715d0h (464336) map
I (179) esp_image: segment 1: paddr=000815f8 vaddr=30100000 size=00020h ( 32) load
I (181) esp_image: segment 2: paddr=00081620 vaddr=30100020 size=0003ch ( 60) load
I (186) esp_image: segment 3: paddr=00081664 vaddr=4ff00000 size=0e9b4h ( 59828) load
I (206) esp_image: segment 4: paddr=00090020 vaddr=40000020 size=12583ch (1202236) map
I (410) esp_image: segment 5: paddr=001b5864 vaddr=4ff0e9b4 size=0803ch ( 32828) load
I (419) esp_image: segment 6: paddr=001bd8a8 vaddr=4ff16a00 size=03aa0h ( 15008) load
I (428) boot: Loaded app from partition at offset 0x10000
I (428) boot: Disabling RNG early entropy source...
I (440) hex_psram: vendor id : 0x0d (AP)
I (440) hex_psram: Latency : 0x01 (Fixed)
I (441) hex_psram: DriveStr. : 0x00 (25 Ohm)
I (444) hex_psram: dev id : 0x03 (generation 4)
I (450) hex_psram: density : 0x07 (256 Mbit)
I (455) hex_psram: good-die : 0x06 (Pass)
I (460) hex_psram: SRF : 0x02 (Slow Refresh)
I (466) hex_psram: BurstType : 0x00 ( Wrap)
I (471) hex_psram: BurstLen : 0x03 (2048 Byte)
I (476) hex_psram: BitMode : 0x01 (X16 Mode)
I (482) hex_psram: Readlatency : 0x04 (14 cycles@Fixed)
I (488) hex_psram: DriveStrength: 0x00 (1/1)
I (493) MSPI DQS: tuning success, best phase id is 2
I (680) MSPI DQS: tuning success, best delayline id is 11
I (680) esp_psram: Found 32MB PSRAM device
I (681) esp_psram: Speed: 200MHz
I (684) hex_psram: psram CS IO is dedicated
I (688) cpu_start: Multicore app
I (1642) esp_psram: SPI SRAM memory test OK
W (1651) clk: esp_perip_clk_init() has not been implemented yet
I (1658) cpu_start: Pro cpu start user code
I (1658) cpu_start: cpu freq: 360000000 Hz
I (1658) app_init: Application information:
I (1661) app_init: Project name: rtsp_test
I (1666) app_init: App version: 1
I (1671) app_init: Compile time: Dec 8 2024 15:04:33
I (1677) app_init: ELF file SHA256: a1a817301...
I (1682) app_init: ESP-IDF: v5.3.1-638-ga0f798cfc4-dirty
I (1689) efuse_init: Min chip rev: v0.0
I (1694) efuse_init: Max chip rev: v0.99
I (1699) efuse_init: Chip rev: v0.1
I (1704) heap_init: Initializing. RAM available for dynamic allocation:
I (1711) heap_init: At 4FF1D8C0 len 0001D700 (117 KiB): RAM
I (1717) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (1723) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM
I (1730) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (1736) heap_init: At 3010005C len 00001FA4 (7 KiB): TCM
I (1742) esp_psram: Adding pool of 32768K of PSRAM memory to heap allocator
I (1750) spi_flash: detected chip: generic
I (1754) spi_flash: flash io: dio
W (1758) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (1772) host_init: ESP Hosted : Host chip_ip[18]
I (1777) H_API: ESP-Hosted starting. Hosted_Tasks: prio:23, stack: 5120 RPC_task_stack: 5120
sdio_mempool_create free:33702276 min-free:33702276 lfb-def:33030144 lfb-8bit:33030144

I (1794) gpio: GPIO[18]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1804) gpio: GPIO[19]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1813) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1822) gpio: GPIO[15]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1832) gpio: GPIO[16]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1841) gpio: GPIO[17]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1851) H_API: ** add_esp_wifi_remote_channels **
I (1856) transport: Add ESP-Hosted channel IF[1]: S[0] Tx[0x4000e50c] Rx[0x4001cafe]
--- 0x4000e50c: transport_drv_sta_tx at /home/smartbuild/socket/rtsp_p4/managed_components/espressif__esp_hosted/host/drivers/transport/transport_drv.c:208
0x4001cafe: esp_wifi_remote_channel_rx at /home/smartbuild/socket/rtsp_p4/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19

I (1864) transport: Add ESP-Hosted channel IF[2]: S[0] Tx[0x4000e454] Rx[0x4001cafe]
--- 0x4000e454: transport_drv_ap_tx at /home/smartbuild/socket/rtsp_p4/managed_components/espressif__esp_hosted/host/drivers/transport/transport_drv.c:238
0x4001cafe: esp_wifi_remote_channel_rx at /home/smartbuild/socket/rtsp_p4/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19

I (1874) main_task: Started on CPU0
I (1884) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1884) main_task: Calling app_main()
E (1894) Codec_Init: No codec device found
I (1914) transport: Attempt connection with slave: retry[0]
I (1914) transport: Reset slave using GPIO[54]
I (1914) os_wrapper_esp: GPIO [54] configured
I (1914) gpio: GPIO[54]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (3074) sdio_wrapper: SDIO master: Data-Lines: 4-bit Freq(KHz)[40000 KHz]
I (3074) sdio_wrapper: GPIOs: CLK[18] CMD[19] D0[14] D1[15] D2[16] D3[17] Slave_Reset[54]
I (3074) H_SDIO_DRV: Starting SDIO process rx task
I (3074) sdio_wrapper: Queues: Tx[20] Rx[20] SDIO-Rx-Mode[1]
I (3114) gpio: GPIO[15]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (3114) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
Name:
Type: SDIO
Speed: 40.00 MHz (limit: 40.00 MHz)
Size: 0MB
CSD: ver=1, sector_size=0, capacity=0 read_bl_len=0
SCR: sd_spec=0, bus_width=0
TUPLE: DEVICE, size: 3: D9 01 FF
TUPLE: MANFID, size: 4
MANF: 0092, CARD: 6666
TUPLE: FUNCID, size: 2: 0C 00
TUPLE: FUNCE, size: 4: 00 00 02 32
TUPLE: CONFIG, size: 5: 01 01 00 02 07
TUPLE: CFTABLE_ENTRY, size: 8
INDX: C1, Intface: 1, Default: 1, Conf-Entry-Num: 1
IF: 41
FS: 30, misc: 0, mem_space: 1, irq: 1, io_space: 0, timing: 0, power: 0
IR: 30, mask: 1, IRQ: FF FF
LEN: FFFF
TUPLE: END
I (3164) sdio_wrapper: Function 0 Blocksize: 512
I (3174) sdio_wrapper: Function 1 Blocksize: 512
I (3174) H_SDIO_DRV: SDIO Host operating in STREAMING MODE
I (3184) H_SDIO_DRV: generate slave intr
I (3194) transport: Received INIT event from ESP32 peripheral
I (3194) transport: EVENT: 12
I (3194) transport: EVENT: 11
I (3204) transport: capabilities: 0xd
I (3204) transport: Features supported are:
I (3214) transport: * WLAN
I (3214) transport: - HCI over SDIO
I (3224) transport: - BLE only
I (3224) transport: EVENT: 13
I (3224) transport: ESP board type is : 13

I (3234) transport: Base transport is set-up

I (3234) transport: Slave chip Id[12]
I (3244) hci_stub_drv: Host BT Support: Disabled
I (3244) H_SDIO_DRV: Received INIT event
I (3274) rpc_evt: EVENT: ESP INIT

I (3274) rpc_wrap: Received Slave ESP Init
I (4024) rpc_core: <-- RPC_Req [0x116], uid 1
I (4144) rpc_rsp: --> RPC_Resp [0x216], uid 1
I (4144) rpc_core: <-- RPC_Req [0x104], uid 2
I (4154) rpc_rsp: --> RPC_Resp [0x204], uid 2
I (4154) rpc_core: <-- RPC_Req [0x11c], uid 3
I (4184) rpc_rsp: --> RPC_Resp [0x21c], uid 3
I (4184) rpc_core: <-- RPC_Req [0x118], uid 4
I (4274) rpc_rsp: --> RPC_Resp [0x218], uid 4
I (4274) RTSP_Test: wifi_init_sta finished.
I (4284) rpc_evt: Event [0x2] received
I (4284) rpc_evt: EVT rcvd: Wi-Fi Start
I (4284) rpc_core: <-- RPC_Req [0x101], uid 5
I (4294) rpc_rsp: --> RPC_Resp [0x201], uid 5
I (4294) H_API: esp_wifi_remote_connect
I (4294) rpc_core: <-- RPC_Req [0x11a], uid 6
I (4314) rpc_rsp: --> RPC_Resp [0x21a], uid 6

Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
I (4344) main_task: Returned from app_main()
esp> I (7044) rpc_evt: Event [0x29] received
I (7404) esp_wifi_remote: esp_wifi_internal_reg_rxcb: sta: 0x400d2dbe
--- 0x400d2dbe: wifi_sta_receive at /home/smartbuild/esp/esp-idf/components/esp_wifi/src/wifi_netif.c:38

I (8904) esp_netif_handlers: sta ip: 192.168.0.118, mask: 255.255.255.0, gw: 192.168.0.1
I (8904) RTSP_Test: got ip:192.168.0.118
esp> start 2 rtsp://192.168.0.136:554/live
I (29884) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Nov 29 2024-11:42:50
I (29884) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://192.168.0.136:554/live
I (29884) ESP_RTSP_CLIENT: Connecting...
I (30004) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://192.168.0.136:554/live RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0

esp> I (30034) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER

I (30044) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://192.168.0.136:554/live RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp

I (30114) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Content-Type: application/sdp
Content-Base: rtsp://192.168.0.136:554
Content-Length: 400

v=0
o=- 10036897 0 IN IP4 192.168.0.136
s=ameba
c=IN IP4 192.168.0.118
t=0 0
m=video 0 RTP/AVP 26
a=rtpmap:26 JPEG/90000
a=control:streamid=0
a=framerate:30
m=audio 0 RTP/AVP 97
a=rtpmap:97 mpeg4-generic/8000/1
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1588; sizeLength=13; indexLength=3; indexDeltaLength=3; constantDuration=1024; Profile=1
a=control:streamid=1

Get video codec 26
Get video location streamid=0
Get audio codec 97
Get audio codec 129 sample rate 8000 channel 1
Get audio location streamid=1
I (30164) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.136:554/streamid=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=23894-23895
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0

I (30194) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 2
Session: 10036897;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=23894-23895;server_port=55608-55609

I (30204) ESP_RTSP_CLIENT: RTSP Server vrport 55608
Session timeout 40000
I (30224) RTSP_SERVICE: RTSP_STATE_SETUP
I (30224) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.136:554/streamid=1 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=33171-33172
CSeq: 3
User-Agent: ESP32-RTSP-client 1.1.0

I (30274) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 3
Session: 10036897;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=33171-33172;server_port=55608-55609

I (30284) ESP_RTSP_CLIENT: RTSP Server arport 55608
Session timeout 40000
I (30294) RTSP_SERVICE: RTSP_STATE_SETUP
I (30294) ESP_RTSP_CLIENT: TX:

PLAY rtsp://192.168.0.136:554 RTSP/1.0
CSeq: 4
User-Agent: ESP32-RTSP-client 1.1.0
Session: 10036897

I (30314) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 4
Session: 10036897

Open with no ADTS header...1 8000..............
I (30324) RTSP_SERVICE: RTSP_STATE_PLAY
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30384) jpeg.decoder: marker parsed by the decoder is not supported by the hardware
I (30384) RTSP_SERVICE: Video resolution 1280x720
E (30394) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30454) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (30464) dma2d: dma2d_force_end(968)0: 0tra nsa0ct0ion n0ot in-flight
0 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30474) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (30494) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (30504) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30564) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (30574) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30594) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (30614) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30624) jpeg.decoder: marker parsed by the decoder is not supported by the hardware
E (30624) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30654) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (30664) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (30694) jpeg.decoder: the number of data units obtained after decoding a frame of image is different from the number of data units calculated based on the image resolution configured by the software
E (30704) dma2d: dma2d_force_end(968): transaction not in-flight
E (30704) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 49 20 01 00 a0 5a 52 af de 14 c4 2b fd e3 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
00 00 00 01 00 a0 5a ff d8 ff e0 00 10 4a 46 49
E (31254) cache: esp_cache_msync(36): wrong size, total size ov0erflow0
00 00
assert failed: jpeg_decoder_process jpeg_decode.c:237 (ret == ESP_OK)
Core 1 register dump:
--- Stack dump detected
MEPC : 0x4ff00bcc RA : 0x4ff0bb74 SP : 0x480de200 GP : 0x4ff17200
--- 0x4ff00bcc: panic_abort at /home/smartbuild/esp/esp-idf/components/esp_system/panic.c:463
0x4ff0bb74: __ubsan_include at /home/smartbuild/esp/esp-idf/components/esp_system/ubsan.c:311

TP : 0x480de470 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000082 S1 : 0x00000001 A0 : 0x480de23c A1 : 0x4ff199cd
A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x4ff1d000
A6 : 0x0000000c A7 : 0x76757473 S2 : 0x00000009 S3 : 0x480de355
S4 : 0x4ff199cc S5 : 0x00000a5f S6 : 0x480de414 S7 : 0x4806f8a2
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00011880 MTVEC : 0x4ff00003 MCAUSE : 0x00000007 MTVAL : 0x00000000
--- 0x4ff00003: _vector_table at ??:?

MHARTID : 0x00000001

--- Backtrace:

panic_abort (details=details@entry=0x480de23c "assert failed: jpeg_decoder_process jpeg_decode.c:237 (ret == ESP_OK)") at /home/smartbuild/esp/esp-idf/components/esp_system/panic.c:463
463 *((volatile int *) 0) = 0; // NOLINT(clang-analyzer-core.NullDereference) should be an invalid operation on targets
#0 panic_abort (details=details@entry=0x480de23c "assert failed: jpeg_decoder_process jpeg_decode.c:237 (ret == ESP_OK)") at /home/smartbuild/esp/esp-idf/components/esp_system/panic.c:463
#1 0x4ff0bb74 in esp_system_abort (details=details@entry=0x480de23c "assert failed: jpeg_decoder_process jpeg_decode.c:237 (ret == ESP_OK)") at /home/smartbuild/esp/esp-idf/components/esp_system/port/esp_system_chip.c:92
#2 0x4ff15838 in __assert_func (file=file@entry=0x40143205 "", line=line@entry=237, func=, func@entry=0x40190758 <func.7> "", expr=expr@entry=0x40133c94 "") at /home/smartbuild/esp/esp-idf/components/newlib/assert.c:80
#3 0x40084b00 in jpeg_decoder_process (decoder_engine=0x480d71b4, decode_cfg=0x4ff2a420, bit_stream=0x4806f8a2 "", stream_size=2655, decode_outbuf=0x480e48c0 "", outbuf_size=1843200, out_size=0x480de414) at /home/smartbuild/esp/esp-idf/components/esp_driver_jpeg/jpeg_decode.c:237
#4 0x00000000 in ?? ()
Backtrace stopped: frame did not save the PC

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj Which camera do you use, the received data is not match with spec, many camera output RTSP in private format, and need to know how does it orgnize data.
image

@ManikandanVaradharaj
Copy link

@TempoTian XCF PA-FP0171-A-01,This is the camera module name i used(JXF37)
image

@ManikandanVaradharaj
Copy link

@TempoTian After i changed my rtsp server type H264 640*480 In display monitor I'm getting invalid panel handle.
esp> start 2 rtsp://192.168.0.136:554/live
I (32425) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Nov 29 2024-11:42:50
I (32425) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://192.168.0.136:554/live
I (32425) ESP_RTSP_CLIENT: Connecting...
I (32525) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://192.168.0.136:554/live RTSP/1.0
CSeq: 0
User-Agent: ESP32-RTSP-client 1.1.0

I (32545) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 0
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER

esp> I (32555) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://192.168.0.136:554/live RTSP/1.0
CSeq: 1
User-Agent: ESP32-RTSP-client 1.1.0
Accept: application/sdp

I (32595) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 1
Content-Type: application/sdp
Content-Base: rtsp://192.168.0.136:554
Content-Length: 416

v=0
o=- 10062348 0 IN IP4 192.168.0.136
s=ameba
c=IN IP4 192.168.0.118
t=0 0
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=control:streamid=0
a=fmtp:96 packetization-mode=0
m=audio 0 RTP/AVP 97
a=rtpmap:97 mpeg4-generic/8000/1
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1588; sizeLength=13; indexLength=3; indexDeltaLength=3; constantDuration=1024; Profile=1
a=control:streamid=1

Get video codec 96
Get video location streamid=0
Get audio codec 97
Get audio codec 129 sample rate 8000 channel 1
Get audio location streamid=1
I (32655) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.136:554/streamid=0 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=20291-20292
CSeq: 2
User-Agent: ESP32-RTSP-client 1.1.0

I (32715) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 2
Session: 10062348;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=20291-20292;server_port=55608-55609

I (32725) ESP_RTSP_CLIENT: RTSP Server vrport 55608
Session timeout 40000
I (32735) RTSP_SERVICE: RTSP_STATE_SETUP
I (32735) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.136:554/streamid=1 RTSP/1.0
Transport: RTP/AVP;unicast;client_port=35592-35593
CSeq: 3
User-Agent: ESP32-RTSP-client 1.1.0

I (32785) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 3
Session: 10062348;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=35592-35593;server_port=55608-55609

I (32795) ESP_RTSP_CLIENT: RTSP Server arport 55608
Session timeout 40000
I (32805) RTSP_SERVICE: RTSP_STATE_SETUP
I (32805) ESP_RTSP_CLIENT: TX:

PLAY rtsp://192.168.0.136:554 RTSP/1.0
CSeq: 4
User-Agent: ESP32-RTSP-client 1.1.0
Session: 10062348

I (32825) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 4
Session: 10062348

Open with no ADTS header...1 8000..............
I (32835) H264_DEC.SW: tinyh264 version: 1c7f584
I (32835) RTSP_SERVICE: RTSP_STATE_PLAY
00 00 00 01 27 42 e0 33 89 8d 50 50 1e d0 80 00
00 00 00 01 21 e0 02 00 02 e4 ac 64 a2 84 52 fc
00 00 00 01 21 e0 04 00 04 e4 ac 64 a2 87 c2 4f
00 00 00 01 21 e0 06 00 06 e4 ac 64 a2 82 50 96
I (33945) RTSP_SERVICE: Video resolution 640x480
convert set to 0x4ff2a100
00 00 00 01 21 e0 08 00 08 e4 ac 64 a2 8f 4a 30
00 00 00 01 21 e0 0a 00 0a e4 ac 64 a2 86 d7 f0
E (34005) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 0c 00 0c e4 ac 64 a2 81 50 ae
00 00 00 01 21 e0 0e 00 0e e4 ac 64 a2 86 56 1e
00 00 00 01 21 e0 10 00 10 e4 ac 64 a2 82 94 bf
E (34105) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 12 00 12 e4 ac 64 a2 82 15 c6
00 00 00 01 21 e0 14 00 14 e4 ac 64 a2 82 9a aa
E (34185) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 16 00 16 e4 ac 64 a2 81 50 ad
00 00 00 01 21 e0 18 00 18 e4 ac 64 a2 82 f3 7f
00 00 00 01 21 e0 1a 00 1a e4 ac 64 a2 87 0d c4
E (34265) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 1c 00 1c e4 ac 64 a2 82 15 ff
00 00 00 01 21 e0 1e 00 1e e4 ac 64 a2 85 45 61
E (34345) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 20 00 20 e4 ac 64 a2 82 b5 fd
00 00 00 01 21 e0 22 00 22 e4 ac 64 a2 86 d6 1c
00 00 00 01 21 e0 24 00 24 e4 ac 64 a2 81 60 ee
E (34435) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 26 00 26 e4 ac 64 a2 81 e8 ce
00 00 00 01 21 e0 28 00 28 e4 ac 64 a2 80 ce 28
E (34515) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 2a 00 2a e4 ac 64 a2 84 d6 0d
00 00 00 01 21 e0 2c 00 2c e4 ac 64 a2 82 23 7f
00 00 00 01 21 e0 2e 00 2e e4 ac 64 a2 81 f8 ad
E (34595) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 30 00 30 e4 ac 64 a2 8b 16 a3
00 00 00 01 21 e0 32 00 32 e4 ac 64 a2 87 d6 3a
E (34675) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 34 00 34 e4 ac 64 a2 80 aa 29
00 00 00 01 21 e0 36 00 36 e4 ac 64 a2 81 64 83
00 00 00 01 21 e0 38 00 38 e4 ac 64 a2 82 9a a8
E (34755) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 3a 00 3a e4 ac 64 a2 82 f4 bf
00 00 00 01 27 42 e0 33 89 8d 50 50 1e d0 80 00
E (34835) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 02 00 02 e4 ac 64 a2 95 6e 92
00 00 00 01 21 e0 04 00 04 e4 ac 64 a2 83 43 77
E (34915) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 06 00 06 e4 ac 64 a2 84 4d 84
00 00 00 01 21 e0 08 00 08 e4 ac 64 a2 81 2d b8
00 00 00 01 21 e0 0a 00 0a e4 ac 64 a2 81 76 68
E (34995) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 0c 00 0c e4 ac 64 a2 82 55 92
00 00 00 01 21 e0 0e 00 0e e4 ac 64 a2 8f 62 a2
E (35075) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 10 00 10 e4 ac 64 a2 83 23 7b
00 00 00 01 21 e0 12 00 12 e4 ac 64 a2 89 a8 5c
E (35155) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 14 00 14 e4 ac 64 a2 ba 83 91
00 00 00 01 21 e0 16 00 16 e4 ac 64 a2 80 8c 28
00 00 00 01 21 e0 18 00 18 e4 ac 64 a2 81 a1 f8
E (35235) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 1a 00 1a e4 ac 64 a2 98 dd aa
00 00 00 01 21 e0 1c 00 1c e4 ac 64 a2 83 1a c6
E (35305) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 1e 00 1e e4 ac 64 a2 80 a4 2b
00 00 00 01 21 e0 20 00 20 e4 ac 64 a2 b8 af c5
00 00 00 01 21 e0 22 00 22 e4 ac 64 a2 80 c7 4a
E (35385) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 24 00 24 e4 ac 64 a2 82 d4 bf
00 00 00 01 21 e0 26 00 26 e4 ac 64 a2 82 53 63
E (35465) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 28 00 28 e4 ac 64 a2 81 5d 64
E (35545) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 2a 00 2a e4 ac 64 a2 82 b3 61
00 00 00 01 21 e0 2c 00 2c e4 ac 64 a2 8d 58 29
00 00 00 01 21 e0 2e 00 2e e4 ac 64 a2 81 a8 b7
00 00 00 01 21 e0 30 00 30 e4 ac 64 a2 85 d6 5a
E (35615) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
00 00 00 01 21 e0 32 00 32 e4 ac 64 a2 83 95 fc
00 00 00 01 21 e0 34 00 34 e4 ac 64 a2 81 fe a8
E (35695) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (35765) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (35835) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
E (35915) lcd_panel: esp_lcd_panel_draw_bitmap(34): invalid panel handle
W (35945) ESP_RTP: drop 102

@ManikandanVaradharaj
Copy link

@TempoTian I checked other p4 display examples..in esp-dev-kits,It worked fine with UI

@TempoTian
Copy link
Contributor

@ManikandanVaradharaj From the log can see that video is received and decoded all right, only diplay have issue.
You can add some log in following function to check issues, in my workspace lcd panel can create success.
image

@ManikandanVaradharaj
Copy link

ManikandanVaradharaj commented Dec 12, 2024 via email

@TempoTian
Copy link
Contributor

I have no camera, so I use ffmpeg to push to server. it plays ok on P4.
image

Log as:

s00 00 00 01 41 9a c0 fe b0 41 08 c1 0e f7 f7 82 
00 00 00 01 41 9a e0 ff 84 06 82 2c bf ed 71 4e 
00 00 00 01 41 9b 00 fe 4f eb 0b 42 9c 16 ef 77 
00 00 00 01 41 9b 20 bf 84 20 87 77 7e f1 75 73 
esp> st00 00 00 01 41 9b 40 bf 86 84 af 6d 63 83 a7 50 
00 00 00 01 41 9b 61 f2 2e 23 04 37 bc b7 99 82 
esp> sto00 00 00 01 41 9b 80 be b8 7b 51 c0 00 9c 71 f1 
00 00 00 01 41 9b a0 bf 8e 82 4a aa fb c4 9c 10 
00 00 00 01 41 9b c1 ff a8 c1 4f 20 90 43 55 c6 
00 00 00 01 41 9b e1 fb c1 04 7d 7d bf 1b f3 d6 
esp> stop00 00 00 01 41 9a 00 be b8 e8 61 47 18 d0 00 ae 
00 00 00 01 41 9a 21 ff 30 29 bb bd df ad 5c f7 
00 00 00 01 41 9a 40 bf 8c 4a fb f3 89 f6 21 5f 
00 00 00 01 41 9a 60 bf a2 02 3d 6a f9 7e a5 a8 
00 00 00 01 41 9a 80 be b1 dd 5f c8 c1 2d 55 6a 
00 00 00 01 41 9a a1 ff 32 c1 af 6d 5f e7 5b fa 
00 00 00 01 41 9a c1 fe 16 ab fe 09 6b 5c dd eb 
00 00 00 01 41 9a e3 eb e6 ac 5f f0 47 5d 58 f4 
esp> stop
I (336099) RTSP_SERVICE: audio render task exit
I (336099) ESP_RTSP_CLIENT: TX:

TEARDOWN rtsp://162.168.10.252:8554/test RTSP/1.0
CSeq: 7
User-Agent: ESP32-RTSP-client 1.1.0
Session: 76b49456d1394df7b2062fe4f5363602


I (336119) RTSP_SERVICE: video render task exited

@ManikandanVaradharaj
Copy link

ManikandanVaradharaj commented Dec 12, 2024 via email

@ManikandanVaradharaj
Copy link

@TempoTian I didn't added set-target into p4 before,after i added set-target now I'm getting error while building Partition table
[1070/1070] cd /home/smartbuild/Arduino/rtsp_p4/build/esp-idf/esptool...tition-table.bin /home/smartbuild/Arduino/rtsp_p4/build/rtsp_test.bin
FAILED: esp-idf/esptool_py/CMakeFiles/app_check_size /home/smartbuild/Arduino/rtsp_p4/build/esp-idf/esptool_py/CMakeFiles/app_check_size
cd /home/smartbuild/Arduino/rtsp_p4/build/esp-idf/esptool_py && /home/smartbuild/.espressif/python_env/idf5.3_py3.10_env/bin/python /home/smartbuild/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/smartbuild/Arduino/rtsp_p4/build/partition_table/partition-table.bin /home/smartbuild/Arduino/rtsp_p4/build/rtsp_test.bin
Error: app partition is too small for binary rtsp_test.bin size 0x1acb80:

  • Part 'factory' 0/0 @ 0x10000 size 0x100000 (overflow 0xacb80)
    ninja: build stopped: subcommand failed.
    ninja failed with exit code 1, output of the command is in the /home/smartbuild/Arduino/rtsp_p4/build/log/idf_py_stderr_output_224588 and /home/smartbuild/Arduino/rtsp_p4/build/log/idf_py_stdout_output_224588

@ManikandanVaradharaj
Copy link

After i changed the partition table in

nvs | data | nvs | 0x12000 | 0x6000
phy_init | data | phy | 0x18000 | 0x1000
factory | app | factory | 0x20000 | 4M
ESP32_P4 log.zip
I attached the log in zip format,kindly look the log and tell me the necessary changes to clear this.

@TempoTian
Copy link
Contributor

Unselect following:
image

@ManikandanVaradharaj
Copy link

ManikandanVaradharaj commented Dec 12, 2024

@TempoTian After I changed the option In log
(66849) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 4
Session: 10031776

Open with no ADTS header...1 8000..............
E (66859) RTSP_SERVICE: Fail to init video queue
E (66859) RTSP_SERVICE: Fail to open video decoder
I (66869) RTSP_SERVICE: RTSP_STATE_PLAY
W (69039) ESP_RTP: drop 65

W (75549) ESP_RTP: drop 277

W (76669) ESP_RTP: drop 313

W (78209) ESP_RTP: drop 361

W (81579) ESP_RTP: drop 470

W (82509) ESP_RTP: drop 500

W (83519) ESP_RTP: drop 532

W (85149) ESP_RTP: drop 578

W (88549) ESP_RTP: drop 693

W (91519) ESP_RTP: drop 788

W (92739) ESP_RTP: drop 827

W (95609) ESP_RTP: drop 919

W (99609) ESP_RTP: drop 1047

I (109019) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://192.168.0.136:554 RTSP/1.0
CSeq: 5
User-Agent: ESP32-RTSP-client 1.1.0
Session: 10031776

I (109029) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK
CSeq: 5
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER
I (357989) H_API: esp_wifi_remote_connect
I (357989) rpc_core: <-- RPC_Req [0x11a], uid 7
E (357989) TRANS_TCP: tcp_poll_read select error 113, errno = Software caused connection abort, fd = 54
I (357999) ESP_RTSP_CLIENT: RTSP Server Disconnected!
I (358009) rpc_rsp: --> RPC_Resp [0x21a], uid 7
I (358019) RTSP_Test: retry to connect to the AP
I (358019) ESP_RTSP_CLIENT: TX:

TEARDOWN rtsp://192.168.0.136:554 RTSP/1.0
CSeq: 11
User-Agent: ESP32-RTSP-client 1.1.0
Session: 10031776

E (358039) TRANS_TCP: tcp_poll_write select error 0, errno = Success, fd = 54
E (358039) ESP_RTSP_CLIENT: Write failed, error: Invalid argument
W (358049) RTSP_SERVICE: Already stopped

assert failed: spinlock_acquire spinlock.h:142 (lock->count == 0)
Core 0 register dump:
--- Stack dump detected
MEPC : 0x4ff00b2e RA : 0x4ff09d48 SP : 0x4ff39730 GP : 0x4ff14a80
--- 0x4ff00b2e: panic_abort at /home/smartbuild/esp/esp-idf/components/esp_system/panic.c:463
0x4ff09d48: __ubsan_include at /home/smartbuild/esp/esp-idf/components/esp_system/ubsan.c:311

TP : 0x4ff39970 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000086 S1 : 0x00000001 A0 : 0x4ff3976c A1 : 0x4ff16c0d
A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x4ff1a000
A6 : 0x00000010 A7 : 0x76757473 S2 : 0x00000009 S3 : 0x4ff39881
S4 : 0x4ff16c0c S5 : 0x0000abab S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00011880 MTVEC : 0x4ff00003 MCAUSE : 0x00000007 MTVAL : 0x00000000
--- 0x4ff00003: _vector_table at ??:?

MHARTID : 0x00000000

--- Backtrace:

panic_abort (details=details@entry=0x4ff3976c "assert failed: spinlock_acquire spinlock.h:142 (lock->count == 0)") at /home/smartbuild/esp/esp-idf/components/esp_system/panic.c:463
463 *((volatile int *) 0) = 0; // NOLINT(clang-analyzer-core.NullDereference) should be an invalid operation on targets
#0 panic_abort (details=details@entry=0x4ff3976c "assert failed: spinlock_acquire spinlock.h:142 (lock->count == 0)") at /home/smartbuild/esp/esp-idf/components/esp_system/panic.c:463
#1 0x4ff09d48 in esp_system_abort (details=details@entry=0x4ff3976c "assert failed: spinlock_acquire spinlock.h:142 (lock->count == 0)") at /home/smartbuild/esp/esp-idf/components/esp_system/port/esp_system_chip.c:92
#2 0x4ff13074 in __assert_func (file=file@entry=0x40130d48 "", line=line@entry=142, func=, func@entry=0x4015a40c <func.3> "", expr=expr@entry=0x40132e1c "") at /home/smartbuild/esp/esp-idf/components/newlib/assert.c:80
#3 0x4ff0b024 in spinlock_acquire (timeout=-1, lock=0x4ff27cbc) at /home/smartbuild/esp/esp-idf/components/esp_hw_support/include/spinlock.h:142
#4 xPortEnterCriticalTimeout (mux=mux@entry=0x4ff27cbc, timeout=timeout@entry=-1) at /home/smartbuild/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:545
#5 0x4ff0a8fa in vPortEnterCriticalMultiCore (mux=0x4ff27cbc) at /home/smartbuild/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h:647
#6 xQueueSemaphoreTake (xQueue=0x4ff27c70, xTicksToWait=) at /home/smartbuild/esp/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:1727
#7 0x00000000 in ?? ()
Backtrace stopped: frame did not save the PC

@TempoTian
Copy link
Contributor

You need enable SPIRAM firstly. you can use my provided sdkconfig and check the LCD handle not create issue, if this fixed then I think the video should appear.

@ManikandanVaradharaj
Copy link

@TempoTian Can i get some changed partition table and needed configuration of sdk to fix this issue.

@ManikandanVaradharaj
Copy link

@TempoTian Generated /home/smartbuild/Arduino/rtsp_p4/build/rtsp_test.bin
[1069/1069] cd /home/smartbuild/Arduino/rtsp_p4/build/esp-idf/esptool...tition-table.bin /home/smartbuild/Arduino/rtsp_p4/build/rtsp_test.bin
FAILED: esp-idf/esptool_py/CMakeFiles/app_check_size /home/smartbuild/Arduino/rtsp_p4/build/esp-idf/esptool_py/CMakeFiles/app_check_size
cd /home/smartbuild/Arduino/rtsp_p4/build/esp-idf/esptool_py && /home/smartbuild/.espressif/python_env/idf5.3_py3.10_env/bin/python /home/smartbuild/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x10000 partition --type app /home/smartbuild/Arduino/rtsp_p4/build/partition_table/partition-table.bin /home/smartbuild/Arduino/rtsp_p4/build/rtsp_test.bin
Error: app partition is too small for binary rtsp_test.bin size 0x1af490:

  • Part 'factory' 0/0 @ 0x20000 size 0x100000 (overflow 0xaf490)
    ninja: build stopped: subcommand failed.
    ninja failed with exit code 1, output of the command is in the /home/smartbuild/Arduino/rtsp_p4/build/log/idf_py_stderr_output_335254 and /home/smartbuild/Arduino/rtsp_p4/build/log/idf_py_stdout_output_335254

@ManikandanVaradharaj
Copy link

@TempoTian Could you help me to achieve this display task,almost decoding parts are over little bit end things to display the video.

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

No branches or pull requests

4 participants