Bug 247967

Summary: "A MediaStreamTrack ended due to a capture failure" when creating a new MediaStream after destroy the previous one
Product: WebKit Reporter: Brian Liu <ralphbliu>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Critical CC: eric.carlson, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   
Attachments:
Description Flags
Screen recording none

Description Brian Liu 2022-11-15 18:35:06 PST
Created attachment 463550 [details]
Screen recording

This issue can always be reproduced on iPhone 14/Safari 16.0/16.0.1 simply follow the steps

1. Create a video & audio stream by calling navigator.mediaDevices.getUserMedia
2. Create a MediaRecorder using recordrtc with the stream(https://github.com/muaz-khan/RecordRTC)
3. Record a video
4. Destroy the MediaStreamTracks
5. Repeat step 1 and 2 then browser crash

You can quickly reproduce it by opening this link (https://dev.vouchfor.com/c/ybSXTEjsWj) on iPhone with iOS 16.0/16.0.1
Comment 1 Radar WebKit Bug Importer 2022-11-22 18:36:18 PST
<rdar://problem/102615829>
Comment 2 Eric Carlson 2022-12-13 14:43:03 PST
https://dev.vouchfor.com/c/ybSXTEjsWj is no longer valid. Do you have another test case that demonstrates the problem?
Comment 3 Brian Liu 2022-12-13 14:58:55 PST
Try this one instead https://staging.vouchfor.com/c/EYWSAf4NJP
Comment 4 youenn fablet 2023-01-20 02:11:38 PST
(In reply to Brian Liu from comment #3)
> Try this one instead https://staging.vouchfor.com/c/EYWSAf4NJP

Can you make an English version, or provide some steps to how to use this link?
Comment 5 youenn fablet 2023-01-20 02:14:58 PST
Looking at the screen recording, it might be that there are some VideoFrames that are kept from too long, thus triggering the MediaStreamTrack ended failure.
@Brian, if you can provided an English version, that is great.
Otherwise, can you reproduce and send me (youenn@apple.com) a sysdiagnose?