我有点困惑,我希望你能帮助我。我正在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相同的端口上发送流?我指望你的帮助,因为有很多代码要改变。
请原谅我的英语。
答案 0 :(得分:0)
流媒体视频未通过udp到达VLC。 这就是为什么在超时10秒后它会尝试回退并通过tcp接收媒体。 你可以看一下rtp / rtsp / tcp。它是一个允许在与rtsp相同的套接字上发送rtp数据包的协议。