Stream cut-off while recording on MacBook Safari

Taylor

Member
Hi

We've discovered an issue that seems exclusive to MacBook (Big Sur) Safari where the stream recording stops capturing video and audio after 8-10 seconds.

Testing on the WCS Stream Recording demo page, we would do a recording of about 15 seconds. When playing back, the audio and video will play for only 8-10 seconds and then it just goes to a black screen and stays silent for the remain stream time.

It seems exclusive to MacBook (Big Sur 11.0.1) Safari as we've tested it out on:
  • iMac (Big Sur) Safari
  • iMac & MacBook (Big Sur) Firefox
  • iMac & MacBook (Big Sur) Chrome
and none of them have this issue. I'm also fairly certain this wasn't an issue in the previous MacOS version (Catalina 10.15) but cannot be 100% sure.

Any help on this would be greatly appreciated. I have added server information and logs below to hopefully help out

WCS Version: 5.2.856-677085d093a7278d52b4b5a9f70441e66c5be99c

Flashphoner Properties:
stream_record_policy_template={streamName}
wss.port=443
ws.port=80
periodic_fir_request=true

WCS-Core Properties:
-Xms12g -Xmx12g

Server Logs:
Code:
04:01:03,502 INFO    FileFFOutputWriter - VideoProcessor-22abb760-3e8a-11eb-8720-f72a8baf074c Init output writer '/usr/local/FlashphonerWebCallServer/records/4c00836b.mp4'
AudioConfig{codec='mpeg4-generic', timeBase=AVRational{numerator=1, denominator=44100}, channels=2, extradata=1210}
VideoConfig{codec='H264', codecObj=H264/90000 /1 [A packetization-mode:1, A profile-level-id:640028], timeBase=AVRational{numerator=1, denominator=90000}, width=640, height=480, profile=100, level=41, extradata=[0, 0, 0, 1, 39, 100, 0, 41, -84, 19, 22, 80, 40, 15, 108, 0, 48, 48, 0, 93, -64, 0, 23, 112, 94, -9, -63, -38, 8, -124, 101, -128, 0, 0, 0, 1, 40, -17, 31, 44], packetizationMode=0, bitrate=0, quality=0, resample=false, encoderPriority='null', gopSize=null, fps=null, preset='null'}
04:01:03,552 INFO          OpusSettings - CommonFileRecorderThread-1 OpusSettings{bitrate=20000, complexity=10}
04:01:05,123 WARN          AudioEncoder - CommonFileRecorderThread-1 Synchronization time drop, requested 3816993663292 current 3816993664304
04:01:05,124 WARN  tputWriterTimeHelper - CommonFileRecorderThread-1 Non monotonic audio time 2043:3031
...
04:01:05,227 WARN  tputWriterTimeHelper - CommonFileRecorderThread-1 Non monotonic audio time 2995:3031
04:01:05,227 WARN  tputWriterTimeHelper - CommonFileRecorderThread-1 Non monotonic audio time 3018:3031
04:01:07,057 INFO  AudioResamplerBuffer - CommonFileRecorderThread-1 Increase capacity of buffer to 23040
04:01:12,275 WARN  ileRecordAudioBuffer - CommonFileRecorderThread-1 Full buffer and no video packets, dropping packets
04:01:12,325 WARN  ileRecordAudioBuffer - CommonFileRecorderThread-1 Full buffer and no video packets, dropping packets
...
04:01:16,055 WARN  ileRecordAudioBuffer - CommonFileRecorderThread-1 Full buffer and no video packets, dropping packets
04:01:16,108 WARN          AudioEncoder - CommonFileRecorderThread-1 Synchronization time drop, requested 3816993673812 current 3816993670048
04:01:16,749 INFO            RestClient - API-ASYNC-pool-13-thread-2 SEND REST OBJECT ==>
 

Max

Administrator
Staff member
Good day.
Please check if the issue is reproduced while publishing stream without recording from Two Way Streaming or, better, from Media Devices example: publish stream, then play it. If playback will stop after 10 seconds, it seems like Safari browser stops sending video frames by some reason. If stream is playing normally, it shows that the problem may be in recording itself.
We'll schedule the test on Big Sur too.
 

Max

Administrator
Staff member
We confirm the problem in Safari 14.0.2 om Mac OS Bug Sur (11.1).
Seems like this Safari version does not publish streams in aspect ration other than 16:9 when FacetimeHD camera is used. The default stream resolution in most of examples is 320x240, or 4:3. In this case, Safari stops sending video packets, but logs nothing to the console.
So you can use a simple workaround: publish a stream in Stream Recording example with 640x360 resolution
Code:
    session.createStream({
        name: streamName,
        display: localVideo,
        record: true,
        receiveVideo: false,
        receiveAudio: false,
        constraints: {
            video: {
                width: 640,
                height: 360,
                frameRate: 30
            },
            audio: true
        }
        ...
    }).publish();
We raised the ticket WCS-3016 to investigate this issue.
 

Taylor

Member
Hi Max

Sorry I was unable to get back to you last night.

I have checked on Media Devices tab that it does break with 640x480 but then it does work with 640x360 as you've suggested.

Thank you for getting back quickly with the workaround.
 

Max

Administrator
Staff member
Good day.
We changed default resolution to 640x360 for Safari browser in WebSDK build 0.5.28.2753.153 (GitHub). Please update WebSDK and check. It is already updated on demo server.
 

Taylor

Member
Hi Max

I've tested using the WebSDK build 0.5.28.2753.153 and I can confirm that it switches to 640x360 for Safari and sticks with 320x240 for other browsers on Mac.

Thank you for your help.
 
Top