1

I am trying to play a chunk of video retrieved from an Axis M3004V camera. The camera is continuously recording video in an internal MicroSD card. That video receives a recordingid I can use to query. According to what it says on the Axis API documentation (on the Edge Storage and the Video Streaming Vapix documents) I can specify an start time and end time for the play through a custom header in the request. Let's say that video has been recording from 2014-05-01T00:00:00Z until... meh... now.

Apparently, if I were able to send an RTSP request with:

rtps://camera_ip/axis-media/media.amp?<parameter>=<value>
Headerfield1: val1<CRLF>
Range: clock=2014-05-01T00:01:00Z-2014-05-01T00:01:30Z<CRLF>

I would get a 1 minute play from 00:00:01 to 00:00:02.

I'm trying to set that custom header using avplay like this:

avplay -f rtsp -rtsp_transport http \
       -i "rtsp://user:[email protected]/axis-media/media.amp?recordingid=20140505_000000_5E99_00408CAABBCC"
       -headers "\nRange: clock=2014-05-01T00:01:00Z-2014-05-01T00:01:30Z\n" \
       -loglevel debug

But when I try that, I get an Option headers not found error:

[rtsp @ 0x7f4cb4005be0] video codec set to: h264
[NULL @ 0x7f4cb4004e20] RTP Packetization Mode: 1
[NULL @ 0x7f4cb4004e20] RTP Profile IDC: 4d Profile IOP: 40 Level: 29
[NULL @ 0x7f4cb4004e20] Extradata set to 0x7f4cb40014e0 (size: 29)!
[rtsp @ 0x7f4cb4005be0] hello state=0
Option headers not found.

And avplay stops.

I haven't been able to find any example on the web, but I'd say that the option to pass custom headers to an RTSP stream was added to LibAv long time ago (at least, according to this commit from 2011 ) Maybe I'm not passing the argument properly? I have tried several variations to the line above, such as removing the -f rtsp part, change the -rtsp_transport to tcp instead of http, reorganizing the order of my arguments.... Nothing worked. Nothing even produced a different error message.

Does anyone know how to pass custom headers to an RTSP request using libav?

I'm on a Lubuntu 14.04 (amd64) and avplay is version 9.11-6:9.11-2ubuntu2

Any help will be very appreciated. Thank you in advance.

0

You must log in to answer this question.

Browse other questions tagged .