Opened 2 years ago

Last modified 18 months ago

#9729 new defect

ffprobe hangs if no RTP input data; timeout ignored

Reported by: Danny Owned by:
Priority: normal Component: undetermined
Version: 4.4.3 Keywords:
Cc: Danny Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I want to use ffprobe to detect if an RTP stream is present, and if so, identify the stream format and contents.

But if there is no data on the given URL, ffprobe hangs. I've tried both -timeout and -rw_timeout, with no effect. ffprobe hangs.

ffprobe -loglevel debug -rw_timeout 50 rtp://192.168.2.78:7878
ffprobe version 4.4 Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --extra-ldflags='-L/mnt/swdevel/Torque/lib3p64 -L/lib' --extra-cflags='-I/mnt/swdevel/Torque/include -I/include' --disable-static --enable-shared --disable-cuda --disable-cuvid --disable-nvenc --enable-libx264 --enable-gpl --enable-libfreetype --enable-libfontconfig --disable-indev=android_camera --disable-indev=sndio --disable-outdev=sndio --disable-outdev=xv --enable-libv4l2 --enable-vaapi --enable-libmfx --enable-libdrm --enable-indev=alsa --enable-indev=v4l2 --enable-libsoxr --bindir=/mnt/swdevel/Torque/bin64 --datadir=/mnt/swdevel/Torque/ext/ffmpeg-build --docdir=/mnt/swdevel/Torque/ext/doc --libdir=/mnt/swdevel/Torque/lib3p64 --shlibdir=/mnt/swdevel/Torque/lib3p64 --incdir=/mnt/swdevel/Torque/ext/extinclude/ffmpeg --mandir=/mnt/swdevel/Torque/ext/ffmpeg-build64 --enable-libxcoder --disable-doc --enable-x86asm --extra-ldflags='-lm -L/lib64 -ldrm' --enable-pthreads --extra-libs=-lpthread --disable-debug
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[rtp @ 0x2200d00] No default whitelist set
[udp @ 0x2201880] No default whitelist set
[udp @ 0x2201880] end receive buffer size reported is 786432
[udp @ 0x2211dc0] No default whitelist set
[udp @ 0x2211dc0] end receive buffer size reported is 786432
=== HANGS HERE ===

# uname -a
Linux 5.15.26 #2 SMP Tue Mar 8 13:31:54 +08 2022 x86_64 x86_64 x86_64 GNU/Linux

Using "strace" shows the process is stuck in a POLL loop.

# strace -p 4223
strace: Process 4223 attached
restart_syscall(<... resuming interrupted read ...>) = 0
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, 100) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, 100) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, 100) = 0 (Timeout)

Change History (1)

comment:1 by Jebez J, 18 months ago

Could you please try

ffprobe "rtp://192.168.2.78:7878?timeout=50000"


The timeout value is in microseconds.

Note: See TracTickets for help on using tickets.