实时流式传输 - ffmpeg 错误:数据看起来不像 RTP 数据包,请确保使用 RTP 复用器



我正在尝试从usbcam&mic throw ffmpeg在ffserver上流式传输视频和音频我得到了两个错误:
ffmpeg看起来正常,但显示"数据看起来不像RTP数据包,请确保使用了RTP复用器"-我可以连接到ffserver只有静态文件

server.conf文件:

HTTPPort 1235
RTSPPort 1234
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 100000
#CustomLog –
########################################
##  static file for testing
########################################
#HTTP requests
<Stream media.flv>
File "/home/username/media.flv"
Format flv
</Stream>
#RTSP requests
<Stream media.mpg>
#preconverted file:
File "/home/username/media.mpg"
Format rtp
VideoFrameRate 30
VideoCodec libx264
VideoSize 720x720
StartSendOnKey
Preroll 0
</Stream>
##################################################
## usb cam
###################################################
<Feed test.ffm>
File /tmp/test.ffm
FileMaxSize 20K
ACL allow 192.168.1.149
</Feed>
<Stream usbcam.mpg>
Feed test.ffm
Format rtp
VideoFrameRate 25
VideoCodec libx264
VideoSize 720x720
PreRoll 0
StartSendOnKey
</Stream>

my ffmpeg CMD is

ffmpeg -s 720x720 -f video4linux2 -i /dev/video0 -r 25 -f alsa -i hw:0 -c:v libx264 -c:a aac -strict -2 rtp://192.168.1.149:1234/test.ffm

似乎工作,但显示这个错误:

"数据看起来不像RTP数据包,请确保使用RTP复用器"

当我流式传输静态文件时,它可以工作但是当我尝试播放usbcam流抛出ffplay和VLC没有工作

提前谢谢你

您可以尝试告诉ffmpeg您的输出多路器格式是什么。(- f rtp)

ffmpeg -s 720x720 -f video4linux2 -i /dev/video0 -r 25 -f alsa -i hw:0 -c:v libx264 -c:a aac -strict -2 -f rtp rtp://192.168.1.149:1234/test.ffm

最新更新