Opened 8 years ago

Last modified 8 years ago

#5970 new defect

No valid multicast port obtained from RTSP

Reported by: ioeir2 Owned by:
Priority: important Component: undetermined
Version: unspecified Keywords: rtsp crash
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Cannot get multicast RTSP stream from camera via ffmpeg/ffplay. ffmpeg/ffplay tries to connect to UDP port 0 instead of 40000.

It sends in SETUP:
Transport: RTP/AVP/UDP;multicast
But should something like
Transport: RTP/AVP;multicast;destination=224.1.2.4;port=40000-40001

How to reproduce:
IP camera: Amcrest IPM-HX1, sw. version 2.420.AC00.15.R, build : 2016-09-08. Very popular at the moment IP camera.

./ffplay-3.2 -rtsp_transport udp_multicast 'rtsp://admin:password@10.0.1.20/cam/realmonitor?channel=1&subtype=0&proto=Dahua3&unicast=false'
ffplay version 3.2 Copyright (c) 2003-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: 
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
[udp @ 0x7fb20bc9d500] bind failed: Permission denied    0B f=0/0   
[udp @ 0x7fb20bc9b1a0] bind failed: Permission denied
[udp @ 0x7fb20bc9b220] bind failed: Permission denied
Segmentation fault: 11

Attachments (3)

browser_rtsp_port_multicat_success.pcapng (234.1 KB ) - added by ioeir2 8 years ago.
ffplay_rtsp_port_multicast_failed.pcapng (5.1 KB ) - added by ioeir2 8 years ago.
RTSP stream via ffplay
amcrest_hx1_multicast_settings.png (347.8 KB ) - added by ioeir2 8 years ago.
Amcrest IPM-HX1 multicast settings

Download all attachments as: .zip

Change History (12)

by ioeir2, 8 years ago

RTSP stream via ffplay

by ioeir2, 8 years ago

Amcrest IPM-HX1 multicast settings

comment:1 by ioeir2, 8 years ago

Keywords: rtsp multicast added

comment:2 by Carl Eugen Hoyos, 8 years ago

Keywords: crash added; multicast removed
Priority: normalimportant

Is the issue reproducible with current FFmpeg?
Please provide backtrace, disassembly and register dump as explained on https://ffmpeg.org/bugreports.html

comment:3 by ioeir2, 8 years ago

Yes, the issue is reproducible on the latest master ffmpeg.

The problem is that ffmpeg/ffplay incorrectly obtains port for udp multicast from SDP. Actually it cannot obtain it all and uses port 0, which causes the crash.

comment:4 by ioeir2, 8 years ago

Yes, the issue is reproducible on the latest master ffmpeg.
The problem is that ffmpeg/ffplay incorrectly obtains port for udp multicast from SDP. Actually it cannot obtain it all and uses port 0, which causes the crash.

comment:5 by Carl Eugen Hoyos, 8 years ago

Please provide backtrace, disassembly and register dump as explained on https://ffmpeg.org/bugreports.html

comment:6 by ioeir2, 8 years ago

I was not able to make gdb debugging on Mac OS Sierra due to some gdb signing issues.

I recompiled ffplay on Ubuntu and reproduced the problem. Crash happens only if the ffplay is running as regular user. There is no crash if it is running via sudo.

(gdb) run
Starting program: /home/alex/1/ffplay_g -rtsp_transport udp_multicast rtsp://admin:password@10.0.1.150/cam/realmonitor\?channel=1\&subtype=0\&proto=Dahua3\&unicast=false
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
ffplay version N-82572-gac206bb Copyright (c) 2003-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: 
  libavutil      55. 40.100 / 55. 40.100
  libavcodec     57. 66.105 / 57. 66.105
  libavformat    57. 58.100 / 57. 58.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 67.100 /  6. 67.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
[New Thread 0x7ffff0f96700 (LWP 21439)]
[New Thread 0x7fffeef91700 (LWP 21440)]
[New Thread 0x7fffee790700 (LWP 21441)]
[Thread 0x7fffeef91700 (LWP 21440) exited]
[New Thread 0x7fffeef91700 (LWP 21442)]
[New Thread 0x7fffee10c700 (LWP 21443)]
[udp @ 0x7fffd0003520] bind failed: Permission denied    0B f=0/0   
[udp @ 0x7fffd00293c0] bind failed: Permission denied
[udp @ 0x7fffd00395c0] bind failed: Permission denied

Thread 6 "read_thread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee10c700 (LWP 21443)]
ffurl_get_file_handle (h=0x0) at libavformat/avio.c:628
628	    if (!h->prot->url_get_file_handle)

(gdb) info frame
Stack level 0, frame at 0x7fffee103f40:
 rip = 0x6eb8b0 in ffurl_get_file_handle (libavformat/avio.c:628); saved rip = 0x694df4
 called by frame at 0x7fffee1050e0
 source language c.
 Arglist at 0x7fffee103f30, args: h=0x0
 Locals at 0x7fffee103f30, Previous frame's sp is 0x7fffee103f40
 Saved registers:
  rip at 0x7fffee103f38

Version 1, edited 8 years ago by ioeir2 (previous) (next) (diff)

comment:7 by Carl Eugen Hoyos, 8 years ago

Does lldb not work?

Last edited 8 years ago by Carl Eugen Hoyos (previous) (diff)

in reply to:  6 comment:8 by Carl Eugen Hoyos, 8 years ago

Replying to ioeir2:

I recompiled ffplay on Ubuntu and reproduced the problem. Crash happens only if the ffplay is running as regular user. There is no crash if it is running via sudo.

The issue is only reproducible with ffplay, not with ffmpeg?

comment:9 by ioeir2, 8 years ago

lldb works - my fault.

ffmpeg crashing as well.

Note: See TracTickets for help on using tickets.