[MPlayer-users] Set a custom Header in RTSP stream

Hector Blanco white.lists at gmail.com
Tue May 13 00:38:31 CEST 2014

I am trying to play a chunk of video retrieved from an Axis
M3004V<http://www.axis.com/products/cam_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:

      Headerfield1: val1<CRLF>
      Range: clock=20140505T000100Z-20140505T000200Z<CRLF>

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

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

mplayer \
       -http-header-fields "Range:clock=20140505T000100Z-20140505T000200Z\n"
       -msglevel all=9 \
       -nosound \
user:pass at

But with this, the video plays, but from the beginning, and it doesn't stop
after one minute.

Am I doing something wrong? The option says http-header, not rtsp-header...
Maybe is that? Is there a way of passing that header to the RTSP

Thank you in advance.

PS: I do see a "range" option (or header) in the debug output by mplayer,
but is just telling the camera to play the video from the beginning (is the
npt=0.000 part):

[rtsp @ 0x7f070ccdc600]SDP:
o=- 1399932168102657 1399932168102657 IN IP4
s=Media Presentation
t=0 0
user:pass at
m=video 0 RTP/AVP 96
c=IN IP4

More information about the MPlayer-users mailing list