0

我有点困惑,希望你能帮助我。我正在我的 Android 上编写 rtsp 服务器。我遇到了一些问题,但有一些方法可以解决所有问题,除了一个。

描述:我的应用程序由 3 个模块 RTSP、RTP 和 UI 组成。跳过 UI 的描述。RTSP 开始侦听 tcp 端口 55555。然后在 VLC 中输入 rtsp://address:55555 然后握手和所有 RTSP 共享标头。Durung 标头程序共享通过 RTP 设置接收和设置端口,Android 应用程序开始发送一些字节,但是...

这就是问题所在:VLC 中没有任何图像。所以我查看了日志并:

main debug: resyncing on rtsp://192.168.1.143:55555
main debug: rtsp://192.168.1.143:55555 is at 2
main debug: starting playback of the new playlist item
main debug: resyncing on rtsp://192.168.1.143:55555
main debug: rtsp://192.168.1.143:55555 is at 2
main debug: creating new input thread
main debug: Creating an input for 'rtsp://192.168.1.143:55555'
main debug: using timeshift granularity of 50 MiB, in path 'D:\Users\Adrian\AppData\Local\Temp'
main debug: `rtsp://192.168.1.143:55555' gives access `rtsp' demux `' path `192.168.1.143:55555'
main debug: creating demux: access='rtsp' demux='' location='192.168.1.143:55555' file='\\192.168.1.143:55555'
main debug: looking for access_demux module: 1 candidate
live555 debug: version 2012.09.13
qt4 debug: IM: Setting an input
live555 debug: RTP subsession 'video/JPEG'
main debug: selecting program id=0
live555 debug: setup start: 0.000000 stop:100.000000
live555 debug: We have a timeout of 600 seconds
live555 debug: spawned timeout thread
live555 debug: play start: 0.000000 stop:100.000000
main debug: using access_demux module "live555"
main debug: TIMER module_need() : 155.608 ms - Total 155.608 ms / 1 intvls (Avg 155.608 ms)
main debug: looking for decoder module: 32 candidates
avcodec debug: libavcodec already initialized
avcodec debug: trying to use direct rendering
avcodec debug: allowing 4 thread(s) for decoding
avcodec debug: ffmpeg codec (Motion JPEG Video) started
main debug: using decoder module "avcodec"
main debug: TIMER module_need() : 1.511 ms - Total 1.511 ms / 1 intvls (Avg 1.511 ms)
main debug: looking for meta reader module: 2 candidates
lua debug: Trying Lua scripts in D:\Users\Adrian\AppData\Roaming\vlc\lua\meta\reader
lua debug: Trying Lua scripts in E:\VideoLAN\VLC\lua\meta\reader
lua debug: Trying Lua playlist script E:\VideoLAN\VLC\lua\meta\reader\filename.luac
main debug: no meta reader module matching "any" could be loaded
main debug: TIMER module_need() : 1.981 ms - Total 1.981 ms / 1 intvls (Avg 1.981 ms)
main debug: `rtsp://192.168.1.143:55555' successfully opened
live555 warning: no data received in 10s. Switching to TCP
main debug: removing module "avcodec"
avcodec debug: ffmpeg codec (Motion JPEG Video) stopped
main debug: killing decoder fourcc `MJPG', 0 PES in FIFO
main debug: Program doesn't contain anymore ES
live555 debug: RTP subsession 'video/JPEG'
main debug: looking for decoder module: 32 candidates
avcodec debug: libavcodec already initialized
avcodec debug: trying to use direct rendering
avcodec debug: allowing 4 thread(s) for decoding
avcodec debug: ffmpeg codec (Motion JPEG Video) started
main debug: using decoder module "avcodec"
main debug: TIMER module_need() : 1.352 ms - Total 1.352 ms / 1 intvls (Avg 1.352 ms)
live555 debug: setup start: 0.000000 stop:100.000000
live555 debug: play start: 0.000000 stop:100.000000
live555 error: no data received in 10s, aborting
main debug: EOF reached
main debug: finished input
main debug: removing module "avcodec"
avcodec debug: ffmpeg codec (Motion JPEG Video) stopped
main debug: killing decoder fourcc `MJPG', 0 PES in FIFO
main debug: removing module "live555"
main debug: Program doesn't contain anymore ES
main debug: dead input
main debug: changing item without a request (current 2/3)
main debug: nothing to play
qt4 debug: IM: Deleting the input
main debug: TIMER input launching for 'rtsp://192.168.1.143:55555' : 161.112 ms - Total 161.112 ms / 1 intvls (Avg 161.112 ms)
qt4 debug: Small
qt4 debug: Saving the simple preferences
main debug: opening config file (D:\Users\Adrian\AppData\Roaming\vlc\vlcrc)

我的问题是:我是否必须在与 RTSP 相同的端口上发送流?我指望您的帮助,因为有很多代码需要更改。

请原谅我的英语。

4

1 回答 1

0

流视频未通过 udp 到达 VLC。这就是为什么在 10 秒超时后它会尝试回退并通过 tcp 接收媒体的原因。你可以看看rtp/rtsp/tcp。这是一个允许在与 rtsp 相同的套接字上发送 rtp 数据包的协议。

于 2013-01-02T08:09:38.030 回答