[Libav-user] Passing Range header in RTSP PLAY

Richard Lince richard.lince at bluebox.video
Sat May 30 13:02:38 EEST 2020

Hi Sebastian,

This is something that is missing in ffmpeg, if i recall correctly the 
issue is that the seek_timestamp must be an int and devisable by 
AV_TIME_BASE within rtspdec.c.
Anyhow, what is really needed is an external text string option for the 
RTSP "Range:..." field, users can then do external calculations and 
populate this header themselves as text.
All VMS systems differ in what they expect in the range header and none 
in my opinion play by the RFC2326 rules completely, an external text 
string gives you options.

For us, we had to modify rtspdec.c in a few places to accommodate this 
functionality, setting the 'AVFormatContext->opaque' field to non null 
points to our external range generated sting.
See rtspdec->rtsp_read_play(AVFormatContext *s)

We then build our modified version of libavformat.dll

FYI, whilst we were in rtspdec we also allowed multiple PLAY commands to 
be sent without the PAUSE/PLAY as an optimization option.


On 28/05/2020 23:18, Demers, Sebastien wrote:
> Hi All,
> I'm using ffmpeg to stream from our video server live stream (Genetec Security Center 5.9.1). It is recording as well the video feed.
> To playback such recorded video, following the RTSP (https://www.ietf.org/rfc/rfc2326.txt),  I need to add a "Range" header to the PLAY request.
> Example:
>       Range: clock=19960213T143205Z-;time=19970123T143720Z
> Anyone know how to pass this argument even from the ffmpeg command line?  I try the "-headers" argument, but that seem to be for the http request header.
> I'm able to pass it some time with java/JavaCpp code like:
>      int ret = av_seek_frame(_fmtCtx, -1, timestamp, AVSEEK_FLAG_BACKWARD);
> Without range, the stream start 5 minutes ago, so with the timestamp I can move forward within the 5 minutes to now range.
> For my scenario, that seek is not what is required.  I want to open the stream at a specific date/time, of lets say noon yesterday.
> Thanks in advance,
> S├ębastien
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".

Best Regards,
Richard Lince,
Owner and Founder

bluebox.video <https://www.bluebox.video>
Skype: richard.lince77

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200530/4ec190a6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_email.png
Type: image/png
Size: 6840 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200530/4ec190a6/attachment.png>

More information about the Libav-user mailing list