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 server doesnt work with UDP transport #148

Closed
huiminghao opened this issue Aug 30, 2024 · 2 comments
Closed

RTSP server doesnt work with UDP transport #148

huiminghao opened this issue Aug 30, 2024 · 2 comments

Comments

@huiminghao
Copy link

XIU version
For example: v0.13.0

Describe the bug
RTSP server doesnt work with UDP transport.

To Reproduce
start xiu with:cargo run -- -t 8554
push with:./ffmpeg.exe -re -i /d/out.mkv -codec copy -f rtsp -rtsp_transport udp rtsp://172.19.116.34:8554/1
play with:./ffplay.exe rtsp://172.19.116.34:8554/1 -rtsp_transport udp
--neither--
push with:./ffmpeg.exe -re -i /d/out.mkv -codec copy -f rtsp -rtsp_transport tcp rtsp://172.19.116.34:8554/1
play with:./ffplay.exe rtsp://172.19.116.34:8554/1 -rtsp_transport udp
xiu logs:

[2024-08-30T02:56:53Z INFO  xrtsp::session::server_session] handle_play error: pack error: bytes write error: bytes io error: io error
[2024-08-30T02:56:53Z ERROR streamhub] Transmiter send error: send video error
[2024-08-30T02:56:53Z ERROR streamhub] Transmiter send error: send audio error
[2024-08-30T02:56:53Z ERROR streamhub] Transmiter send error: send audio error
[2024-08-30T02:56:53Z ERROR streamhub] Transmiter send error: send audio error

--neither--
push with:./ffmpeg.exe -re -i /d/out.mkv -codec copy -f rtsp -rtsp_transport udp rtsp://172.19.116.34:8554/1
play with:./ffplay.exe rtsp://172.19.116.34:8554/1 -rtsp_transport tcp
but works with:
push with:./ffmpeg.exe -re -i /d/out.mkv -codec copy -f rtsp -rtsp_transport tcp rtsp://172.19.116.34:8554/1
play with:./ffplay.exe rtsp://172.19.116.34:8554/1 -rtsp_transport tcp

Expected behavior
UDP transport works.

@huiminghao
Copy link
Author

问题解决了。rtsp的请求响应时,创建UDP的sock使用的remote address是从request uri里面获取的。这边使用ffmpeg测试,这个uri是服务器的地址。
补丁的内容见:https://github.com/huiminghao/xiu/commit/fbfca9164c41b0100e2221ab7feca0388e7535d8
补丁其他相关的:#147

@harlanc
Copy link
Owner

harlanc commented Oct 18, 2024

@huiminghao 方便提交一个pull request嘛

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

2 participants