[FFmpeg-user] sending RTSP/RTP onvif data stream to file

Tom Hodder tom at limepepper.co.uk
Wed Nov 29 13:21:45 EET 2017


Hi,

I have several IP Cameras that stream RTSP video, but also provide Motion
detects events as a metadata stream.  I'd like to capture that txt to a
file, however I don't seem to be able to find a combination of of codecs
that outputs the xml (though I can see the xml data in the dump hex output
of ffmpeg)

Any suggestions on whether this is possible?

Thanks,
Tom


I can dump the data from the RTP "data" stream, and see the xml events -
but nothing is saved to the output file;

ffmpeg -loglevel verbose -hide_banner -t 10  -dump -hex
-allowed_media_types data    -i  'rtsp://
192.168.0.32:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif'
  -map 0:d -f data -c copy out.dat  -y
...

stream #0:  0kB time=00:00:00.00 bitrate=N/A speed=   0x
 keyframe=0
 duration=0.000
 dts=0.000  pts=0.000
 size=1086
00000000  3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 <?xml version="1
00000010  2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74 .0" encoding="ut
00000020  66 2d 38 22 20 73 74 61 6e 64 61 6c 6f 6e 65 3d f-8" standalone=
00000030  22 79 65 73 22 20 3f 3e 3c 74 74 3a 4d 65 74 61 "yes" ?><tt:Meta
00000040  44 61 74 61 53 74 72 65 61 6d 20 78 6d 6c 6e 73 DataStream xmlns
00000050  3a 74 74 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e :tt="http://www.
00000060  6f 6e 76 69 66 2e 6f 72 67 2f 76 65 72 31 30 2f onvif.org/ver10/
00000070  73 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a 77 73 schema" xmlns:ws


The metadata info in the SDP data;

v=0
o=- 2251997230 2251997230 IN IP4 0.0.0.0
s=RTSP Session/2.0
c=IN IP4 0.0.0.0
t=0 0
a=control:*
a=range:npt=now-
a=packetization-supported:DH
m=video 0 RTP/AVP 96
a=control:trackID=0
a=framerate:1.000000
a=rtpmap:96 H264/90000
a=fmtp:96
packetization-mode=1;profile-level-id=4D0029;sprop-parameter-sets=Z00AKZpmA8ARPy4C1AQEBQAAAwPoAAAH0IQ=,aO48gA==
a=recvonly
m=application 0 RTP/AVP 107
a=control:trackID=1
a=rtpmap:107 vnd.onvif.metadata/90000     <<<<<< ONVIF METADATA
a=recvonly


Probing the data shows that the 2 streams are detected;


ffprobe  -hide_banner -show_format    'rtsp://
92.168.0.32:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
'
Input #0, rtsp, from 'rtsp://
192.168.0.32:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
':
  Metadata:
    title           : RTSP Session/2.0
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
1920x1080 [SAR 1:1 DAR 16:9], 50 tbr, 90k tbn, 90k tbc
    Stream #0:1: Data: none
Unsupported codec with id 0 for input stream 1
[FORMAT]
filename=rtsp://
192.168.0.32:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
nb_streams=2
nb_programs=0
format_name=rtsp
format_long_name=RTSP input
start_time=0.000000
duration=N/A
size=N/A
bit_rate=N/A
probe_score=100
TAG:title=RTSP Session/2.0
[/FORMAT]


More information about the ffmpeg-user mailing list