Huge start delay, when streaming RTSP to FLV(HTTP)

About encoding, codec settings, muxers and filter usage
burek
Blank Cone
Blank Cone
Posts: 40
Joined: 10 May 2008 21:52

Huge start delay, when streaming RTSP to FLV(HTTP)

Postby burek » 19 Apr 2011 01:52

Hi,

Although this problem is related to the one of last messages in this thread: viewtopic.php?f=4&t=71714 I'll post a new topic for the problem that has emerged, while solving another one :)

So, the case is this. I have an ip camera:
Video - Codec: H264 - MPEG-4 AVC (part 10) (h264)
Audio - Codec: PCM MU-LAW (mlaw)

I'm trying to make VLC get the input from that webcam and "remux" it to FLV (HTTP). The command used is:

Code: Select all

cvlc -vvv rtsp://webcam/h264_2 --no-sout-audio --sout '#standard{access=http,mux=ffmpeg{mux=flv},dst=0.0.0.0:4567/video.flv}'
This works, but when I try to use VLC on another machine to watch that FLV stream, the VLC player introduces a starting delay of about 3-4 MINUTES (yes, minutes) before playing the video normally. This is what I get in the Tools - Messages, almost immediatelly:

Code: Select all

main debug: processing request item http://192.168.25.18:4567/video.flv node Playlist skip 0 main debug: resyncing on http://192.168.25.18:4567/video.flv main debug: http://192.168.25.18:4567/video.flv is at 0 main debug: starting new item main debug: creating new input thread main debug: Creating an input for 'http://192.168.25.18:4567/video.flv' main debug: thread started main debug: using timeshift granularity of 50 MiB main debug: using timeshift path 'C:\DOCUME~1\Milojica\LOCALS~1\Temp' main debug: thread (input) created at priority 1 (../.././src/input/input.c:214) main debug: `http://192.168.25.18:4567/video.flv' gives access `http' demux `' path `192.168.25.18:4567/video.flv' main debug: creating demux: access='http' demux='' path='192.168.25.18:4567/video.flv' main debug: looking for access_demux module: 0 candidates main debug: no access_demux module matched "http" main debug: TIMER module_need() : 0.408 ms - Total 0.408 ms / 1 intvls (Avg 0.408 ms) main debug: creating access 'http' path='192.168.25.18:4567/video.flv' main debug: looking for access module: 2 candidates access_http debug: http: server='192.168.25.18' port=4567 file='/video.flv' qt4 debug: IM: Setting an input main debug: net: connecting to 192.168.25.18 port 4567 main debug: connection succeeded (socket = 1556) access_http debug: protocol 'HTTP' answer code 200 access_http debug: Content-Type: application/octet-stream main debug: using access module "access_http" main debug: TIMER module_need() : 151.354 ms - Total 151.354 ms / 1 intvls (Avg 151.354 ms) main debug: Using AStream*Stream main debug: pre buffering main debug: received first data after 17 ms main debug: pre-buffering done 1024 bytes in 0s - 56 KiB/s main debug: looking for stream_filter module: 2 candidates main debug: no stream_filter module matching "any" could be loaded main debug: TIMER module_need() : 0.412 ms - Total 0.412 ms / 1 intvls (Avg 0.412 ms) main debug: looking for stream_filter module: 1 candidate main debug: using stream_filter module "stream_filter_record" main debug: TIMER module_need() : 0.477 ms - Total 0.477 ms / 1 intvls (Avg 0.477 ms) main debug: creating demux: access='http' demux='' path='192.168.25.18:4567/video.flv' main debug: looking for demux module: 52 candidates ts warning: TS module discarded (lost sync) lua debug: Trying Lua scripts in C:\Documents and Settings\Milojica\Application Data\vlc\lua\playlist lua debug: Trying Lua scripts in C:\Program Files\VideoLAN\VLC\lua\playlist lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\anevia_streams.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\anevia_xml.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\appletrailers.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\bbc_co_uk.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\break.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\canalplus.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\cue.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\dailymotion.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\france2.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\googlevideo.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\jamendo.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\joox.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\katsomo.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\koreus.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\lelombrik.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\megavideo.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\metacafe.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\metachannels.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\mpora.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\pinkbike.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\rockbox_fm_presets.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\vimeo.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\youtube.lua lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\playlist\youtube_homepage.lua avcodec debug: detected format: flv
and after about 2 minutes and 20 seconds, the video starts playing and this appears (continued) in Messages:

Code: Select all

avcodec debug: detected format: flv main debug: selecting program id=0 avcodec debug: adding es: video codec = h264 avcodec debug: AVFormat supported stream avcodec debug: - format = flv (FLV format) avcodec debug: - start time = 251247000 avcodec debug: - duration = 0 main debug: using demux module "avcodec" main debug: TIMER module_need() : 115992.291 ms - Total 115992.291 ms / 1 intvls (Avg 115992.285 ms) main debug: looking for decoder module: 34 candidates avcodec debug: libavcodec already initialized avcodec debug: trying to use direct rendering avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started main debug: using decoder module "avcodec" main debug: TIMER module_need() : 2.915 ms - Total 2.915 ms / 1 intvls (Avg 2.915 ms) main debug: thread (decoder) created at priority 0 (../.././src/input/decoder.c:301) main debug: thread started main debug: looking for meta reader module: 2 candidates lua debug: Trying Lua scripts in C:\Documents and Settings\Milojica\Application Data\vlc\lua\meta\reader lua debug: Trying Lua scripts in C:\Program Files\VideoLAN\VLC\lua\meta\reader lua debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\meta\reader\filename.lua main debug: no meta reader module matching "any" could be loaded main debug: TIMER module_need() : 4.335 ms - Total 4.335 ms / 1 intvls (Avg 4.335 ms) main debug: `http://192.168.25.18:4567/video.flv' successfully opened main debug: Buffering 0% main debug: Buffering 3% main debug: Buffering 6% main debug: Buffering 10% main debug: Buffering 13% main debug: Buffering 16% main debug: Buffering 20% main debug: Buffering 23% main debug: Buffering 26% main debug: Buffering 30% main debug: Buffering 33% main debug: Buffering 36% main debug: Buffering 40% main debug: Buffering 43% main debug: Buffering 46% main debug: Buffering 49% main debug: Buffering 53% main debug: Buffering 56% main debug: Buffering 59% main debug: Buffering 63% main debug: Buffering 66% main debug: Buffering 69% main debug: Buffering 73% main debug: Buffering 76% main debug: Buffering 79% main debug: Buffering 83% main debug: Buffering 86% main debug: Buffering 89% main debug: Buffering 93% main debug: Buffering 96% main debug: Buffering 99% main debug: Stream buffering done (1243 ms in 3 ms) main debug: no usable vout present, spawning one main debug: looking for text renderer module: 2 candidates freetype debug: Building font databases. freetype debug: Took 303919 microseconds freetype debug: Using Arial as font from file C:/WINDOWS/fonts/arial.ttf freetype debug: using fontsize: 2 main debug: using text renderer module "freetype" main debug: TIMER module_need() : 306.875 ms - Total 306.875 ms / 1 intvls (Avg 306.875 ms) main debug: looking for video filter2 module: 18 candidates swscale debug: 32x32 chroma: YUVA -> 16x16 chroma: YUVA with scaling using Bicubic (good quality) main debug: using video filter2 module "swscale" main debug: TIMER module_need() : 3.946 ms - Total 3.946 ms / 1 intvls (Avg 3.946 ms) main debug: looking for video filter2 module: 18 candidates yuvp debug: YUVP to YUVA converter main debug: using video filter2 module "yuvp" main debug: TIMER module_need() : 0.631 ms - Total 0.631 ms / 1 intvls (Avg 0.631 ms) main debug: window size: 426x240 main debug: Deinterlacing available main debug: deinterlace 0, mode blend, is_needed 0 main debug: looking for video output module: 1 candidate vout_wrapper debug: Opening vout display wrapper main debug: looking for vout display module: 8 candidates directx debug: creating Vout EventThread directx debug: DirectXCreateWindow main debug: looking for vout window hwnd module: 3 candidates qt4 debug: requesting video... qt4 debug: Video was requested 0, 0 main debug: using vout window hwnd module "qt4" main debug: TIMER module_need() : 58.818 ms - Total 58.818 ms / 1 intvls (Avg 58.818 ms) directx debug: created video sub-window directx debug: Vout EventThread running directx debug: disabling screen saver directx debug: directx-device: directx debug: DirectXEnumCallback: RADEON 9200 SERIES , \\.\DISPLAY1 directx debug: selecting RADEON 9200 SERIES , \\.\DISPLAY1 directx debug: screen dimensions (0x0,1280x768) directx debug: DirectDraw Capabilities: overlay=1 yuvoverlay=1 can_deinterlace_overlay=1 colorkey=1 stretch=1 bltfourcc=1 main debug: VoutDisplayEvent 'resize' 434x274 window directx debug: YUV overlay surface created successfully main debug: using vout display module "directx" main debug: TIMER module_need() : 236.084 ms - Total 236.084 ms / 1 intvls (Avg 236.084 ms) main debug: using video output module "vout_wrapper" main debug: TIMER module_need() : 236.950 ms - Total 236.950 ms / 1 intvls (Avg 236.950 ms) main debug: got 1 direct buffer(s) main debug: pic render sz 320x240, of (0,0), vsz 320x240, 4cc I420, sar 4:3, msk r0x0 g0x0 b0x0 main debug: pic in sz 320x240, of (0,0), vsz 320x240, 4cc I420, sar 4:3, msk r0x0 g0x0 b0x0 main debug: pic out sz 320x240, of (0,0), vsz 320x240, 4cc I420, sar 4:3, msk r0x0 g0x0 b0x0 main debug: direct render, mapping render pictures 0-23 to system pictures 1-24 main debug: VoutDisplayEvent 'resize' 426x240 window avcodec debug: using direct rendering main debug: End of video preroll main debug: Received first picture main debug: Decoder buffering done in 585 ms main debug: Post-processing available main warning: vlc_object_find_name(postproc) is not safe! main debug: VoutDisplayEvent 'resize' 427x240 window freetype debug: using fontsize: 15 main debug: looking for video blending module: 1 candidate blend debug: chroma: YUVA -> I420 main debug: using video blending module "blend" main debug: TIMER module_need() : 0.468 ms - Total 0.468 ms / 1 intvls (Avg 0.468 ms) main debug: auto hidding mouse main warning: late picture skipped (8468 > -871) main warning: late picture skipped (1768 > -655) main warning: late picture skipped (9621 > -661) main warning: late picture skipped (3028 > -6730) main warning: late picture skipped (513 > -1308)
Did anyone have a problem like this one?

P.S.
Is it possible to embed that audio codec (mlaw) in FLV somehow? Is there any list of audio codecs, supported by FLV?
Image
          • www.gusari.org

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Huge start delay, when streaming RTSP to FLV(HTTP)

Postby Jean-Baptiste Kempf » 19 Apr 2011 10:43

Did you try with no audio?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

burek
Blank Cone
Blank Cone
Posts: 40
Joined: 10 May 2008 21:52

Re: Huge start delay, when streaming RTSP to FLV(HTTP)

Postby burek » 19 Apr 2011 15:33

You mean "--no-sout-audio" ?
I did. There is that option up there in the example of my command.
Image
          • www.gusari.org

rakeshsg
New Cone
New Cone
Posts: 4
Joined: 20 Mar 2012 09:38

Re: Huge start delay, when streaming RTSP to FLV(HTTP)

Postby rakeshsg » 20 Mar 2012 13:47

Hi, I am facing the similar issue raised in this topic. I have even tried with --no-audio and "--no-sout-audio. But it has not helped.

HAs any one able to find a fix/solution for this issue?
Thanks

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: Huge start delay, when streaming RTSP to FLV(HTTP)

Postby kmf31 » 21 Mar 2012 18:49

I encountered a "minor" delay problem of RTSP depending on the firewall configuration. In theory if you want to use RTSP you need to open the udp ports from 1024 to 65535 for the IP of the RTSP-serveur. This works but may produce a delay of 5-10 secondes before the RTSP-stream starts.
However, if you open all ports, all tcp and upd ports, for IP of RTSP serveur the stream starts much faster.

I don't know if this is related to your problem but it is quite simply to verify (if you can access to the firewall configuration of your machine).

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Huge start delay, when streaming RTSP to FLV(HTTP)

Postby Sébastien Escudier » 22 Mar 2012 08:39

the 10 seconds delay when behind a firewall is because when vlc first attemps fail, it switches back to rtsp tcp.
you can force it with --rtsp-tcp


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 13 guests