no sound in recordings

burak guder

Member
There is no sound file in any of the recordings I received.

Camera : H264, AAC

Record Api :

'content' => '{
"mediaSessionId": "'xxxxx-6e89-497e-b717-0469c5448109'",
"config": {
"fileTemplate": "{streamName}-{startTimeMillis}-{endTimeMillis}",
"rotation": "3600"
}
}'


Another question I have is, I want to record the contents with an hourly cycle. What should my rotation value be for this?
 

Max

Administrator
Staff member
Good day.
Please provide us access to the server and RTSP camera using this form, we will check.
Another question I have is, I want to record the contents with an hourly cycle. What should my rotation value be for this?
Rotation value is set in seconds, so 3600 is right value in this case.
 

burak guder

Member
I have forwarded the access information to you.

I want to be checked

1-) there is no sound in the recordings

2-) Even though I set the rotation value to 3600, it still records for 60 seconds


Our live broadcast will continue until 19:00 according to Turkey time. I want no reboots and service interruptions until this time
 

burak guder

Member
When I record using ffmpeg there is sound but all recordings I get by setting it via API or flashphoner.properties have no sound.

ffmpeg -i rtsp://root:S1mulcast2017@xxxxxxxx:555/live2.sdp -c kopya -f mp4 recordtest.mp4
 
Last edited:

burak guder

Member
You did not respond to the problem. We urgently need a registration system. I have forwarded you the necessary information for SSH

There is currently no sound in the recordings.
The script is not triggered at the end of the recording.
No matter what I enter the recording rotation value, it records for 60 seconds.


flashphoner.properties



Code:
#server ip
ip                     =xxxxxxxxx
ip_local               =xxxxxxxxxx

#webrtc ports range
media_port_from        =31001
media_port_to          =35000


#codecs
codecs                   =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip       =mpeg4-generic,flv,mpv
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp  =opus,g729,g722,mpeg4-generic,vp8,mpv

#websocket ports
ws.port                 =9080
wss.port                =9443



rtp_force_synchronization=true
disable_manager_rmi=false
#disable_rest_auth=false
disable_drop_aac_frame=true


rest_access_control_allow_origin=*
rest_access_control_allow_headers=content-type,x-requested-with
rest_access_control_allow_methods=POST

rtp_receive_buffer_size=131072
rtp_send_buffer_size =131072

rtsp_activity_timer_timeout=86400000

rest_max_connections=3000
disable_rest_requests=true
on_record_hook_script=/var/www/html/api/record.sh

http.port=9082
https.port=9444




Rest API :


Code:
$options = array(
                'http' => array(
                    'header' => "Content-type: application/json",
                    'method' => 'POST',
                    'content' => '{
                                    "mediaSessionId": "'xxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxx'",
                                      "config": {
                                        "fileTemplate": "{streamName}-{startTimeMillis}-{endTimeMillis}",
                                        "rotation": "3600"
                                      }
                              }'
                )
            );
 
Last edited:

burak guder

Member
The reason why the rotation value doesn't work is because the service on the crontab runs the "recorder/startup" function every 1 minute. But there is an error in the system here. When a registration request is sent to a system whose registration has been started, it should ignore it, but flashphoner terminates the registration and restarts it.
 

burak guder

Member
I wrote the whole system. and I installed the admin panel, I have no other problems except there is no sound in the videos only. Is it possible for you to deal with the issue urgently?

ffprobe Out camera :


Metadata:
title : RTSP server
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p(progressive), 640x480, 20 tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp
 
Last edited:

Max

Administrator
Staff member
I wrote the whole system. and I installed the admin panel, I have no other problems except there is no sound in the videos only. Is it possible for you to deal with the issue urgently?
Working hours of support engineers: workdays (Mon-Fri), 10:00-20:00 GMT+3.
We checked your server. The RTSP stream which URI you've sent, at the moment of checking contains black screen with silence:
1626059002209.png

1626059024905.png

We started test recording to the file fptest.mp4, then stopped recording and checked audio with ffprobe:
1626059175897.png

Seems like audio is present in recording.
We also checked the rest of RTSP streams published on your server. All of them at the moment of checking contain silence in audio track.
We tested the third party free RTSP stream on your server:
1626059643096.png

1626059658716.png

It is playing with audio, and its recording contains hearable audio too.
We also checked recording hook script. According to your flashphoner.properties file, you're using the defaul script /usr/local/FlashphonerWebCallServer/bin/on_record_hook.sh (because there's no such setting in the file):
1626059901307.png

So we modified default recording hook script like this:
1626059979210.png

And it seems to be working during our tests, strings are added to on_record_hook.log file:
1626060098648.png


So please provide an example of RTSP stream which is recording without audio, which should be available 24/7 with hearable audio.
Also provide an example of recording hook script which does not work. We will check it on your server.
The reason why the rotation value doesn't work is because the service on the crontab runs the "recorder/startup" function every 1 minute. But there is an error in the system here. When a registration request is sent to a system whose registration has been started, it should ignore it, but flashphoner terminates the registration and restarts it.
This is normal behaviour: the new recording REST API query applied to the same stream will finish the previous recording. To prevent this, you should use /recorder/find_all REST API query to check if the stream is already recording.
 

burak guder

Member
We didn't have a live broadcast at the time you did the test, so the audio and video were blank.
but even if there is no broadcast, audio and video continue to be sent. if you check the main stream you can see the audio and video codecs.

I see the audio codec in the recording called fptest.mp4 that you made from the camera.

Code:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'fptest.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2021-07-12T04:48:44.000000Z
  Duration: 00:02:55.90, start: 0.000000, bitrate: 108 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      creation_time   : 2021-07-12T04:48:44.000000Z
      handler_name    : SoundHandler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x480, 3 kb/s, 20.04 fps, 59.94 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2021-07-12T04:48:44.000000Z
      handler_name    : VideoHandler
    Side data:
      displaymatrix: rotation of nan degrees

When I record via web service, the audio codec does not appear.

Code:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'fptest10.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2021-07-12T08:50:02.000000Z
  Duration: 00:05:59.04, start: 0.000000, bitrate: 6 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x480, 3 kb/s, 20.04 fps, 20 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2021-07-12T08:50:02.000000Z
      handler_name    : VideoHandler
    Side data:
      displaymatrix: rotation of nan degrees

When I record via ffmpeg, I can get the audio codec.

the method where i get mediasessionID
Code:
https://xxxxxxxx:9444/rest-api/stream/find



'http' => array(
                'header' => "Content-type: application/json",
                'method' => 'POST',
                'content' => '{
                                    "name": "abcdefR3V",
                                    "published":true
                              }'
            )

return :
Code:
[{"appKey":"defaultApp","sessionId":"rtsp://root:S1mulcast2017@xxxxxxx:555/live2.sdp-8485cb03-c2fa-498d-8064-ff115561ae72","mediaSessionId":"86899f55-f3eb-4e28-ad06-a9cf151a88ab","name":"abcdefR3V","published":true,"hasVideo":true,"hasAudio":true,"status":"PUBLISHING","sdp":"v=0\r\no=RTSP 1625908052 151 IN IP4 0.0.0.0\r\ns=RTSP server\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=charset:Shift_JIS\r\na=range:npt=0-\r\na=control:*\r\na=etag:1234567890\r\nm=video 0 RTP/AVP 98\r\nb=AS:0\r\na=rtpmap:98 H264/90000\r\na=control:trackID=2\r\na=x-onvif-track:trackID=2\r\na=fmtp:98 packetization-mode=1; profile-level-id=4d001f; sprop-parameter-sets=Z00AH9oCgPZA,aO48gA==\r\nm=audio 0 RTP/AVP 97\r\na=control:trackID=5\r\na=x-onvif-track:trackID=5\r\na=rtpmap:97 mpeg4-generic/44100/2\r\na=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1210;SizeLength=13; IndexLength=3; IndexDeltaLength=3; CTSDeltaLength=0; DTSDeltaLength=0; \r\n","audioCodec":"mpeg4-generic","videoCodec":"H264","record":false,"width":640,"height":480,"bitrate":0,"minBitrate":0,"maxBitrate":0,"quality":0,"history":false,"gop":0,"fps":0,"audioBitrate":0,"codecImpl":"","transport":"UDP","cvoExtension":false,"createDate":1625901250645,"mediaType":"pull","audioState":{"muted":false},"videoState":{"muted":false},"mediaProvider":"RTSP"}]

I might be making a mistake on the web service side

please perform the registration test via the web service.


At the moment, I recorded with the API while the camera had sound. but it still did not record the sound. The name of the recorded file is written below
abcdefR3V-1626073802285-1626074042187_28.mp4

The image is dark most of the time, but we set the sound to play 24/7.


NOT: Since our live broadcasts are active between 09:00 and 18:30 according to Turkey time, I request that the current broadcasts not be closed.
 
Last edited:

Max

Administrator
Staff member
This seems like synchronization issue: stream_synchronization parameter in server staistics shows a huge value for all the streams
1626082419953.png

When trying to record the stream with hearable audio, we see in server log:
1626082514773.png

This is a kwon issue described here (p 9). So try to set incoming buffer size for audio and video:
Code:
audio_incoming_buffer_size=100
video_incoming_buffer_size=100
Also please check RTSP camera settings.
If this does not help, we need an public access to any camera with audio to play it on our test server, or RTSP traffic dump collected on server side. We can collect the dump on your server, but we need to restart RTSP capturing to do that. So please provide a stream with audio which we can restart at night by Turkey time.
 

burak guder

Member
Is the disable_drop_aac_frame=true factor that I added to the flash.properties file affect the registration?

Our broadcast will end at 18:30 according to Turkey time and the music will continue throughout the night. You can add the settings you mentioned after this time and run the tests.

Does it increase latency loss?
audio_incoming_buffer_size=100
video_incoming_buffer_size=100



Camera Setting

WhatsApp Image 2021-07-12 at 13.38.24.jpeg
 

Max

Administrator
Staff member
Is the disable_drop_aac_frame=true factor that I added to the flash.properties file affect the registration?
No, this is default value and does not affect the case
Our broadcast will end at 18:30 according to Turkey time and the music will continue throughout the night. You can add the settings you mentioned after this time and run the tests.
We added the settings
Code:
audio_incoming_buffer_size=100
video_incoming_buffer_size=100
Then we monitored synchronization values for 3 available streams and recorded the stream with hearable audio periodically using REST API. During the tests synchronization is not growing any more (but changing up and down)
1626142379702.png

and the stream is recording normally, with audio track
1626142323955.png

Seems like the settings help to solve the issue
Does it increase latency loss?
No, this buffer size does not add latency.
 

burak guder

Member
I can't hear the sound in the recordings again
nothing changed in settings

The synchronization value seems to have increased again.

Code:
?action=stat&params=streams_synchronization

-----Stream Stats-----

streams_synchronization=abcdefNhT/119656;abcdefWgL/228980;abcdefR3V/228994
Code:
?action=stat&params=streams_viewers&format=json

{"streams_stats":{"streams_viewers":["abcdefNhT/0","abcdefWgL/132","abcdefR3V/195"]}}

File Name : abcdefR3V-1626250803070-1626254413010_7.mp4
 

Max

Administrator
Staff member
The problem is definitely in RTSP stream. But we cannot detect from logs on your server, does the synchronization value grows monotonically while playing the strem during a 36 hours, or does it jumps up occasionaly.
So please provide access to the stream from outside networks for us to play it on our test server with debug logs collection. Now we cannot play the stream outside of your server:
1626317149156.png

Code:
09:09:16,423 WARN  annelUpstreamHandler - pool-61-thread-1 EXCEPTION, please implement com.flashphoner.rtsp.RtspResponseHandler.exceptionCaught() for proper handling.
java.net.ConnectException: connection timed out
    at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:391)
    at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:289)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
We try to reproduce the issue.
As workaround, we recommend you to stop RTSP stream capturing when it is not used. Perhaps RTSP stream source moves aynchronization value for long time playbck connections.
Also, check video (not audio) settings of RTSP camera for any syncronization tweaks.
 

burak guder

Member
start stream synchronization
streams_synchronization=abcdefR3V/-19;abcdefWgL/184;abcdefNhT/172

synchronization status after 12 hours
streams_synchronization=abcdefWgL/1967;abcdefR3V/1676;abcdefNhT/3243

synchronization increases over time.

What kind of problems does this cause other than video recording?

In this case, I will not be able to record with the flashphoner. I can parse the records by making them with ffmpeg. But I have to recheck the system if it will cause other problems

images are not being sent because they are not currently used in cameras. Could this cause sync shift?
 

Max

Administrator
Staff member
start stream synchronization
streams_synchronization=abcdefR3V/-19;abcdefWgL/184;abcdefNhT/172

synchronization status after 12 hours
streams_synchronization=abcdefWgL/1967;abcdefR3V/1676;abcdefNhT/3243

synchronization increases over time.
It may be issue on WCS side.
Please provide 24/7 access to the RTSP stream using this form, so we could test and debug it on our servers.
images are not being sent because they are not currently used in cameras. Could this cause sync shift?
Yes, it can cause sync shift. But debug is needed, and we cannot do it on your server only. So we need an access to the stream.
 
Top