I'm trying to restream/transcode IP Cameras serving RTSP into OGG for a website.
After a very long time, I finally got it working. However after a couple minutes to an hour, VLC stops transcoding with debug: "Buffering 0%" repetitively.
Any support or suggestions on this would be enormously appreciated, and I'd be eternally grateful.
I'm using VLC on RHEL 6, 32G RAM, 8x 2.4 CPUs, 1T Disk
I'm using the command,
cvlc -vvv rtsp://###:554/profile3/media.smp --sout="#transcode{vcodec=theo,acodec=none}:http{dst=:8090/stream.ogg}"
I've also tried it with a combination of --network-caching --live-caching --file-caching --sout-mux-caching --sout-transcode-high-priority among other flags before and after the mrl.
I've also tried setting #transcode{vcodec=theo,acodec=none,vb=64,fps=10,width=640,height=360} (the very minimum), as well as #transcode{vcodec=VP80,acodec=none}:http{dst=:8092/stream.webm} with the same result of the process idling with (Buffering 0%).
The IP Camera has profiles I can use. The current profile I customized (to the lowest possible res/fps) is,
Samsung SNV-6013
Codec: H.264 (H.264 | MPEG)
ATC mode: Off (On - Control Frameframe | On Control Compression)
ATC sesnsitivity / limit: Off
Resolution: 640 x 360 (up to 1920x1080)
Framerate: 10 fps (up to 30)
Compression: 20 - Worst (down to 1 - Best)
Maximum bitrate: 64 (64 to 30720)
Bitrate Control: VBR (CBR)
GOV length: 30
Profile: High (Baseline | Main | High)
Entropy coding: CABAC (CABAC | CAVLC)
Multicast (SVNP): off
Multicast (RTP): off
It starts to fail with
[0x7f86cc000f08] main stream output warning: trying to send non-dated packet to stream output!
[0x7f86d4000b28] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 10000 ms)
[0x7f86d4000b28] main input error: ES_OUT_RESET_PCR called
Then repeats
[0x7f86d4000b28] main input debug: Buffering 0%
Indefinitely.
It boots up with this,
$ cvlc -vvv --network-caching=10000 --live-caching=10000 rtsp://####:554/profile3/media.smp --sout="#transcode{vcodec=theo,acodec=none}:http{dst=:8090/stream.ogg}"
VLC media player 2.0.7 Twoflower (revision 2.0.6-54-g7dd7e4d)
[0x9e2108] main libvlc debug: VLC media player - 2.0.7 Twoflower
[0x9e2108] main libvlc debug: Copyright © 1996-2013 VLC authors and VideoLAN
[0x9e2108] main libvlc debug: revision 2.0.6-54-g7dd7e4d
[0x9e2108] main libvlc debug: configured with ./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-shared' '--disable-static' '--disable-rpath' '--disable-optimizations' '--enable-mmx' '--enable-sse' '--enable-ncurses' '--enable-pvr' '--enable-faad' '--enable-sftp' '--enable-kate' '--enable-lirc' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig'
[0x9e2108] main libvlc debug: searching plug-in modules
[0x9e2108] main libvlc debug: loading plugins cache file /usr/lib64/vlc/plugins/plugins.dat
[0x9e2108] main libvlc debug: recursively browsing `/usr/lib64/vlc/plugins'
[0x9e2108] main libvlc debug: saving plugins cache /usr/lib64/vlc/plugins/plugins.dat
[0x9e2108] main libvlc debug: plug-ins loaded: 413 modules
[0x9e2108] main libvlc debug: opening config file (/home/***/.config/vlc/vlcrc)
[0x9e2108] main libvlc debug: translation test: code is "C"
[0x9e2108] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU
[0x9e2108] main libvlc debug: looking for memcpy module: 4 candidates
[0x9e2108] main libvlc debug: using memcpy module "memcpymmxext"
[0xaacaa8] main input debug: Creating an input for 'Media Library'
[0xaacaa8] main input debug: Input is a meta file: disabling unneeded options
[0xaacaa8] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0xaacaa8] main input debug: `file/xspf-open:///home/***/.local/share/vlc/ml.xspf' gives access `file' demux `xspf-open' path `/home/***/.local/share/vlc/ml.xspf'
[0xaacaa8] main input debug: creating demux: access='file' demux='xspf-open' location='/home/***/.local/share/vlc/ml.xspf' file='/home/***/.local/share/vlc/ml.xspf'
[0xab1408] main demux debug: looking for access_demux module: 3 candidates
[0xab1408] main demux debug: no access_demux module matching "file" could be loaded
[0xab1408] main demux debug: TIMER module_need() : 1.418 ms - Total 1.418 ms / 1 intvls (Avg 1.418 ms)
[0xaacaa8] main input debug: creating access 'file' location='/home/***/.local/share/vlc/ml.xspf', path='/home/***/.local/share/vlc/ml.xspf'
[0xab22f8] main access debug: looking for access module: 2 candidates
[0xab22f8] filesystem access debug: opening file `/home/***/.local/share/vlc/ml.xspf'
[0xab22f8] main access debug: using access module "filesystem"
[0xab22f8] main access debug: TIMER module_need() : 0.325 ms - Total 0.325 ms / 1 intvls (Avg 0.325 ms)
[0xab2448] main stream debug: Using stream method for AStream*
[0xab2448] main stream debug: starting pre-buffering
[0xab2448] main stream debug: received first data after 0 ms
[0xab2448] main stream debug: pre-buffering done 296 bytes in 0s - 6423 KiB/s
[0xab26a8] main stream debug: looking for stream_filter module: 7 candidates
[0xab26a8] main stream debug: no stream_filter module matching "any" could be loaded
[0xab26a8] main stream debug: TIMER module_need() : 3.147 ms - Total 3.147 ms / 1 intvls (Avg 3.147 ms)
[0xab26a8] main stream debug: looking for stream_filter module: 1 candidate
[0xab26a8] main stream debug: using stream_filter module "stream_filter_record"
[0xab26a8] main stream debug: TIMER module_need() : 0.172 ms - Total 0.172 ms / 1 intvls (Avg 0.172 ms)
[0xaacaa8] main input debug: creating demux: access='file' demux='xspf-open' location='/home/***/.local/share/vlc/ml.xspf' file='/home/***/.local/share/vlc/ml.xspf'
[0xab7408] main demux debug: looking for demux module: 1 candidate
[0xab7408] playlist demux debug: using XSPF playlist reader
[0xab7408] main demux debug: using demux module "playlist"
[0xab7408] main demux debug: TIMER module_need() : 0.243 ms - Total 0.243 ms / 1 intvls (Avg 0.243 ms)
[0xab7d58] main demux meta debug: looking for meta reader module: 2 candidates
[0xab7d58] lua demux meta debug: Trying Lua scripts in /home/***/.local/share/vlc/lua/meta/reader
[0xab7d58] lua demux meta debug: Trying Lua scripts in /usr/lib64/vlc/lua/meta/reader
[0xab7d58] lua demux meta debug: Trying Lua playlist script /usr/lib64/vlc/lua/meta/reader/filename.luac
[0xab7d58] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0xab7d58] main demux meta debug: no meta reader module matching "any" could be loaded
[0xab7d58] main demux meta debug: TIMER module_need() : 3.139 ms - Total 3.139 ms / 1 intvls (Avg 3.139 ms)
[0xaacaa8] main input debug: `file/xspf-open:///home/***/.local/share/vlc/ml.xspf' successfully opened
[0xad22a8] main xml reader debug: looking for xml reader module: 1 candidate
[0xad22a8] main xml reader debug: using xml reader module "xml"
[0xad22a8] main xml reader debug: TIMER module_need() : 0.282 ms - Total 0.282 ms / 1 intvls (Avg 0.282 ms)
[0xab7408] playlist demux debug: parsed 0 tracks successfully
[0xaacaa8] main input debug: EOF reached
[0xab7408] main demux debug: removing module "playlist"
[0xab26a8] main stream debug: removing module "stream_filter_record"
[0xab22f8] main access debug: removing module "filesystem"
[0xaacaa8] main input debug: TIMER input launching for 'Media Library' : 9.026 ms - Total 9.026 ms / 1 intvls (Avg 9.026 ms)
[0xab1168] main interface debug: looking for interface module: 1 candidate
[0xab1168] main interface debug: using interface module "hotkeys"
[0xab1168] main interface debug: TIMER module_need() : 0.213 ms - Total 0.213 ms / 1 intvls (Avg 0.213 ms)
[0xaad7b8] main interface debug: looking for interface module: 1 candidate
[0xaad7b8] inhibit interface error: Failed to connect to the D-Bus session daemon: /bin/dbus-launch terminated abnormally without any error message
[0xaad7b8] main interface debug: no interface module matching "inhibit,none" could be loaded
[0xaad7b8] main interface debug: TIMER module_need() : 1.411 ms - Total 1.411 ms / 1 intvls (Avg 1.411 ms)
[0xaad7b8] main interface error: no suitable interface module
[0xac4068] main playlist debug: playlist threads correctly activated
[0xac4068] main playlist debug: adding item `rtsp://####:554/profile3/media.smp' ( rtsp://####:554/profile3/media.smp )
[0xac4068] main playlist debug: rebuilding array of current - root Playlist
[0xac4068] main playlist debug: rebuild done - 0 items, index -1
[0xac4068] main playlist debug: no fetch required for (null) (art currently (null))
[0xaad7b8] main interface debug: looking for interface module: 1 candidate
[0xaad7b8] main interface debug: no interface module matching "globalhotkeys,none" could be loaded
[0xaad7b8] main interface debug: TIMER module_need() : 0.607 ms - Total 0.607 ms / 1 intvls (Avg 0.607 ms)
[0xaad7b8] main interface error: no suitable interface module
[0x9e2108] main libvlc error: interface "globalhotkeys,none" initialization failed
[0xaad7b8] main interface debug: looking for interface module: 1 candidate
[0xaad7b8] dummy interface: using the dummy interface module...
[0xaad7b8] main interface debug: using interface module "dummy"
[0xaad7b8] main interface debug: TIMER module_need() : 0.198 ms - Total 0.198 ms / 1 intvls (Avg 0.198 ms)
[0xac4068] main playlist debug: processing request item: null, node: Playlist, skip: 0
[0xac4068] main playlist debug: rebuilding array of current - root Playlist
[0xac4068] main playlist debug: rebuild done - 1 items, index -1
[0xac4068] main playlist debug: starting playback of the new playlist item
[0xac4068] main playlist debug: resyncing on rtsp://####:554/profile3/media.smp
[0xac4068] main playlist debug: rtsp://####:554/profile3/media.smp is at 0
[0xac4068] main playlist debug: creating new input thread
[0x7f0460000b28] main input debug: Creating an input for 'rtsp://####:554/profile3/media.smp'
[0x7f0458000f08] main stream output debug: using sout chain=`transcode{vcodec=theo,acodec=none}:http{dst=:8090/stream.ogg}'
[0x7f0458000f08] main stream output debug: stream=`http'
[0x7f0458001378] main stream out debug: looking for sout stream module: 1 candidate
[0x7f0458001378] main stream out debug: set config option: sout-standard-dst to :8090/stream.ogg
[0x7f04580040c8] main access out debug: looking for sout access module: 1 candidate
[0x7f04580040c8] main access out debug: net: listening to * port 8090
[0x7f04580040c8] main access out debug: using sout access module "access_output_http"
[0x7f04580040c8] main access out debug: TIMER module_need() : 0.752 ms - Total 0.752 ms / 1 intvls (Avg 0.752 ms)
[0x7f04580058a8] main mux debug: looking for sout mux module: 1 candidate
[0x7f04580058a8] mux_ogg mux: Open
[0x7f04580058a8] main mux debug: using sout mux module "mux_ogg"
[0x7f04580058a8] main mux debug: TIMER module_need() : 0.368 ms - Total 0.368 ms / 1 intvls (Avg 0.368 ms)
[0x7f0458000f08] main stream output debug: muxer support adding stream at any time
[0x7f0458000f08] main stream output debug: muxer prefers to wait for all ES before starting to mux
[0x7f0458001378] stream_out_standard stream out debug: using `http/ogg://:8090/stream.ogg'
[0x7f0458001378] main stream out debug: using sout stream module "stream_out_standard"
[0x7f0458001378] main stream out debug: TIMER module_need() : 1.482 ms - Total 1.482 ms / 1 intvls (Avg 1.482 ms)
[0x7f0458000f08] main stream output debug: stream=`transcode'
[0x7f0458006d18] main stream out debug: looking for sout stream module: 1 candidate
[0x7f0458006d18] main stream out debug: set config option: sout-transcode-vcodec to theo
[0x7f0458006d18] main stream out debug: set config option: sout-transcode-acodec to none
[0x7f0458006d18] stream_out_transcode stream out debug: codec audio=none 0Hz 0 channels 96Kb/s
[0x7f0458006d18] stream_out_transcode stream out debug: codec video=theo 0x0 scaling: 0.000000 0kb/s
[0x7f0458006d18] main stream out debug: using sout stream module "stream_out_transcode"
[0x7f0458006d18] main stream out debug: TIMER module_need() : 0.462 ms - Total 0.462 ms / 1 intvls (Avg 0.462 ms)
[0x7f0460000b28] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x7f0460000b28] main input debug: `rtsp://####:554/profile3/media.smp' gives access `rtsp' demux `' path `####:554/profile3/media.smp'
[0x7f0460000b28] main input debug: creating demux: access='rtsp' demux='' location='####:554/profile3/media.smp' file='(null)'
[0x7f04584cc428] main demux debug: looking for access_demux module: 1 candidate
[0x7f04584cc428] live555 demux debug: version 2012.01.25
Opening connection to ####, port 554...
...remote connection opened
Sending request: OPTIONS rtsp://####:554/profile3/media.smp RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.0.7 (LIVE555 Streaming Media v2012.01.25)
Received 224 new bytes of response data.
Received a complete OPTIONS response:
RTSP/1.0 200 OK
CSeq: 2
Date: Sat, 01 Jan 2000 00:13:13 GMT
Expires: Sat, 01 Jan 2000 00:13:13 GMT
Cache-Control: must-revalidate
Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS, GET_PARAMETER, SET_PARAMETER
Sending request: DESCRIBE rtsp://####:554/profile3/media.smp RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.0.7 (LIVE555 Streaming Media v2012.01.25)
Accept: application/sdp
Received 923 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Date: Sat, 01 Jan 2000 00:13:13 GMT
Expires: Sat, 01 Jan 2000 00:13:13 GMT
Cache-Control: must-revalidate
Content-Base: rtsp://####:554/profile3/media.smp
Content-Type: application/sdp
Content-Length: 615
x-Accept-Retransmit: our-retransmit
x-Accept-Dynamic-Rate: 1
v=0
o=- 0 0 IN IP4 ####
s=Media Presentation
i=samsung
c=IN IP4 0.0.0.0
b=AS:136
t=0 0
a=control:rtsp://####:554/profile3/media.smp
a=range:npt=now-
m=video 40344 RTP/AVP 98
b=AS:64
a=rtpmap:98 H264/90000
a=control:rtsp://####:554/profile3/media.smp/trackID=v
a=cliprect:0,0,360,640
a=framesize:98 640-360
a=framerate:10.0
a=fmtp:98 packetization-mode=1;profile-level-id=640028;sprop-parameter-sets=Z2QAKKy0BQF/yoA=,aO4Bniw=
m=application 40348 RTP/AVP 107
b=AS:8
a=rtpmap:107 vnd.onvif.metadata/90000
a=control:rtsp://####:554/profile3/media.smp/trackID=m
a=recvonly
[0x7f04584cc428] live555 demux debug: RTP subsession 'video/H264'
Sending request: SETUP rtsp://####:554/profile3/media.smp/trackID=v RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.0.7 (LIVE555 Streaming Media v2012.01.25)
Transport: RTP/AVP;unicast;client_port=40344-40345
Received 240 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 4
Date: Sat, 01 Jan 2000 00:13:13 GMT
Expires: Sat, 01 Jan 2000 00:13:13 GMT
Cache-Control: must-revalidate
Session: 34831;timeout=60
Transport: RTP/AVP;unicast;client_port=40344-40345;server_port=40344-40345
[0x7f0460000b28] main input debug: selecting program id=0
[0x7f04584cc428] live555 demux debug: setup start: 0.000000 stop:0.000000
Sending request: PLAY rtsp://####:554/profile3/media.smp RTSP/1.0
CSeq: 5
User-Agent: LibVLC/2.0.7 (LIVE555 Streaming Media v2012.01.25)
Session: 34831
Range: npt=0.000-
Received 258 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 5
Date: Sat, 01 Jan 2000 00:13:13 GMT
Expires: Sat, 01 Jan 2000 00:13:13 GMT
Cache-Control: must-revalidate
Session: 34831;timeout=60
RTP-Info: url=rtsp://####:554/profile3/media.smp/trackID=v;seq=7669;rtptime=1520932226
[0x7f04584cc428] live555 demux debug: We have a timeout of 60 seconds
[0x7f04584cc428] live555 demux debug: spawned timeout thread
[0x7f04584cc428] live555 demux debug: play start: 0.000000 stop:0.000000
[0x7f04584cc428] main demux debug: using access_demux module "live555"
[0x7f04584cc428] main demux debug: TIMER module_need() : 194.582 ms - Total 194.582 ms / 1 intvls (Avg 194.582 ms)
[0x7f04584ce238] main decoder debug: looking for packetizer module: 21 candidates
[0x7f04584ce238] packetizer_h264 decoder debug: found NAL_SPS (sps_id=0)
[0x7f04584ce238] packetizer_h264 decoder debug: found NAL_PPS (pps_id=0 sps_id=0)
[0x7f04584ce238] main decoder debug: using packetizer module "packetizer_h264"
[0x7f04584ce238] main decoder debug: TIMER module_need() : 2.139 ms - Total 2.139 ms / 1 intvls (Avg 2.139 ms)
[0x7f0460000b28] main input debug: starting in async mode
[0x7f04584f04b8] main demux meta debug: looking for meta reader module: 2 candidates
[0x7f04584f04b8] lua demux meta debug: Trying Lua scripts in /home/***/.local/share/vlc/lua/meta/reader
[0x7f04584f04b8] lua demux meta debug: Trying Lua scripts in /usr/lib64/vlc/lua/meta/reader
[0x7f04584f04b8] lua demux meta debug: Trying Lua playlist script /usr/lib64/vlc/lua/meta/reader/filename.luac
[0x7f04584f04b8] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x7f04584f04b8] main demux meta debug: no meta reader module matching "any" could be loaded
[0x7f04584f04b8] main demux meta debug: TIMER module_need() : 0.714 ms - Total 0.714 ms / 1 intvls (Avg 0.714 ms)
[0x7f0460000b28] main input debug: `rtsp://####:554/profile3/media.smp' successfully opened
Sending request: GET_PARAMETER rtsp://####:554/profile3/media.smp RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.0.7 (LIVE555 Streaming Media v2012.01.25)
Session: 34831
Received 164 new bytes of response data.
Received a complete GET_PARAMETER response:
RTSP/1.0 200 OK
CSeq: 6
Date: Sat, 01 Jan 2000 00:13:13 GMT
Expires: Sat, 01 Jan 2000 00:13:13 GMT
Cache-Control: must-revalidate
Session: 34831;timeout=60
[0x7f0460000b28] main input debug: switching to sync mode
[0x7f04584cc428] live555 demux debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP()
[0x7f0460000b28] main input error: ES_OUT_RESET_PCR called
[0x7f0460000b28] main input debug: Buffering 0%
[0x7f0460000b28] main input debug: Buffering 0%
[0x7f0460000b28] main input debug: Buffering 1%
[0x7f0460000b28] main input debug: Buffering 2%
[0x7f0458000f08] main stream output debug: adding a new sout input (sout_input:0x7f044c007110)
[0x7f0458006d18] stream_out_transcode stream out debug: creating video transcoding from fcc=`h264' to fcc=`theo'
[0x7f044c000a08] main generic debug: looking for decoder module: 31 candidates
[0x7f044c000a08] avcodec generic debug: libavcodec initialized (interface 0x365664)
[0x7f044c000a08] avcodec generic debug: trying to use direct rendering
[0x7f044c000a08] avcodec generic debug: allowing 4 thread(s) for decoding
[0x7f044c000a08] avcodec generic debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started
[0x7f044c000a08] avcodec generic debug: using frame thread mode with 4 threads
[0x7f044c000a08] main generic debug: using decoder module "avcodec"
[0x7f044c000a08] main generic debug: TIMER module_need() : 16.095 ms - Total 16.095 ms / 1 intvls (Avg 16.095 ms)
[0x7f044c000e48] main encoder debug: looking for encoder module: 13 candidates
[0x7f044c000e48] main encoder debug: using encoder module "theora"
[0x7f044c000e48] main encoder debug: TIMER module_need() : 2.618 ms - Total 2.618 ms / 1 intvls (Avg 2.618 ms)
[0x7f044c000e48] main encoder debug: removing module "theora"
[0x7f0460000b28] main input debug: Buffering 2%
[0x7f0460000b28] main input debug: Buffering 3%
[0x7f0460000b28] main input debug: Buffering 4%
[0x7f0460000b28] main input debug: Buffering 5%