[FFmpeg-user] rtsp mpegts stream not captured with ffplay

Andrej Filipčič andrej.filipcic at ijs.si
Mon Nov 20 15:08:29 EET 2017


Hi,

I have a strange problem with rtstp and mpegts streams from a VOD provider.
The <url> is rtsp://<server>:554/<stream>.ts

The stream does play fine with vlc, but not with ffplay and ffmpeg does 
not work properly either.
The rtsp negotiation works well, I have straced the ffplay with:
strace -f ffplay -v 9 -loglevel 99 <url>
...
[pid  7070] socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 13
[pid  7070] bind(13, {sa_family=AF_INET, sin_port=htons(21498), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid  7070] getsockname(13, {sa_family=AF_INET, sin_port=htons(21498), 
sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
[pid  7070] setsockopt(13, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0
[pid  7070] getsockopt(13, SOL_SOCKET, SO_RCVBUF, [131072], [4]) = 0
[pid  7070] write(2, "[udp @ 0x7f3318031450] ", 23[udp @ 0x7f3318031450] 
) = 23
[pid  7070] write(2, "end receive buffer size reported"..., 43end 
receive buffer size reported is 131072
) = 43
[pid  7070] fcntl(13, F_GETFL)          = 0x2 (flags O_RDWR)
[pid  7070] fcntl(13, F_SETFL, O_RDWR|O_NONBLOCK) = 0
[pid  7070] mprotect(0x7f3318042000, 65536, PROT_READ|PROT_WRITE) = 0
[pid  7070] socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 14
[pid  7070] bind(14, {sa_family=AF_INET, sin_port=htons(21499), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid  7070] getsockname(14, {sa_family=AF_INET, sin_port=htons(21499), 
sin_addr=inet_addr("0.0.0.0")}, [128->16]) = 0
[pid  7070] setsockopt(14, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0
[pid  7070] getsockopt(14, SOL_SOCKET, SO_RCVBUF, [131072], [4]) = 0
[pid  7070] write(2, "[udp @ 0x7f3318041740] ", 23[udp @ 0x7f3318041740] 
) = 23
[pid  7070] write(2, "end receive buffer size reported"..., 43end 
receive buffer size reported is 131072
) = 43
[pid  7070] fcntl(14, F_GETFL)          = 0x2 (flags O_RDWR)
[pid  7070] fcntl(14, F_SETFL, O_RDWR|O_NONBLOCK) = 0
[pid  7070] write(2, "[rtsp @ 0x7f3318000b40] ", 24[rtsp @ 
0x7f3318000b40] ) = 24
[pid  7070] write(2, "Sending:\n..."..., 169Sending:
SETUP <url> RTSP/1.0
Transport: RTP/AVP/UDP;unicast;client_port=21498-21499
CSeq: 5
User-Agent: Lavf57.71.100
Session: 84677e4bd8a3cbdea0ef549c605e486b
....
[rtsp @ 0x7f9340000b40] line='Transport: 
RTP/AVP/UDP;unicast;destination=<dstip>;client_port=21498;source=<srcip>;server_port=10000-10001;ssrc=d4fb8
b5'
[rtsp @ 0x7f9340000b40] ret=1 c=0d [^M]
[rtsp @ 0x7f9340000b40] ret=1 c=0a [
]
[rtsp @ 0x7f9340000b40] line=''
[rtsp @ 0x7f9340000b40] setting jitter buffer size to 500
[rtsp @ 0x7f9340000b40] hello state=0
[rtsp @ 0x7f9340000b40] Sending:
PLAY <url> RTSP/1.0
Range: npt=0.000-
CSeq: 6
User-Agent: Lavf57.71.100
Session: 84677e4bd8a3cbdea0ef549c605e486b
...

but then at the end, only this appears:
rtsp @ 0x7f9340000b40] line=''
     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0
and nothing is captured or displayed, no stream is detected.


tcpdump shows that udp traffic comes to <dstip>:21498, and it's 
interesting that ffplay works directly on it:
ffplay udp://0.0.0.0:24198
shows the stream, and reports:
...
[NULL @ 0x7f4b68000b40] Opening 'udp://0.0.0.0:30432' for reading
[udp @ 0x7f4b68001480] No default whitelist set
[udp @ 0x7f4b68001480] end receive buffer size reported is 131072
     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0 
^MProbing mp3 score:1 size:2048
Probing mpegts score:47 size:2048
[mpegts @ 0x7f4b68000b40] Format mpegts probed with size=2048 and score=47
score: 7, dvhs_score: 0, fec_score: 0
[mpegts @ 0x7f4b68000b40] Filter: pid=0x11 type=1
[mpegts @ 0x7f4b68000b40] Filter: pid=0x0 type=1
[mpegts @ 0x7f4b68000b40] PAT:
[mpegts @ 0x7f4b68000b40] sid=0x1 pid=0x77
[mpegts @ 0x7f4b68000b40] new_program: id=0x0001
[mpegts @ 0x7f4b68000b40] Filter: pid=0x77 type=1
     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0 
^M[mpegts @ 0x7f4b68000b40] PMT: len 70
[mpegts @ 0x7f4b68000b40] sid=0x1 sec_num=0/0 version=1 tid=2
[mpegts @ 0x7f4b68000b40] pcr_pid=0x75
[mpegts @ 0x7f4b68000b40] program tag: 0x0b len=2
[mpegts @ 0x7f4b68000b40] program tag: 0x0e len=3
....

I am not sure if it is a bug in ffmpeg or not. Any clues?

The version I use:
ffplay version 3.3.5 Copyright (c) 2003-2017 the FFmpeg developers
   built with gcc 6.4.0 (Gentoo 6.4.0 p1.0)
   configuration: --prefix=/usr --libdir=/usr/lib64 
--shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-3.3.5/html 
--mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc 
--cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar 
--optflags='-O2 -pipe' --disable-static --enable-avfilter 
--enable-avresample --disable-stripping --enable-nonfree 
--enable-version3 --enable-version3 --disable-indev=oss 
--disable-outdev=oss --enable-version3 --enable-version3 
--enable-nonfree --enable-bzlib --enable-runtime-cpudetect 
--disable-debug --enable-gcrypt --enable-gnutls --enable-gmp 
--enable-gpl --enable-hardcoded-tables --enable-iconv --enable-lzma 
--enable-network --enable-openssl --enable-postproc 
--enable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi 
--enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm 
--enable-libxcb-xfixes --enable-zlib --enable-libcdio 
--enable-libiec61883 --enable-libdc1394 --enable-libcaca --enable-openal 
--enable-opengl --enable-libv4l2 --enable-libpulse 
--enable-libopencore-amrwb --enable-libopencore-amrnb 
--enable-libfdk-aac --enable-libopenjpeg --enable-libbluray 
--enable-libcelt --enable-libgme --enable-libgsm --disable-mmal 
--enable-libmodplug --enable-libopus --enable-libilbc --enable-librtmp 
--enable-libssh --enable-libschroedinger --enable-libspeex 
--enable-libvorbis --enable-libvpx --enable-libzvbi --enable-libbs2b 
--enable-chromaprint --enable-libflite --enable-frei0r 
--enable-libfribidi --enable-fontconfig --enable-ladspa --enable-libass 
--enable-libfreetype --enable-librubberband --disable-netcdf 
--disable-libzmq --enable-libzimg --enable-libsoxr --enable-pthreads 
--enable-libvo-amrwbenc --enable-libmp3lame --enable-libkvazaar 
--enable-nvenc --enable-libopenh264 --enable-libsnappy 
--enable-libtheora --enable-libtwolame --enable-libwavpack 
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid 
--disable-amd3dnow --disable-amd3dnowext --disable-aesni --disable-avx 
--disable-avx2 --disable-fma3 --disable-fma4 --disable-ssse3 
--disable-sse4 --disable-sse42 --disable-xop --disable-doc 
--disable-htmlpages --enable-manpages
   libavutil      55. 58.100 / 55. 58.100
   libavcodec     57. 89.100 / 57. 89.100
   libavformat    57. 71.100 / 57. 71.100
   libavdevice    57.  6.100 / 57.  6.100
   libavfilter     6. 82.100 /  6. 82.100
   libavresample   3.  5.  0 /  3.  5.  0
   libswscale      4.  6.100 /  4.  6.100
   libswresample   2.  7.100 /  2.  7.100
   libpostproc    54.  5.100 / 54.  5.100

Best regards,
Andrej

-- 
_____________________________________________________________
    prof. dr. Andrej Filipcic,   E-mail: Andrej.Filipcic at ijs.si
    Department of Experimental High Energy Physics - F9
    Jozef Stefan Institute, Jamova 39, P.o.Box 3000
    SI-1001 Ljubljana, Slovenia
    Tel.: +386-1-477-3674    Fax: +386-1-477-3166
-------------------------------------------------------------



More information about the ffmpeg-user mailing list