I'm trying to transcode RTSP input stream from H264 IP Cam into MJPEG output stream with VLC via Windows Command Prompt. I followed this example suggested by Jean-Baptiste Kempf:
Code: Select all
>"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy -vvv rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout="#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime="multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a"},mux=mpjpeg,dst=:8089/videostream.cgi}" --sout-keep
Code: Select all
[0051afac] dummy interface: VLC media player - 2.2.2 Weatherwax
[0051afac] dummy interface: Copyright © 1996-2016 the VideoLAN team
[0051afac] dummy interface:
Warning: if you cannot access the GUI anymore, open a command-line window, go to the directory where you installed VLC and run "vlc -I qt"
[0051afac] dummy interface: using the dummy interface module...
[0051afac] core interface debug: using interface module "dummy"
[0057674c] core playlist debug: processing request item: null, node: Playlist, skip: 0
[0057674c] core playlist debug: rebuilding array of current - root Playlist
[0057674c] core playlist debug: rebuild done - 1 items, index -1
[0057674c] core playlist debug: starting playback of the new playlist item
[0057674c] core playlist debug: resyncing on rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8086/videostream.cgi} --sout-keep
[0057674c] core playlist debug: rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8086/videostream.cgi} --sout-keep is at 0
[0057674c] core playlist debug: creating new input thread
[004e94b4] core input debug: Creating an input for 'rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8086/videostream.cgi} --sout-keep'
[0057674c] [004e94b4] core playlist debug: core input debug: requesting art for rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8086/videostream.cgi} --sout-keepusing timeshift granularity of 50 MiB, in path 'C:\Users\SemiPro\AppData\Local\Temp'
[004e94b4] [004e970c] core input debug: core art finder debug: `rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8086/videostream.cgi} --sout-keep' gives access `rtsp' demux `' path `192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout='looking for meta fetcher module matching "any": 1 candidates
[004e94b4] core input debug: specified demux `any'
[004e94b4] [004e970c] core input debug: lua art finder debug: creating demux: access='rtsp' demux='any' location='192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=' file='\\192.168.1.117:554\user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout='Trying Lua scripts in C:\Users\SemiPro\AppData\Roaming\vlc\lua\meta\fetcher
[00569c74] core demux debug: [004e970c] looking for access_demux module matching "rtsp": 12 candidateslua art finder debug:
Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
[004e970c] lua art finder debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
[004e970c] lua art finder debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
[004e970c] core art finder debug: no meta fetcher modules matched
[01043ecc] core libvlc debug: searching art for rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8086/videostream.cgi} --sout-keep
[004e943c] core art finder debug: looking for art finder module matching "any": 2 candidates
[004e943c] lua art finder debug: Trying Lua scripts in C:\Users\SemiPro\AppData\Roaming\vlc\lua\meta\art
[004e943c] lua art finder debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
[004e943c] lua art finder debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
[004e943c] lua art finder debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac[00569c74]
live555 demux debug: version 2016.01.12
[004e943c] lua art finder debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
[004e943c] lua art finder debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
[004e943c] lua art finder debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
[004e943c] lua art finder debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
[004e943c] lua art finder debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
Opening connection to 192.168.1.117[004e943c] , port lua art finder debug: 554skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac...
[004e943c] core art finder debug: no art finder modules matched
[01043ecc] core libvlc debug: art not found for rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=#transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8086/videostream.cgi} --sout-keep
...remote connection opened
Sending request: OPTIONS rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream+--sout= RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.01.12)
Received 121 new bytes of response data.
Received a complete OPTIONS response:
RTSP/1.0 200 OK
Server: H264DVR 1.0
cseq: 2
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, GET_PARAMETER, PLAY, PAUSE
Sending request: DESCRIBE rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream+--sout= RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.01.12)
Accept: application/sdp
Received 52 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 451 ERROR
Server: H264DVR 1.0
cseq: 3
[00569c74] live555 demux debug: we will now try HTTP tunneling mode
Opening connection to 192.168.1.117, port 80...
...remote connection opened
Requesting RTSP-over-HTTP tunneling (on port 80)
Sending request: GET /user=admin_password=zamar_channel=1_stream=0.sdp?real_stream+--sout= HTTP/1.1
CSeq: 1
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.01.12)
Host: 192.168.1.117
x-sessioncookie: e83a1b996acad41c027fc46
Accept: application/x-rtsp-tunnelled
Pragma: no-cache
Cache-Control: no-cache
Received 16 new bytes of response data.
Received 188 new bytes of response data.
Opening connection to 192.168.1.117, port 80...
...remote connection opened
Requesting RTSP-over-HTTP tunneling (on port 80)
Sending request: GET /user=admin_password=zamar_channel=1_stream=0.sdp?real_stream+--sout= HTTP/1.1
CSeq: 1
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.01.12)
Host: 192.168.1.117
x-sessioncookie: 19d70d5a3a21b3b15e9c6ec
Accept: application/x-rtsp-tunnelled
Pragma: no-cache
Cache-Control: no-cache
Received 16 new bytes of response data.
Received 188 new bytes of response data.
[00569c74] live555 demux debug: connection error -10057
[00569c74] live555 demux error: Failed to connect with rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream+--sout=
[00569c74] core demux debug: no access_demux modules matched
[004e94b4] core input debug: creating access 'rtsp' location='192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout=', path='\\192.168.1.117:554\user=admin_password=zamar_channel=1_stream=0.sdp?real_stream --sout='
[0057fe2c] core access debug: looking for access module matching "rtsp": 21 candidates
[0057fe2c] core access debug: net: connecting to 192.168.1.117 port 554
[0057fe2c] core access debug: connection succeeded (socket = 748)
The same command works OK when entered via VLC GUI Menu: Media-Stream. Below is a totally different output I'm getting in Debug Message window. It looks like it starts where Cmd debug output stops. So what's wrong with the VLC commandline?
Code: Select all
qt4 debug: MRL passed to the Sout: rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream
core debug: adding item `Streaming' ( rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream )
core debug: processing request item: Streaming, node: null, skip: 0
core debug: rebuilding array of current - root Playlist
core debug: rebuild done - 1 items, index 0
core debug: starting playback of the new playlist item
core debug: resyncing on Streaming
core debug: Streaming is at 0
core debug: creating new input thread
core debug: Creating an input for 'Streaming'
core debug: requesting art for Streaming
core debug: meta ok for (null), need to fetch art
core debug: using sout chain=`transcode{vcodec=mjpg,vb=2500,scale=auto,width=640,fps=10,acodec=none}:standard{access=http{mime="multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a"},mux=mpjpeg,dst=:8086/videostream.cgi}'
core debug: stream=`standard'
core debug: looking for sout stream module matching "standard": 22 candidates
qt4 debug: IM: Setting an input
core debug: set config option: sout-standard-access to http{mime="multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a"}
core debug: set config option: sout-standard-mux to mpjpeg
core debug: set config option: sout-standard-dst to :8086/videostream.cgi
core debug: looking for sout access module matching "http": 8 candidates
core debug: looking for meta fetcher module matching "any": 1 candidates
core debug: looking for meta fetcher module matching "any": 1 candidates
lua debug: Trying Lua scripts in C:\Users\SemiPro\AppData\Roaming\vlc\lua\meta\fetcher
lua debug: Trying Lua scripts in C:\Users\SemiPro\AppData\Roaming\vlc\lua\meta\fetcher
lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
core debug: no meta fetcher modules matched
core debug: searching art for Streaming
core debug: looking for art finder module matching "any": 2 candidates
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
core debug: no meta fetcher modules matched
core debug: searching art for Streaming
core debug: looking for art finder module matching "any": 2 candidates
core debug: set config option: sout-http-mime to multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a
core debug: net: listening to * port 8086
core debug: using sout access module "access_output_http"
core debug: looking for sout mux module matching "mpjpeg": 10 candidates
lua debug: Trying Lua scripts in C:\Users\SemiPro\AppData\Roaming\vlc\lua\meta\art
lua debug: Trying Lua scripts in C:\Users\SemiPro\AppData\Roaming\vlc\lua\meta\art
lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
core debug: no art finder modules matched
core debug: art not found for Streaming
lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
core debug: no art finder modules matched
core debug: art not found for Streaming
mux_mpjpeg debug: Multipart jpeg muxer opened
core debug: using sout mux module "mux_mpjpeg"
core debug: muxer support adding stream at any time
core debug: muxer prefers to wait for all ES before starting to mux
stream_out_standard debug: using `http{mime="multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a"}/mpjpeg://:8086/videostream.cgi'
core debug: using sout stream module "stream_out_standard"
core debug: stream=`transcode'
core debug: looking for sout stream module matching "transcode": 22 candidates
core debug: set config option: sout-transcode-vcodec to mjpg
core debug: set config option: sout-transcode-vb to 2500
core debug: set config option: sout-transcode-scale to auto
core debug: set config option: sout-transcode-width to 640
core debug: set config option: sout-transcode-fps to 10
core debug: set config option: sout-transcode-acodec to none
stream_out_transcode debug: Checking codec mapping for none got none
stream_out_transcode debug: codec audio=none 0Hz 0 channels 96Kb/s
stream_out_transcode debug: Checking video codec mapping for mjpg got MJPG
stream_out_transcode debug: codec video=MJPG 640x0 scaling: 0.000000 2500kb/s
core debug: using sout stream module "stream_out_transcode"
core debug: using timeshift granularity of 50 MiB, in path 'C:\Users\SemiPro\AppData\Local\Temp'
core debug: `rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream' gives access `rtsp' demux `' path `192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream'
core debug: specified demux `any'
core debug: creating demux: access='rtsp' demux='any' location='192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream' file='\\192.168.1.117:554\user=admin_password=zamar_channel=1_stream=0.sdp?real_stream'
core debug: looking for access_demux module matching "rtsp": 12 candidates
live555 debug: version 2016.01.12
live555 debug: RTP subsession 'video/H264'
core debug: selecting program id=0
live555 debug: setup start: 0.000000 stop:0.000000
live555 debug: We have a timeout of 60 seconds
live555 debug: spawned timeout thread
live555 debug: play start: 0.000000 stop:0.000000
core debug: using access_demux module "live555"
core debug: looking for packetizer module matching "any": 23 candidates
packetizer_h264 debug: found NAL_SPS (sps_id=0)
packetizer_h264 debug: found NAL_PPS (pps_id=0 sps_id=0)
core debug: using packetizer module "packetizer_h264"
core debug: starting in async mode
core debug: looking for meta reader module matching "any": 2 candidates
lua debug: Trying Lua scripts in C:\Users\SemiPro\AppData\Roaming\vlc\lua\meta\reader
lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader\filename.luac
core debug: no meta reader modules matched
core debug: `rtsp://192.168.1.117:554/user=admin_password=zamar_channel=1_stream=0.sdp?real_stream' successfully opened
core debug: switching to sync mode
core debug: Buffering 0%
core debug: Buffering 0%
core debug: Buffering 0%
core debug: Buffering 0%
core debug: Buffering 4%
core debug: Buffering 8%
core debug: adding a new sout input (sout_input:03dde1f0)
stream_out_transcode debug: creating video transcoding from fcc=`h264' to fcc=`MJPG'
core debug: looking for decoder module matching "any": 43 candidates
core debug: Buffering 12%
avcodec debug: CPU flags: 0x010011db
avcodec debug: trying to use direct rendering
avcodec debug: allowing 4 thread(s) for decoding
avcodec debug: avcodec codec (H264 - MPEG-4 AVC (part 10)) started
avcodec debug: using frame thread mode with 4 threads
core debug: using decoder module "avcodec"
core debug: looking for encoder module matching "any": 21 candidates
core debug: Buffering 16%
avcodec debug: CPU flags: 0x010011db
avcodec debug: Time base for probing setted to 1/1000000
avcodec debug: Time base set to 1/1000000
avcodec debug: rc buffer size 10000000 bits
avcodec debug: found encoder Motion JPEG Video
core debug: using encoder module "avcodec"
core debug: removing module "avcodec"
core debug: Buffering 20%
core debug: Buffering 24%
core debug: Buffering 28%
core debug: Buffering 32%
core debug: Buffering 36%
core debug: Buffering 40%
core debug: Buffering 44%
core debug: Buffering 48%
core debug: Buffering 52%
core debug: Buffering 56%
core debug: Buffering 60%
core debug: Buffering 64%
core debug: Buffering 68%
core debug: Buffering 72%
core debug: Buffering 76%
core debug: Buffering 80%
core debug: Buffering 84%
core debug: Buffering 88%
core debug: Buffering 92%
core debug: Buffering 96%
core debug: Buffering 100%
core debug: Stream buffering done (1040 ms in 1196 ms)
core debug: Decoder wait done in 0 ms
avcodec debug: available hardware decoder output format 61 (dxva2_vld)
avcodec debug: available hardware decoder output format 128 (d3d11va_vld)
avcodec debug: available software decoder output format 0 (yuv420p)
core debug: looking for hw decoder module matching "none": 1 candidates
core debug: no hw decoder modules matched
avcodec warning: plane 0 not aligned
avcodec warning: disabling direct rendering
stream_out_transcode debug: decoder aspect is 1.734417:1
stream_out_transcode debug: source pixel aspect is 0.975610:1
stream_out_transcode debug: scaled pixel aspect is 0.975610:1
stream_out_transcode debug: source 1280x720, destination 640x360
stream_out_transcode debug: source fps 22/1, destination 10/1
stream_out_transcode info: input interval 45454 (base 1)
stream_out_transcode info: output interval 100000 (base 1)
stream_out_transcode debug: encoder aspect is 640:370
core debug: looking for video filter2 module matching "any": 58 candidates
swscale debug: 1280x720 (1280x738) chroma: I420 -> 640x360 (640x370) chroma: J420 with scaling using Bicubic (good quality)
core debug: using video filter2 module "swscale"
core debug: Filter 'Swscale' (0539d364) appended to chain
stream_out_transcode debug: destination (after video filters) 640x370
core debug: looking for encoder module matching "any": 21 candidates
avcodec debug: CPU flags: 0x010011db
avcodec debug: Time base for probing setted to 1/10
avcodec debug: Time base set to 1/10
avcodec debug: rc buffer size 10000000 bits
avcodec debug: found encoder Motion JPEG Video
core debug: using encoder module "avcodec"
core debug: adding a new input
mux_mpjpeg debug: adding input
core warning: late buffer for mux input (148000)
core warning: late buffer for mux input (57000)
stream_out_transcode warning: Reseting video sync
stream_out_transcode warning: Reseting video sync
avcodec warning: almost fed libavcodec with two frames with the same PTS (265336)