通过 RTMP 直播流式传输 VLC 播放列表

通过 RTMP 直播流式传输 VLC 播放列表

我刚刚尝试将播放列表 MP4 文件流式传输到直播流。我使用 VLC 播放播放列表,也使用 VLC 流式传输。我使用以下代码:

vlc --playlist-autostart --loop  --playlist-tree http://xxxxx.com/test --sout '#transcode{vcodec=h264,vb=300,fps=25,scale=1,acodec=mp4a,ab=64,channels=2}:std{access=rtmp,mux=ffmpeg{mux=flv},dst=rtmp://xxxxx.com/xxx/xxx1}'

上述代码播放播放列表文件,但流媒体不起作用。当我在 Ubuntu 命令提示符中运行此代码时,它返回以下错误:

VLC media player 2.0.8 Twoflower (revision 2.0.8a-0-g68cf50b)
[0x678d58] inhibit interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0x678d58] main interface error: no suitable interface module
[0x678d58] main interface error: no suitable interface module
[0x648108] main libvlc error: interface "globalhotkeys,none" initialization failed
[0x648108] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x678d58] qt4 interface error: Could not connect to X server
[0x678d58] skins2 interface error: cannot initialize OSFactory
[0x678d58] [cli] lua interface: Listening on host "*console".
VLC media player 2.0.8 Twoflower
Command Line Interface initialized. Type `help' for help.

> Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
x264 [info]: profile High, level 3.1
x264 [info]: final ratefactor: 35.88
x264 [info]: using SAR=109/160
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
x264 [info]: profile High, level 3.1
[flv @ 0x7f6d09133500] Codec for stream 0 does not use global headers but container format requires global headers
[flv @ 0x7f6d09133500] Codec for stream 1 does not use global headers but container format requires global headers
[flv @ 0x7f6d09133500] Packets are not in the proper order with respect to DTS
[0x7f6d08003808] avformat mux error: could not write frame (pts: 240002, dts: 40001) (pkt pts: 240, dts: 40) 

我怎么解决这个问题?

答案1

我不认为 VLC 目前可以直接流式传输到 RTMP。以下几个来源似乎证实了这一点:videolan论坛链接wowza论坛链接

不过,听起来 VLC 可能能够与其他软件一起使用 - 我从未尝试过。

或者,考虑这些用于流式传输到 RTMP 的常用软件工具(我已经使用过这些工具),尽管它们可能无法直接完成您想要完成的任务(例如,它们适用于流式传输网络摄像头源或捕获实时视频游戏)。

  • 打开广播软件
  • XSplit 广播器
  • Flash 媒体编码器

相关内容