ffmpeg rtmp streaming issue

老子叫甜甜 提交于 2019-12-10 12:32:55

问题


I am trying to stream my webcam video using the ffmpeg to wowza media server on linux..

ffmpeg -re -f video4linux2 -i /dev/video0 -acodec libfacc -vcodec libx264 -f h264 rtmp://localhost:1935/live/test

This is the command I used for some reason it doesn't seem to work as I am not able to run the example that came with wowza. I tried using flash media live encoder to send a rtmp to my wowza server and it works.

Any pointers on how to solve this problem.

I build ffmpeg from their git repo with the following config

--enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab

ffmpeg -protocols says it has rtmp input/output support


回答1:


With these build options my FFMPEG build does receive and decode rtsp streams

--enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264

I have answered a similar question here FFMPEG API: How to connect to RTSP stream using av_open_input_file?




回答2:


Your second -f switch, for the container format, should be mp4 not h264. H264 is a codec not a container format



来源:https://stackoverflow.com/questions/8270042/ffmpeg-rtmp-streaming-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!