0

I'm trying to export recordings from a NVT to a file (.mp4) using the Onvif protocol.

Onvif relies in RTSP streams to access live video and recordings.

Saving live video can be done with ffmpeg and it also works great

ffmpeg -rtsp_transport tcp -i 'rtsp://10.0.0.210:554/cam/liveUrl' -c copy file.mp4

But when accessing Onvif recordings I must define the initial absolute dateTime (and final if needed) to be sent to the rtsp server. The info needs to be sent in the PLAY request as the Range: clock value. Another useful setting is the scale, that allows to receive the video faster than realtime (useful for downloading)

Sample request using "openRTSP to get the stream

PLAY rtsp://10.0.0.1/streamURl/ RTSP/1.0
CSeq: 7
Authorization: Digest ************** 
User-Agent: ./openRTSP (LIVE555 Streaming Media v2023.06.20)
Session: 4001414593142
Scale: 2.000000
Range: clock=20230710T180001Z-20230710T180201Z

OpenRTSP supports setting those values as parameter, but it lacks support for h265. So I must use ffmpeg to "fix" the exported files and merge the audio and video streams ffmpeg -i file_renamed_to.265 -i audio_file -c copy out.mp4

I would like to bypass openRTSP and use ffmpeg directly. Is it possible to set the "clock range" and the "scale" as ffmpeg args?

0

You must log in to answer this question.

Browse other questions tagged .