【问题标题】:ffmpeg error: Data doesn't look like RTP packets, make sure the RTP muxer is usedffmpeg 错误:数据看起来不像 RTP 数据包,请确保使用 RTP 复用器
【发布时间】:2016-06-29 13:30:47
【问题描述】:

我正在尝试通过 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 没有任何效果

提前谢谢你,

【问题讨论】:

    标签: ffmpeg live-streaming ffserver muxer


    【解决方案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
    

    【讨论】:

    • 我已经尝试过了,但我得到了:“无法为输出文件 #0 写入头文件(编解码器参数不正确?):参数无效”感谢您的帮助
    • 我认为您需要为每个流使用一个端口,例如:ffmpeg -s 720x720 -f video4linux2 -i /dev/video0 -r 25 -f alsa -i hw:0 -c:v libx264 -an -f rtp rtp://192.168.1.149:1234/test.ffm -vn -c:a aac -strict -2 -f rtp rtp://192.168.1.149:1235/test.ffm,
    • 使用这个命令 ffmpeg 和 ffserver 可以工作,但是 ffplay 一直在缓冲并且没有输出。我会尝试将它们分别发送到媒体并混合它们。再次感谢您
    猜你喜欢
    • 2018-04-28
    • 1970-01-01
    • 2017-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-06
    • 1970-01-01
    相关资源
    最近更新 更多