Recording a IP Camera

Dev Ipset

New Member
Hey.

Firstly I would like to know if is possible to record a stream, an IP camera for example, using the Web Call Server 5 in MP4 files or playback in HLS like a DVR.
And my second question is: Is Web Call Server 5 compatible with which camera models? I am trying test Embed Player resource with one Brickcom OB-300Np Start and I received the message "Failed".

Thank in advance and Best Regards.
 

Max

Administrator
Staff member
Firstly I would like to know if is possible to record a stream, an IP camera for example, using the Web Call Server 5 in MP4
Let us check if recording works. It is young feature.
playback in HLS like a DVR
DVR is not currently supported.
And my second question is: Is Web Call Server 5 compatible with which camera models?
The cam should support:
  • RTSP
  • H.264 video codec
  • AAC or G.711 audio codec
Please check your cam specification.
If you have a public cam, please send RTSP url to logs@flashphoner.com, we will test playback with your IP cam.
 

Dev Ipset

New Member
Hey Max!

Thank you for quick reply. I took a print screen of the VLC about the camera informations. Its follows attached. Only audio is disable.

I wait for news and maybe a tutorial on the recording feature that you are checking.

Best Regards.
 

Attachments

Last edited:

Max

Administrator
Staff member
Hello,

The screenshot does not provide enough information. For example, VLC displays similar codec information for this stream, which can be played successfully
Code:
rtsp://b1.dnsdojo.com:1935/live/sys1.stream
Please, send to logs@flashphoner.com either the RTSP URL, or, if it is not public,
- server log
Code:
WCS_HOME/logs/server_logs/flashphoner.log
- network traffic dump
Code:
tcpdump -s 4096 -w log.pcap
 

Max

Administrator
Staff member
Hello
We have checked your IP cam. It does not support RTCP.
You have to add this setting to WCS_HOME/conf/flashphoner.properties
Code:
rtp_force_synchronization =true
And restart WCS
Code:
service webcallserver restart
 

Attachments

Dev Ipset

New Member
Hey Max,

Thank you very much. It worked like a charm.

And about the recording feature do you have any news?

Thanks again and I apologize for any inconvenience.
 

Max

Administrator
Staff member
Hello,

Currently, recording is working for RTSP streams without audio. So, with last server version it can be tried with your stream.
To enable the feature, add this setting to WCS_HOME/conf/flashphoner.properties
Code:
record_rtsp_streams=true
Restart WCS to apply the configuration change
Code:
service webcallserver restart
For RTSP streams, recording is completed after corresponding RTSP agent is terminated. By default, RTSP agent is terminated if it has no subscribers for one minute.
The default one minute activity timeout can be changed using these settings in flashphoner.properties
Code:
rtsp_activity_timer_cool_off_period=1
rtsp_activity_timer_timeout=60000
RTSP agent will be terminated after {rtsp_activity_timer_cool_off_period * rtsp_activity_timer_timeout} milliseconds since last subscriber activity for the corresponding RTSP stream. rtsp_activity_timer_timeout is in milliseconds, and rtsp_activity_timer_cool_off_period is a multiplier.
Also, REST requests can be used for starting up and terminating RTSP agents.
 

Dev Ipset

New Member
If I have understood correctly the recording only performed when someone is viewing and after one minute later terminate this view? Is there no continuous recording?

And where are MP4 files salve? I found a symbolic link in WCS_HOME/client/, but I didn't find it.
 

Max

Administrator
Staff member
recording only performed when someone is viewing
Recording is performed for as long as RTSP agent exists. RTSP agent is created when a first viewer starts playing the stream, or it can be created without any viewers using REST request, e.g.
Code:
http://host:9091/rest-api/rtsp/startup
{
  "uri": "rtsp://b1.dnsdojo.com:1935/live/sys1.stream"
}
after one minute later terminate this view
If RTSP stream has no viewers, its agent is terminated after a timeout which is one minute by default. The timeout can be increased, e.g. with these settings added to flashphoner.properties it will be 24 hours
Code:
rtsp_activity_timer_cool_off_period=24
rtsp_activity_timer_timeout=3600000
Records are saved to WCS_HOME/records.
 

Dev Ipset

New Member
Thank you Max. Just one more question. Can I fragment the MP4 file by time? For example every ten minutes generate a file?
 

Max

Administrator
Staff member
fragment the MP4 file by time...every ten minutes
Yes, add to flashphoner.properties this setting
Code:
record_rotation=600
It is in seconds.
Or rotation can be by file size in Megabytes, e.g.
Code:
record_rotation=10M
Files will be named stream-*_1.mp4, stream-*_2.mp4 etc.
 

Dev Ipset

New Member
I tried but when I add this two properties the application crashes. Appears the message "Disconnect" and when I try refresh the page is shown the attached (Adding_TemplateName_Error.jpg). Already the REST request to startup stream returns error 500 can be seen in attached "Rest_Request_Error.png". Do API have to be activated?
 

Attachments

Max

Administrator
Staff member
There is a server-side issue when {streamName} is used in stream_record_policy_template with RTSP streams - will inform when it is fixed. Meanwhile, please use a template without {streamName}, e.g.
Code:
stream_record_policy_template={startTime}
Other available template parts: {sessionId}, {mediaSessionId}, {login}, {audioCodec}, {videoCodec}.
Appears the message "Disconnect" and when I try refresh the page is shown the attached (Adding_TemplateName_Error.jpg)
Server process stopped, and the server has to be restarted.
To see if the server is running, this command can be used
Code:
ps aux | grep java
It should display two processes.
 

Dev Ipset

New Member
Thank you Max. This change worked.

And about the REST API under which circumstances the error 500 is returned when starting a stream (rest-api/rtsp/startup)?
 

Max

Administrator
Staff member
error 500 is returned when starting a stream (rest-api/rtsp/startup)
Whenever server error occurs. There will be error with message "RtspAgent <RTSP URI> already exist" if RTSP agent for the URI does already exist (rest-api/rtsp/find_all can be used to find all existing agents).
"RtspAgent null already exist" as on the screenshot could occur e.g. if after a successful request with "uri" parameter there was another startup request without "uri" (just {}).
 

Dev Ipset

New Member
Thank you again Max. Just to report when start recordings I noticed that the first segment recorded it seems to be corrupted while the others play normally. I tried to start again a few times and always the first crashes.
 

Max

Administrator
Staff member
Hello,

the first segment recorded it seems to be corrupted
Could you please clarify – when record rotation is turned on, the first file is corrupted and cannot be played? Such issue has not been reproduced with first file but it may occur with RTSP recordings.
 

Dev Ipset

New Member
Yes, when record rotation is turned on the first ten minutes of recording (older MP4 file) seems corrupted, i.e, don't play on players. I'm recording a RTSP and maybe it's a coincidence so the first crashes.
 
Top