Streaming and playback HTTP
AnsweredNx Witness Version: 4.2.0.32840, Windows
When using Nx, the playback does not have timestamp enabled for HTTP stream? How can it be enabled?
What is the streaming parameter sfd (Stand Frame Duration) function?
What are the ways to activate Recording beside using Scheduling function?
Rewind/Fast Forward function on playback is available on Nx Witness from -16X up to 16X speed. Is this feature found in the Nx REST API?
-
Hello,
When using Nx, the playback does not have timestamp enabled for HTTP stream? How can it be enabled?
Please, use "mp4" or "mkv" formats to receive a stream with timestamps.
What is the streaming parameter sfd (Stand Frame Duration) function?
This parameter been set, prevents receiving a stream faster than real time.
Rewind/Fast Forward function on playback is available on Nx Witness from -16X up to 16X speed. Is this feature found in the Nx REST API?
This function is implemented in the Nx Witness, by buffering and requesting the server with faster pace. The Server is capable providing a video stream as fast as an application sends requests. The sfd parameter should be set to false.
What are the ways to activate Recording beside using Scheduling function?
You can do it via the /rest/v1/devices/{id} API. The parameter is called "schedule".
For greater details, see API documentation in the web-interface of the Server.
-
Hello Andrey,
For HTTP playback videos, I have tried the suggested mkv and mp4 formats but were not successful compared to using webm format (no running timestamp).
1. What is the correct url format to obtain the timestamp on the video?
https://<serverid>:<port>/media/<cameraid>.mkv Url request is downloading a file for a long time without streaming
https://<serverid>:<port>/media/<cameraid>.mp4 Url is not streaming video2. For downloaded files, will the timestamp be available for certain formats only?
https://<serverid>:<port>/hls/<cameraid>.mkv?pos="time"3. Rewind/Fast Forward function on playback is available on Nx Witness from -16X up to 16X speed. Is this feature found in the Nx REST API?
Will the HTTP streaming API have the feature Rewind/Fast Forward(0.5-2.0) / slower speed similar to RSTP protocol?
-
Hello,
1. What is the correct url format to obtain the timestamp on the video?
You have just mentioned it
https://<serverid>:<port>/media/<cameraid>.mkv Url request is downloading a file for a long time without streaming
https://<serverid>:<port>/media/<cameraid>.mp4 Url is not streaming videoBoth above appear as a very long "files", being downloaded for as long as your application needs.
For example, you can open the URLs like that in VLC player.
As I described above, the Server tries to send data as fast as your application requests it. That means, your application could read data from the url at any rate you need. Timestamps are stored inside these "files", it's up to your application to parse the file format and extract corresponding fields.
2. For downloaded files, will the timestamp be available for certain formats only?
That's correct. Timestamps are provided in two formats: mkv and mp4.
Will the HTTP streaming API have the feature Rewind/Fast Forward(0.5-2.0) / slower speed similar to RSTP protocol?
I'm afraid no. Rewind/Fast Forward features are not about the API, rather about the client application.
The Server is capable of providing a video stream as fast as an application requests. The sfd parameter should be set to false. That means your application could send requests frequently enough to display afterwards buffered data at any rate you need: 16X, 8X, 4X, 0.5. Nx Witness application functions exactly this way.
-
Hello Andrey,
The mp4 format (https://<serverid>:<port>/media/<cameraid>.mp4) is not streaming any data.
Only the local long file "mkv" format is playing successfully in VLC without the timestamp.
1. The video is lagging by about 1-2 minutes although the sfd flag is set to false.
2. Is the running Timestamp available as metadata from inside this "long" downloading file? How can it be read out and overlay on the stream?
3. The long file will grow in size in the native filesystem. From your description, to collect the timestamp data, a certain amount of disk space will need to be reserved to keep the "long" files before being read by "VLC code" compared to actual streaming without diskspace reservation using webm format.
4. What is the Nx Witness buffering algorithm for the Speed control (16X, 8X, 4X, 0.5) to work?
5. Is the Meta SDK another method to retrieve the timestamp and streaming? What is the difference with using the HTTP method?
-
Hi,
The mp4 format (https://<serverid>:<port>/media/<cameraid>.mp4) is not streaming any data.
Can't confirm. I have just tested. Works fine.
Could you please provide a screencast demonstrating what operations you perform?
Here are several things I encourage you to pay attention to.1. Make sure you provide credentials in URL when trying to open a stream in VLC.
https://<username>:<password>@<serverid>:<port>/media/<cameraid>.mp4
2. You are using 4.2.0.32840. Try to update to the latest patch for 4.2 or to the version 5.0.0.35270
3. In version 5.0, in order to open a stream in VLC, you need an account with digest authorization enabled to request video via API.
1. The video is lagging by about 1-2 minutes although the sfd flag is set to false.
Could you please provide step by step description of what are you doing, including URL and parameters? A screencast would be the best option.
2. Is the running Timestamp available as metadata from inside this "long" downloading file? How can it be read out and overlay on the stream?
I'm really sorry. I've misled you. It's my bad. I've just rechecked with our devs, and it's appeared that at the moment, the only media interface providing timestamps is RTSP.
4. What is the Nx Witness buffering algorithm for the Speed control (16X, 8X, 4X, 0.5) to work?
As I was told, there is no special buffering. The Server uses blocking socket, which block when the send buffer is full, until the Nx Desktop reads all the data from the socket.
For more details on how Nx Desktop controls display speed, you could have a look at the source code available in our repo https://github.com/networkoptix/nx_open
See the speed_slider.cpp and cam_display.cpp files.5. Is the Meta SDK another method to retrieve the timestamp and streaming? What is the difference with using the HTTP method?
Metadata SDK is supposed to be used for frame processing for certain objective: object detection, face recognition, plate recognition etc.
We've been communicating for quite a time regarding the technical questions.
Could you shed a light on your objective, please? What would the final result?
We could find the proper solution.
Please sign in to leave a comment.
Comments
5 comments