Hi,
That is because ffmpeg/avconv may have packets dropouts. Remember, -f rtsp assumes UDP for transport. Search how to force RTP over TCP and I'm sure it will give superior results.
An alternative, would be:
ffmpeg …… -f flv -metadata streamName=test1 tcp://localhost:6666
Best regards,
Andrei
------
C++ RTMP Server
Web:
http://www.rtmpd.com
On May 13, 2013, at 1:17 PM, Martin Hellwig <
martinh...@googlemail.com> wrote:
> Hi guys,
> I need help in providing a livestream to my Android-Device (for my Bachelor-work). I use ffmpeg to get the needed data and to encode the whole thing. Then I send the stream to crrtmp via rtsp. With vlc or (on Android) via VideoView I can watch the stream. First of all my crtmp-config and the ffmpeg-instruction:
>
> crtmp-config:
> ....
> acceptors = {
> {
> ip="0.0.0.0",
> port=5555,
> protocol="inboundRtsp"
> }
> }
> ...
>
> ffmpeg -re -loop 1 -f image2 -i input.jpg -an -r 10 -c:v libx264 -q 1 -f rtsp -metadata title=test rtsp://
192.168.0.187:5554/flvplayback
>
> Now I connect to crtmp via vlc with this url: "rtsp://
192.168.0.187:5554/test". The stream starts, but the video starts a few seconds later. The video also has many failures (perhaps in en/decoding the video). The most bad part is, that a change of the input.jpg (on the machine, which runs ffmpeg) needs more than 10 seconds to take effect on the stream in vlc-player.
>
> To better understand the whole thing, here are the outputs from ffmpeg and crtmp, when I start the stream:
>
> CRTMP:
> /crtmpserver/src/crtmpserver.cpp:210 C++ RTMP Media Server (
www.rtmpd.com) version 1.1_beta build 784 - Gladiator - (built for Debian-6.0.5-i686 on 2013-01-20T13:27:00.000)
> /crtmpserver/src/crtmpserver.cpp:212 Initialize I/O handlers manager: epoll without timerfd_XXXX support
> /crtmpserver/src/crtmpserver.cpp:215 Configure modules
> /crtmpserver/src/crtmpserver.cpp:221 Plug in the default protocol factory
> /crtmpserver/src/crtmpserver.cpp:228 Configure factories
> /crtmpserver/src/crtmpserver.cpp:234 Configure acceptors
> /thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 0->1 IOHT_ACCEPTOR
> /crtmpserver/src/crtmpserver.cpp:240 Configure instances
> /crtmpserver/src/crtmpserver.cpp:246 Start I/O handlers manager: epoll without timerfd_XXXX support
> /crtmpserver/src/crtmpserver.cpp:249 Configure applications
> /thelib/src/configuration/module.cpp:177 Application flvplayback instantiated
> /thelib/src/application/baseclientapplication.cpp:95 mediaFolder is obsolete. Please use mediaStorage
> /thelib/src/mediaformats/readers/streammetadataresolver.cpp:95 meta folder for storage __obsolete__mediaFolder not specified. seek/meta files will be created inside the media folder
> /crtmpserver/src/crtmpserver.cpp:255 Install the quit signal
> /crtmpserver/src/crtmpserver.cpp:266
> +-----------------------------------------------------------------------------+
> | Services|
> +---+---------------+-----+-------------------------+-------------------------+
> | c | ip | port| protocol stack name | application name |
> +---+---------------+-----+-------------------------+-------------------------+
> |tcp| 0.0.0.0| 5554| inboundRtsp| flvplayback|
> +---+---------------+-----+-------------------------+-------------------------+
> /crtmpserver/src/crtmpserver.cpp:267 GO! GO! GO! (2082)
> /thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 1->2 IOHT_TCP_CARRIER
> /thelib/src/netio/epoll/tcpacceptor.cpp:185 Client connected:
192.168.0.197:52680 ->
192.168.0.187:5554
> /thelib/src/protocols/rtp/rtspprotocol.cpp:828 Not enough data. Wanted: 293; got: 0
> /thelib/src/protocols/rtp/sdp.cpp:476 Attribute `tool` with value `libavformat 55.3.100` not parsed
> /thelib/src/protocols/rtp/sdp.cpp:138 Audio track index 0 not found
> /thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 2->3 IOHT_UDP_CARRIER
> /thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 3->4 IOHT_UDP_CARRIER
> /thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp:482 Switch carriers
> /thelib/src/application/baseclientapplication.cpp:257 Stream INP(1) with name `teest` registered to application `flvplayback` from protocol RTSP(2)
> /thelib/src/protocols/rtp/streaming/innetrtpstream.cpp:549 Back time on teest. ATS: 1368439827343.99902344 LTS: 1368439827543.99902344; D: -200.00000000; isAudio: 0; _dtsCacheSize: 1
> /thelib/src/protocols/rtp/streaming/innetrtpstream.cpp:549 Back time on teest. ATS: 1368439827243.99902344 LTS: 1368439827543.99902344; D: -300.00000000; isAudio: 0; _dtsCacheSize: 2
> /thelib/src/protocols/rtp/streaming/innetrtpstream.cpp:549 Back time on teest. ATS: 1368439827443.99902344 LTS: 1368439827543.99902344; D: -100.00000000; isAudio: 0; _dtsCacheSize: 3
>
>
>
> ffmpeg:
> ffmpeg version N-52523-g0fb64da Copyright (c) 2000-2013 the FFmpeg developers
> built on Apr 28 2013 00:06:14 with gcc 4.7.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-a
> isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --ena
> le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreety
> e --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amr
> b --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-lib
> tmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libthe
> ra --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-l
> bvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --en
> ble-zlib
> libavutil 52. 27.101 / 52. 27.101
> libavcodec 55. 6.100 / 55. 6.100
> libavformat 55. 3.100 / 55. 3.100
> libavdevice 55. 0.100 / 55. 0.100
> libavfilter 3. 61.100 / 3. 61.100
> libswscale 2. 2.100 / 2. 2.100
> libswresample 0. 17.102 / 0. 17.102
> libpostproc 52. 3.100 / 52. 3.100
> Input #0, image2, from 'Desert.jpg':
> Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
> Stream #0:0: Video: mjpeg, yuvj420p, 1024x768 [SAR 96:96 DAR 4:3], 25 fps,
> 5 tbr, 25 tbn, 25 tbc
> No pixel format specified, yuvj420p for H.264 encoding chosen.
> Use -pix_fmt yuv420p for compatibility with outdated media players.
> [libx264 @ 000000000031f940] using SAR=1/1
> [libx264 @ 000000000031f940] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
> [libx264 @ 000000000031f940] profile High, level 3.1
> [libx264 @ 000000000031f940] 264 - core 132 r2309 3b1f1f7 - H.264/MPEG-4 AVC co
> ec - Copyleft 2003-2013 -
http://www.videolan.org/x264.html - options: cabac=1
> ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mix
> d_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_ps
> ip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 de
> imate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2
> _adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min
> 10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0
> 60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> Output #0, rtsp, to 'rtsp://
192.168.0.187:5554/flvplayback':
> Metadata:
> title : teest
> encoder : Lavf55.3.100
> Stream #0:0: Video: h264 (libx264), yuvj420p, 1024x768 [SAR 1:1 DAR 4:3], q
> -1--1, 90k tbn, 10 tbc
> Stream mapping:
> Stream #0:0 -> #0:0 (mjpeg -> libx264)
> Press [q] to stop, [?] for help
> frame= 10 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=9
> frame= 15 fps= 14 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=17
> frame= 21 fps= 13 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=0 drop=24
>
>
> I will thank you for any help to get this stream work as it should be.
> PS: I don't think the problem is my network (I actually do all things in my local LAN), perhaps the h264 live-encoding will be the prob, but all other codecs I've tried, doesn't work (mpeg4, mpeg2, mpegts).
>
> Thanks, Martin
>
>
> --
> You received this message because you are subscribed to "C++ RTMP Server" mailing list.
> To post to this group, send email to
c-rtmp...@googlegroups.com
> To unsubscribe from this group, send email to
>
c-rtmp-serve...@googlegroups.com
> For more options, visit this group at
>
http://groups.google.com/group/c-rtmp-server?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "C++ RTMP Server" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
c-rtmp-serve...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>