1

我正在尝试通过 ffserver 从 usbcam 和 mic throw ffmpeg 流式传输视频和音频我收到 2 个错误:
- 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>

我的 ffmpeg cmd 是

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 没有任何效果

先感谢您,

4

1 回答 1

1

您可以尝试告诉 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
于 2016-06-29T19:55:41.037 回答