Play recorded videos via RTSP

iaf

n3wb
Joined
May 21, 2014
Messages
2
Reaction score
0
Hi All,

I've recently bought a DS-2CD2012-I cam. I've set it up to record to NAS, and now I'm looking for a nice way to play back those recordings under Linux. Unfortunately, the playback function requires a Windows-only browser plugin. So, after some investigation I found out that the rtsp streamer in my cam accepts URLs of the following kind: rtsp://cam:554/Streaming/tracks/N?starttime=T1&endtime=T2, where N is a number in range 1-8 and T1, T2 must be supplied as yyyy-mm-ddThh:mm:ssZ. Either starttime or endtime can be omitted, or both of them. Now, this feature would be great... if it worked. Unfortunately, whatever times I put in there, playback always starts from the first video ever recorded. Judging by the logs, the cam finds the right video(s) at first, but right before initiating the stream, it looses both timestams and uses defaults, which are "very long ago" and "very far in the future". To me this looks like either a bug, or a feature not yet completely implemented. I've tried writing to Hikvision support, but got no answer so far.

So, what interests me is this: has anybody had any luck with playback and rtsp, possibly with other cams? Is there another way to play back recorded videos under Linux in a convenient way (I can only think of writing software to extract them from the data on NAS)?
 

johntan

n3wb
Joined
Dec 17, 2014
Messages
1
Reaction score
0
Hi All,

I've recently bought a DS-2CD2012-I cam. I've set it up to record to NAS, and now I'm looking for a nice way to play back those recordings under Linux. Unfortunately, the playback function requires a Windows-only browser plugin. So, after some investigation I found out that the rtsp streamer in my cam accepts URLs of the following kind: rtsp://cam:554/Streaming/tracks/N?starttime=T1&endtime=T2, where N is a number in range 1-8 and T1, T2 must be supplied as yyyy-mm-ddThh:mm:ssZ. Either starttime or endtime can be omitted, or both of them. Now, this feature would be great... if it worked. Unfortunately, whatever times I put in there, playback always starts from the first video ever recorded. Judging by the logs, the cam finds the right video(s) at first, but right before initiating the stream, it looses both timestams and uses defaults, which are "very long ago" and "very far in the future". To me this looks like either a bug, or a feature not yet completely implemented. I've tried writing to Hikvision support, but got no answer so far.

So, what interests me is this: has anybody had any luck with playback and rtsp, possibly with other cams? Is there another way to play back recorded videos under Linux in a convenient way (I can only think of writing software to extract them from the data on NAS)?
Hi, I am encountering this issue as well. Have you gotten a solution already? Thanks.
 

iaf

n3wb
Joined
May 21, 2014
Messages
2
Reaction score
0
Hi, I haven't, and stopped trying around the time of posting. It really looks like an abandoned feature to me. I don't think my firmware is the latest one currently, they may have made it work already.

I decided to do it differently: extract videos directly from NAS. You need to know the structure of the cam's index files to do it. I figured it out partially myself. There is a post by a person doing the same thing, that had a lot of fields figured out as well, that helped me here http://www.cctvforum.com/viewtopic.php?f=19&t=39874 I've written a python script that runs through the data files and cuts out recorded videos, you can find it here https://github.com/iafilatov/hikstract It also converts videos using other codecs, which work better for web for example.
 

gotar

n3wb
Joined
Jan 4, 2015
Messages
1
Reaction score
0
This issue was an effect of a glitch in a state machine of Hikvision RTSP server (unauthorized command is breaking SETUP), preventing live555 RTSP library (used in mplayer and VLC) from working well. Fortunatelly I've managed to improve live555 authentication handling and since version 2014.11.01 it plays such recordings, so all you need to do is update your systems (or use different client implementation, like the one in ffmpeg).
 

Adkhik

n3wb
Joined
Dec 26, 2014
Messages
12
Reaction score
0
@gotar - is there a specific version of VLC that will work?
 
Last edited by a moderator:
Joined
Apr 16, 2018
Messages
1
Reaction score
0
Still don't working, but you can set de packet time to, for exemple, 5 minutes. In this case every after every 5 minutes the file will be separated in a new file and when you playback, will stop playing at this break.
 
Top