2012-08-17 116 views
4


我要廣播通過FFmpeg的視頻文件,但我得到的錯誤:
FFmpeg的RTP流錯誤

Only one stream supported in the RTP muxer

我得到的錯誤,當我寫這篇文章:

ffmpeg.exe -i SomeVideo.mp4 -f rtp rtp://127.0.0.1:11111

我不知道什麼是錯的。
請幫忙。

+0

多少流在'SomeVideo.mp4'? – blahdiblah 2012-08-20 17:32:42

+0

只有One.But我無法開始串流(( – Searush 2012-08-25 16:35:24

+0

@Will你爲什麼要關閉???請重新打開,或說不出理由。 – Searush 2013-06-24 09:27:58

回答

6

你的ffmpeg的命令創建流,一個用於視頻,一個用於音頻。 而是執行此操作:

ffmpeg -re -i SomeVideo.mp4 -vcodec copy -an -f rtp rtp://127.0.0.1:11111 -vn -acodec copy -f rtp rtp://127.0.0.1:11112

端口​​則有不帶音頻()視頻。

端口11112然後有沒有視頻(-vn)音頻。

閱讀與每個流,例如,ffplay rtp://127.0.0.1:11112

(這部分在http://lucabe72.blogspot.com/2010/04/rtp-streaming-with-ffmpeg.html來自諮詢。)

+0

這有可能超過RTP多輸出?甚至消除音頻流,它顯示錯誤:RTP複用器僅支持一個流 - 無法爲輸出文件#1寫入標題(不正確的編解碼器參數?):無效參數 – 2015-08-10 07:34:51

+1

是的,但只能通過組播。 RFC 1889說:「如果底層網絡提供的話,RTP支持使用多播分發將數據傳輸到多個目的地,並且沒有提到多個客戶端。請參閱http://superuser.com/questions/307130/ffmpeg-command-to-stream-video-to-a-multicast-address。 – 2015-08-16 20:45:15

+1

我不得不爲視頻使用11110(即偶數),否則'ffplay'會顯示錯誤,'vlc'只會讀取音頻。 VLC wiki https://wiki.videolan.org/Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line/#rtp指出'音頻和視頻的端口必須均勻。 – user276648 2016-12-02 06:48:05