想要使用ffmpeg将网络摄像头流发送到wowza

时间:2015-10-20 17:17:35

标签: ffmpeg streaming webcam wowza

我是Wowza和FFMPEG的新手。我一直在用ffmpeg测试,我能够创建带有视频和音频的本地文件。例如:

ffmpeg -f dshow -i video="HD Pro Webcam C920" myvideo.mpeg

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -pix_fmt yuv420p myvideoandaudio.mp4

我想要做的是将我的网络摄像头流发送到我本地安装的Wowza服务器。我搜索了几个论坛,包括这个,并尝试了多个命令,但仍然没有运气。我想有人指出我正确的方向。按照Wowza的说明,我创建了一个名为mystream的流文件,它的流UI为udp://0.0.0.0:10100。此外,应用程序连接设置说服务器的IP是10.160.XX.XXX和端口1935.我正在使用Windows,并且FFMPEG的“共享”版本下载。我甚至按照这里的说明更改了XML文件,尝试发送用户凭据(在安装过程中,如果我打算使用流式传输,Wowza要求创建凭据):

http://www.wowza.com/forums/content.php?233-How-to-secure-publishing-from-an-RTMP-encoder-that-does-not-support-authentication-(ModuleSecureURLParams)

我尝试了以下所有命令:

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://localhost:1935/live/mystream
-- failed to connect socket

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://localhost/live/mystream
-- failed to read RTMP packet header

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://10.160.XX.XXX:1935/live/mystream
-- failed to read RTMP packet header

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://10.160.XX.XXX/live/mystream
-- failed to read RTMP packet header

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://127.0.0.1:1935/live/mystream
-- failed to read RTMP packet header

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://127.0.0.1/live/mystream
-- writeN, rtmp send error 10053

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv -vcodec libx264 -acodec aac -strict -2 rtmp://10.160.XX.XXX:1935/live/ivanstream
-- failed to read RTMP packet header

ffmpeg -f dshow -i video="HD Pro Webcam C920" -vcodec libx264 -tune zerolatency -b:v 900k -pix_fmt yuv420p -f mpegts udp://0.0.0.0:10100
-- conversion failed

ffmpeg -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -vcodec libx264 -preset ultrafast -tune zerolatency -r 10 -async 1 -acodec libmp3lame -ab 24k -ar 22050 -bsf:v h264_mp4toannexb -maxrate 750k -bufsize 3000k -f mpegts udp://0.0.0.0:10100
-- conversion failed

ffmpeg -f dshow -i video="HD Pro Webcam C920" -s 512x288 -vcodec libx264 -b:v 1024k -pix_fmt yuv420p -f flv rtmp://127.0.0.1:1935/live/mystream
-- failed to read rtmp packet header

ffmpeg -f dshow -i video="HD Pro Webcam C920" -c:v copy -c:a copy -f flv rtmp://10.160.XX.XXX:1935/live?doPublish=12345/mystream
-- failed to read rtmp packet header

ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -r 40 -vcodec libx264 -threads 0 -crf 0 -preset ultrafast -tune zerolatency -f flv rtmp://127.0.0.1:1935/live/mystream
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -r 40 -vcodec libx264 -threads 0 -crf 0 -preset ultrafast -tune zerolatency -f flv rtmp://10.160.XX.XXX:1935/live/mystream
-- rtmp header error

ffmpeg -y -f dshow -s 640x480 -r:v 15 -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -c:v libx264 -b:v -pix_fmt yuv420p -vb 450 -an -map 0:0 -f rtp rtp://127.0.0.1:10000 -flags +global_header -c:a libvo_aacenc -vn -map 0:1 -f rtp rtp://127.0.0.1:10002 > 10000.sdp
--unable to find suitable output format yuv420p

参考文献:

http://www.wowza.com/forums/showthread.php?25777-Live-Webcam-feed-to-WOWZA-Server-over-RTMP-with-H264-encoding

http://www.factsandpeople.com/facts-mainmenu-5/23-other-software-technologies/258-preventing-real-time-buffer-error-causing-ffmpeg-to-drop-frames-in-screencast

http://www.wowza.com/forums/content.php?233-How-to-secure-publishing-from-an-RTMP-encoder-that-does-not-support-authentication-(ModuleSecureURLParams)

谢谢。

0 个答案:

没有答案