я просто хочу транслировать мой RTMP прямой эфир в RTSP с помощью программного обеспечения VLC. я проверил эти потоковые разговоры на моем локальном компьютере, потоковые разговоры rtmp to rtsp отлично работали на моей локальной стороне. следующий код работает для локального разговора
vlc -vvv rtmp://xxxxxx.com/jiljillive/live2 --sout '#rtp{dst=127.0.0.1,port=8554,sdp=rtsp://localhost:8554/test.sdp}'
После этого я сделал то же самое в моем экземпляре AWS EC2. Я делаю эти протокол разговора в EC2 Ubuntu 12.04 64bit. это моя команда
vlc -vvv rtmp://xxxxx.com/live/live2 --sout '#rtp{dst=127.0.0.1,port=8554,sdp=rtsp://xxxxxx:8554/test.sdp}'
на этот раз потоковое RTSP. но когда я вызываю RTSP URL для VLC для игры, это не работает
ниже приводится код возврата консоли AWSEC2 от rtmp до rtsp
VLC media player 2.0.8 Twoflower (revision 2.0.8a-0-g68cf50b)
[0x10ae108] main libvlc debug: VLC media player - 2.0.8 Twoflower
[0x10ae108] main libvlc debug: Copyright © 1996-2013 VLC authors and VideoLAN
[0x10ae108] main libvlc debug: revision 2.0.8a-0-g68cf50b
[0x10ae108] main libvlc debug: configured with ./configure '--enable-static' '--build=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' '--config-cache' '--disable-maintainer-mode' '--disable-silent-rules' '--disable-update-check' '--enable-fast-install' '--prefix=/usr' '--docdir=/usr/share/doc/vlc-nox' '--sysconfdir=/etc' '--with-binary-version=0ubuntu0.12.04.1' '--enable-a52' '--enable-aa' '--enable-bluray' '--enable-bonjour' '--enable-caca' '--enable-dbus' '--enable-dca' '--enable-dirac' '--enable-directfb' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gnutls' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libproxy' '--enable-libxml2' '--enable-lirc' '--enable-live555' '--enable-mad' '--enable-mkv' '--enable-mod' '--enable-mpc' '--enable-mtp' '--enable-mux_ogg' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-oss' '--enable-pulse' '--enable-qt4' '--enable-realrtsp' '--enable-samplerate' '--enable-schroedinger' '--enable-sdl' '--enable-shout' '--enable-skins2' '--enable-smb' '--enable-speex' '--enable-svg' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vcd' '--enable-vcdx' '--enable-vorbis' '--enable-x264' '--enable-zvbi' '--with-kde-solid=/usr/share/kde4/apps/solid/actions/' '--disable-dxva2' '--disable-gnomevfs' '--disable-goom' '--disable-portaudio' '--disable-projectm' '--disable-sqlite' '--disable-telx' '--enable-alsa' '--enable-atmo' '--enable-dc1394' '--enable-dv' '--enable-fbosd' '--enable-libva' '--enable-linsys' '--enable-omxil' '--enable-pvr' '--enable-udev' '--enable-v4l2' '--enable-crystalhd' '--enable-mmx' '--enable-sse' '--disable-neon' '--disable-altivec' 'build_alias=x86_64-linux-gnu'
[0x10ae108] main libvlc debug: searching plug-in modules
[0x10ae108] main libvlc debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
[0x10ae108] main libvlc debug: recursively browsing `/usr/lib/vlc/plugins'
[0x10ae108] main libvlc debug: saving plugins cache /usr/lib/vlc/plugins/plugins.dat
[0x10ae108] main libvlc debug: plug-ins loaded: 420 modules
[0x10ae108] main libvlc debug: opening config file (/home/ubuntu/.config/vlc/vlcrc)
[0x10ae108] main libvlc debug: translation test: code is "C"
[0x10ae108] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU
[0x10ae108] main libvlc debug: looking for memcpy module: 4 candidates
[0x10ae108] main libvlc debug: using memcpy module "memcpymmxext"
[0x12d8028] main input debug: Creating an input for 'Media Library'
[0x12d8028] main input debug: Input is a meta file: disabling unneeded options
[0x12d8028] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x12d8028] main input debug: `file/xspf-open:///home/ubuntu/.local/share/vlc/ml.xspf' gives access `file' demux `xspf-open' path `/home/ubuntu/.local/share/vlc/ml.xspf'
[0x12d8028] main input debug: creating demux: access='file' demux='xspf-open' location='/home/ubuntu/.local/share/vlc/ml.xspf' file='/home/ubuntu/.local/share/vlc/ml.xspf'
[0x10debc8] main demux debug: looking for access_demux module: 3 candidates
[0x10debc8] main demux debug: no access_demux module matching "file" could be loaded
[0x10debc8] main demux debug: TIMER module_need() : 1.740 ms - Total 1.740 ms / 1 intvls (Avg 1.740 ms)
[0x12d8028] main input debug: creating access 'file' location='/home/ubuntu/.local/share/vlc/ml.xspf', path='/home/ubuntu/.local/share/vlc/ml.xspf'
[0x11798b8] main access debug: looking for access module: 2 candidates
[0x11798b8] filesystem access debug: opening file `/home/ubuntu/.local/share/vlc/ml.xspf'
[0x11798b8] main access debug: using access module "filesystem"
[0x11798b8] main access debug: TIMER module_need() : 1.005 ms - Total 1.005 ms / 1 intvls (Avg 1.005 ms)
[0x1179a08] main stream debug: Using stream method for AStream*
[0x1179a08] main stream debug: starting pre-buffering
[0x1179a08] main stream debug: received first data after 0 ms
[0x1179a08] main stream debug: pre-buffering done 296 bytes in 0s - 1338 KiB/s
[0x1179c68] main stream debug: looking for stream_filter module: 7 candidates
[0x1179c68] main stream debug: no stream_filter module matching "any" could be loaded
[0x1179c68] main stream debug: TIMER module_need() : 1.856 ms - Total 1.856 ms / 1 intvls (Avg 1.856 ms)
[0x1179c68] main stream debug: looking for stream_filter module: 1 candidate
[0x1179c68] main stream debug: using stream_filter module "stream_filter_record"
[0x1179c68] main stream debug: TIMER module_need() : 0.591 ms - Total 0.591 ms / 1 intvls (Avg 0.591 ms)
[0x12d8028] main input debug: creating demux: access='file' demux='xspf-open' location='/home/ubuntu/.local/share/vlc/ml.xspf' file='/home/ubuntu/.local/share/vlc/ml.xspf'
[0x117d4a8] main demux debug: looking for demux module: 1 candidate
[0x117d4a8] playlist demux debug: using XSPF playlist reader
[0x117d4a8] main demux debug: using demux module "playlist"
[0x117d4a8] main demux debug: TIMER module_need() : 0.859 ms - Total 0.859 ms / 1 intvls (Avg 0.859 ms)
[0x117ddf8] main demux meta debug: looking for meta reader module: 2 candidates
[0x117ddf8] lua demux meta debug: Trying Lua scripts in /home/ubuntu/.local/share/vlc/lua/meta/reader
[0x117ddf8] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x117ddf8] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x117ddf8] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x117ddf8] main demux meta debug: no meta reader module matching "any" could be loaded
[0x117ddf8] main demux meta debug: TIMER module_need() : 3.735 ms - Total 3.735 ms / 1 intvls (Avg 3.735 ms)
[0x12d8028] main input debug: `file/xspf-open:///home/ubuntu/.local/share/vlc/ml.xspf' successfully opened
[0x10dff08] main xml reader debug: looking for xml reader module: 1 candidate
[0x10dff08] main xml reader debug: using xml reader module "xml"
[0x10dff08] main xml reader debug: TIMER module_need() : 1.285 ms - Total 1.285 ms / 1 intvls (Avg 1.285 ms)
[0x117d4a8] playlist demux debug: parsed 0 tracks successfully
[0x12d8028] main input debug: EOF reached
[0x117d4a8] main demux debug: removing module "playlist"
[0x1179c68] main stream debug: removing module "stream_filter_record"
[0x11798b8] main access debug: removing module "filesystem"
[0x12d8028] main input debug: TIMER input launching for 'Media Library' : 13.537 ms - Total 13.537 ms / 1 intvls (Avg 13.537 ms)
[0x10de898] main interface debug: looking for interface module: 1 candidate
[0x10de898] main interface debug: using interface module "hotkeys"
[0x10de898] main interface debug: TIMER module_need() : 0.554 ms - Total 0.554 ms / 1 intvls (Avg 0.554 ms)
[0x12d8028] main interface debug: looking for interface module: 1 candidate
[0x12d8028] inhibit interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0x12d8028] main interface debug: no interface module matching "inhibit,none" could be loaded
[0x12d8028] main interface debug: TIMER module_need() : 0.766 ms - Total 0.766 ms / 1 intvls (Avg 0.766 ms)
[0x12d8028] main interface error: no suitable interface module
[0x10c1b58] main playlist debug: playlist threads correctly activated
[0x10c1b58] main playlist debug: adding item `rtmp://xxxxxx.com/live/live2' ( rtmp://emedias.com/jiljillive/live2 )
[0x10c1b58] main playlist debug: no fetch required for (null) (art currently (null))
[0x10c1b58] main playlist debug: rebuilding array of current - root Playlist
[0x10c1b58] main playlist debug: rebuild done - 1 items, index -1
[0x12d8028] main interface debug: looking for interface module: 1 candidate
[0x12d8028] main interface debug: no interface module matching "globalhotkeys,none" could be loaded
[0x12d8028] main interface debug: TIMER module_need() : 25.490 ms - Total 25.490 ms / 1 intvls (Avg 25.490 ms)
[0x12d8028] main interface error: no suitable interface module
[0x10ae108] main libvlc error: interface "globalhotkeys,none" initialization failed
[0x10ae108] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x12d8028] main interface debug: looking for interface module: 6 candidates
[0x12d8028] qt4 interface error: Could not connect to X server
[0x12d8028] skins2 interface debug: Cannot open X display
[0x12d8028] skins2 interface error: cannot initialize OSFactory
[0x12d8028] [cli] lua interface debug: Found lua interface script: /usr/lib/vlc/lua/intf/cli.luac
[0x12d8028] [cli] main interface debug: using interface module "lua"
[0x12d8028] [cli] main interface debug: TIMER module_need() : 3.196 ms - Total 3.196 ms / 1 intvls (Avg 3.196 ms)
[0x10c1b58] main playlist debug: processing request item: null, node: Playlist, skip: 0
[0x10c1b58] main playlist debug: starting playback of the new playlist item
[0x10c1b58] main playlist debug: resyncing on rtmp://xxxxxx.com/jiljillive/live2
[0x10c1b58] main playlist debug: rtmp://xxxxxxxx.com/jiljillive/live2 is at 0
[0x10c1b58] main playlist debug: creating new input thread
[0x7f7238000bd8] main input debug: Creating an input for 'rtmp://xxxxxxx.com/live/live2'
[0x7f7230000e98] main stream output debug: using sout chain=`rtp{dst=127.0.0.1,port=8554,sdp=rtsp://xxxxxx:8554/test.sdp}'
[0x7f7230000e98] main stream output debug: stream=`rtp'
[0x7f7230001298] main stream out debug: looking for sout stream module: 1 candidate
[0x7f7230001298] main stream out debug: set config option: sout-rtp-dst to 127.0.0.1
[0x7f7230001298] main stream out debug: set config option: sout-rtp-port to 8554
[0x7f7230001298] main stream out debug: set config option: sout-rtp-sdp to rtsp://54.254.180.206:8554/test.sdp
[0x7f7230001298] stream_out_rtp stream out warning: "54.254.180.206" RTSP host might be ignored in multiple-host configurations, use at your own risks.
[0x7f7230001298] stream_out_rtp stream out: Consider passing --rtsp-host=IP on the command line instead.
[0x7f7230001298] stream_out_rtp stream out debug: RTSP stream at /test.sdp
[0x7f7230001298] main stream out debug: net: listening to 54.254.180.206 port 8554
[0x7f7230001298] main stream out error: socket bind error (Permission denied)
[0x7f7230001298] main stream out error: cannot create socket(s) for HTTP host
[0x12d8028] [cli] lua interface: Listening on host "*console".
VLC media player 2.0.8 Twoflower
Command Line Interface initialized. Type `help' for help.
> [0x7f7230001298] stream_out_rtp stream out error: cannot export SDP as RTSP
[0x7f7230001298] main stream out debug: using sout stream module "stream_out_rtp"
[0x7f7230001298] main stream out debug: TIMER module_need() : 4.739 ms - Total 4.739 ms / 1 intvls (Avg 4.739 ms)
[0x7f7238000bd8] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x7f7238000bd8] main input debug: `rtmp://xxxxxx.com/live/live2' gives access `rtmp' demux `' path `xxxxxxx.com/live/live2'
[0x7f7238000bd8] main input debug: creating demux: access='rtmp' demux='' location='emedias.com/jiljillive/live2' file='(null)'
[0x7f7230005ea8] main demux debug: looking for access_demux module: 0 candidates
[0x7f7230005ea8] main demux debug: no access_demux module matched "rtmp"
[0x7f7230005ea8] main demux debug: TIMER module_need() : 0.330 ms - Total 0.330 ms / 1 intvls (Avg 0.330 ms)
[0x7f7238000bd8] main input debug: creating access 'rtmp' location='xxxxxx.com/jiljillive/live2', path='(null)'
[0x7f7230004828] main access debug: looking for access module: 1 candidate
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.
[0x7f7230004828] access_avio access debug: not seekable, size=-38
[0x7f7230004828] main access debug: using access module "access_avio"
[0x7f7230004828] main access debug: TIMER module_need() : 201.525 ms - Total 201.525 ms / 1 intvls (Avg 201.525 ms)
[0x7f72300060c8] main stream debug: Using stream method for AStream*
[0x7f72300060c8] main stream debug: starting pre-buffering
[0x7f72300060c8] main stream debug: received first data after 0 ms
[0x7f72300060c8] main stream debug: pre-buffering done 569 bytes in 0s - 8053 KiB/s
[0x7f723050fcd8] main stream debug: looking for stream_filter module: 7 candidates
[0x7f723050fcd8] main stream debug: no stream_filter module matching "any" could be loaded
[0x7f723050fcd8] main stream debug: TIMER module_need() : 1.514 ms - Total 1.514 ms / 1 intvls (Avg 1.514 ms)
[0x7f723050fcd8] main stream debug: looking for stream_filter module: 1 candidate
[0x7f723050fcd8] main stream debug: using stream_filter module "stream_filter_record"
[0x7f723050fcd8] main stream debug: TIMER module_need() : 0.432 ms - Total 0.432 ms / 1 intvls (Avg 0.432 ms)
[0x7f7238000bd8] main input debug: creating demux: access='rtmp' demux='' location='xxxxx.com/jiljillive/live2' file='(null)'
[0x7f723050fa48] main demux debug: looking for demux module: 54 candidates
[0x7f723050fa48] mod demux debug: MOD validation failed (ext=)
[0x7f723050fa48] ts demux debug: TS module discarded (lost sync)
[0x7f723050fa48] avformat demux debug: trying url: rtmp://xxxxxx.com/jiljillive/live2
[0x7f723050fa48] avformat demux debug: detected format: flv
[flv @ 0x7f723112e520] Estimating duration from bitrate, this may be inaccurate
[0x7f7238000bd8] main input debug: selecting program id=0
[0x7f723050fa48] avformat demux debug: adding es: video codec = h264
[0x7f723050fa48] avformat demux debug: adding es: audio codec = mpga
[0x7f723050fa48] avformat demux debug: AVFormat supported stream
[0x7f723050fa48] avformat demux debug: - format = flv (FLV format)
[0x7f723050fa48] avformat demux debug: - start time = 0
[0x7f723050fa48] avformat demux debug: - duration = -1
[0x7f723050fa48] main demux debug: using demux module "avformat"
[0x7f723050fa48] main demux debug: TIMER module_need() : 3321.579 ms - Total 3321.579 ms / 1 intvls (Avg 3321.579 ms)
[0x7f723112f8d8] main decoder debug: looking for packetizer module: 21 candidates
[0x7f723112f8d8] packetizer_h264 decoder debug: found NAL_SPS (sps_id=0)
[0x7f723112f8d8] packetizer_h264 decoder debug: found NAL_PPS (pps_id=0 sps_id=0)
[0x7f723112f8d8] packetizer_h264 decoder debug: avcC length size=4, sps=1, pps=1
[0x7f723112f8d8] main decoder debug: using packetizer module "packetizer_h264"
[0x7f723112f8d8] main decoder debug: TIMER module_need() : 5.143 ms - Total 5.143 ms / 1 intvls (Avg 5.143 ms)
[0x7f7231110088] main decoder debug: looking for packetizer module: 21 candidates
[0x7f7231110088] main decoder debug: using packetizer module "mpeg_audio"
[0x7f7231110088] main decoder debug: TIMER module_need() : 2.111 ms - Total 2.111 ms / 1 intvls (Avg 2.111 ms)
[0x7f7238000bd8] main input debug: starting in async mode
[0x7f72311f2248] main demux meta debug: looking for meta reader module: 2 candidates
[0x7f72311f2248] lua demux meta debug: Trying Lua scripts in /home/ubuntu/.local/share/vlc/lua/meta/reader
[0x7f72311f2248] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x7f72311f2248] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x7f72311f2248] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x7f72311f2248] main demux meta debug: no meta reader module matching "any" could be loaded
[0x7f72311f2248] main demux meta debug: TIMER module_need() : 1.727 ms - Total 1.727 ms / 1 intvls (Avg 1.727 ms)
[0x7f7238000bd8] main input debug: `rtmp://xxxxxx.com/live/live2' successfully opened
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: switching to sync mode
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7238000bd8] main input debug: Buffering 0%
[0x7f7231110088] mpeg_audio decoder debug: MPGA channels:1 samplerate:22050 bitrate:48
[0x7f7230000e98] main stream output debug: adding a new sout input (sout_input:0x7f7218000a00)
[0x7f7230001298] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes
[0x7f7230001298] main stream out debug: net: connecting to [127.0.0.1]:8554
[0x7f7230001298] main stream out debug: net: connecting to [127.0.0.1]:8555 from [127.0.0.1]:42582
[0x7f7230001298] stream_out_rtp stream out debug: sdp=
v=0
o=- 15466995737973131073 15466995737973131073 IN IP4 ip-172-31-10-174
s=Unnamed
i=N/A
c=IN IP4 127.0.0.1
t=0 0
a=tool:vlc 2.0.8
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=audio 8554 RTP/AVP 14
b=AS:48
b=RR:0
a=rtpmap:14 MPA/90000
[0x7f7238000bd8] main input debug: Stream buffering done (697 ms in 6 ms)
[0x7f7238000bd8] main input debug: Decoder buffering done in 0 ms
[0x7f7230000e98] main stream output debug: adding a new sout input (sout_input:0x7f7220009d60)
[0x7f7230001298] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes
[0x7f7230001298] stream_out_rtp stream out debug: we found a startcode for NAL with TYPE:7
[0x7f7230001298] stream_out_rtp stream out debug: we found a startcode for NAL with TYPE:8
[0x7f7230001298] main stream out debug: net: connecting to [127.0.0.1]:8556
[0x7f7230001298] main stream out debug: net: connecting to [127.0.0.1]:8557 from [127.0.0.1]:35164
[0x7f7230001298] stream_out_rtp stream out debug: sdp=
v=0
o=- 15466995737982916361 15466995737982916361 IN IP4 ip-172-31-10-174
s=Unnamed
i=N/A
c=IN IP4 127.0.0.1
t=0 0
a=tool:vlc 2.0.8
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=audio 8554 RTP/AVP 14
b=AS:48
b=RR:0
a=rtpmap:14 MPA/90000
m=video 8556 RTP/AVP 96
b=RR:0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42801f;sprop-parameter-sets=Z0KAH5ZUCg/YCoQAAA+gAAHUw4GAAnrAABGMP8Y4O0JE1A==,aM41IA==;
vlc-media-player
streaming
rtsp
rtmp
Kevin - Dhinesh babu
источник
источник