<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>229611</bug_id>
          
          <creation_ts>2021-08-27 08:34:44 -0700</creation_ts>
          <short_desc>MediaRecorder with canvas captureStream() produces blank video</short_desc>
          <delta_ts>2025-02-14 13:14:23 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>230613</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ashley Gullen">ashley</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>9anime.net.za</cc>
    
    <cc>ap</cc>
    
    <cc>bekeanloinse</cc>
    
    <cc>Civillainscorpion</cc>
    
    <cc>dahalls</cc>
    
    <cc>dasir48284</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>evawillms183</cc>
    
    <cc>gesturesatellitedgg</cc>
    
    <cc>hannahlouriel</cc>
    
    <cc>hillaryrodham824</cc>
    
    <cc>jeremywalsh4477</cc>
    
    <cc>jerry</cc>
    
    <cc>jimmiemeyers180</cc>
    
    <cc>jonlee</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>Kongpheng.Nanthavongsa</cc>
    
    <cc>mfaoax</cc>
    
    <cc>myasiantv.org.ng</cc>
    
    <cc>pauldconlin</cc>
    
    <cc>playtimescheduler.com.co</cc>
    
    <cc>qtvtauizepyhhe</cc>
    
    <cc>ravee7777777</cc>
    
    <cc>reg2405</cc>
    
    <cc>seohubworker4</cc>
    
    <cc>sifose2652</cc>
    
    <cc>sims1234</cc>
    
    <cc>Urgot68</cc>
    
    <cc>viphthu1101</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wellsedith352</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1788027</commentid>
    <comment_count>0</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2021-08-27 08:34:44 -0700</bug_when>
    <thetext>Using MediaRecorder to record a MediaStream from the canvas captureStream() method appears to only produce a blank video in Safari 15 / TP 130 on macOS 12 beta (21A5304g).

Demo URL: https://downloads.scirra.com/labs/screenrecording/

Steps to reproduce:

1. Click &apos;Record canvas&apos;
2. Wait a few seconds
3. Click &apos;Stop recording&apos;

A video file will then be downloaded.

Observed result:
The video has the expected duration, but just displays all black.

Expected result:
Video to show canvas content that was recorded.

Other notes:
This appears to work correctly on iOS 14, so may be unique to macOS. Also note we have reports that a flickery video is recorded on Safari 14 on macOS, but we can&apos;t easily test that right now. Finally the &apos;Record screen&apos; option - using getDisplayMedia() - appears to work correctly, so this looks like an issue specific to using MediaRecorder with canvas captureStream().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1790176</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-03 08:35:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/82724497&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1790538</commentid>
    <comment_count>2</comment_count>
    <who name="Alexander Khovansky">alex</who>
    <bug_when>2021-09-05 06:10:55 -0700</bug_when>
    <thetext>We ran into the same problem (except with a bit more erratic behavior) when using a canvas for realtime video modification.
It looks like it&apos;s not MediaRecorder specific but rather captureStream producing a bad stream.

Here&apos;s a codepen that demonstrates the issue:
https://codepen.io/alx-khovansky/pen/KKqgeNw

It has a video source that is rendered to a canvas, which is then rendered to a different video element using captureStream. Works in Safari 14 but not in TP.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1791185</commentid>
    <comment_count>3</comment_count>
    <who name="David Halls">dahalls</who>
    <bug_when>2021-09-07 13:11:31 -0700</bug_when>
    <thetext>I&apos;m also seeing this. It&apos;s captureStream generating blank video.

One example is https://experiments.withgoogle.com/webcam-displacement

This works on Safari 14.1.2 but not on TP 131 (both Big Sur).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1792901</commentid>
    <comment_count>4</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-09-13 02:34:20 -0700</bug_when>
    <thetext>&gt; It looks like it&apos;s not MediaRecorder specific but rather captureStream
&gt; producing a bad stream.

Right, this is also my understanding.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1797271</commentid>
    <comment_count>5</comment_count>
    <who name="David Halls">dahalls</who>
    <bug_when>2021-09-25 22:49:08 -0700</bug_when>
    <thetext>Broken on Safari 15 now :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805721</commentid>
    <comment_count>6</comment_count>
    <who name="jerry">jerry</who>
    <bug_when>2021-10-18 14:29:30 -0700</bug_when>
    <thetext>How do we get the devs to at least confirm this?

This happens to the latest TP 133.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817063</commentid>
    <comment_count>7</comment_count>
    <who name="Kongpheng">Kongpheng.Nanthavongsa</who>
    <bug_when>2021-11-19 18:40:45 -0800</bug_when>
    <thetext>Issue still reproducible on Safari version 15.1 (15612.2.9.1.30, 15612).

Another way to reproduce:
* Open https://webrtc.github.io/samples/src/content/capture/canvas-video/
* Using mouse, move teapot on the left side around, by holding down left-click and dragging your mouse around
* Notice that teapot on the right doesn&apos;t mirror the left teapot&apos;s movement

I wonder if issue is due to auto-play constraint violation.  Console logs follows.

MediaElementSession::clientWillBeginAutoplaying(74E6F415461C6466) state = Autoplaying
HTMLMediaElement::setShouldDelayLoadEvent(74E6F415461C6466) true
MediaElementSession::removeBehaviorRestriction(74E6F415461C6466) removed RequirePageConsentToLoadMedia
MediaElementSession::autoplayPermitted(74E6F415461C6466) Returning FALSE because element is not visible in the viewport
MediaElementSession::beginInterruption(74E6F415461C6466) state = Autoplaying, interruption type = InvisibleAutoplay, interruption count = 0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1827798</commentid>
    <comment_count>8</comment_count>
    <who name="">pauldconlin</who>
    <bug_when>2022-01-03 11:22:07 -0800</bug_when>
    <thetext>Adding on here that this is affecting capture for Flipgrid in Safari 15. We can fall back to a standard video element -&gt; MediaRecorder capture, but that removes our ability to provide all of the canvas enabled effects. For a quick fix for this bug, we are just disabling capture on Safari 15.

@youenn - anything else I can help provide to diagnose?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1827827</commentid>
    <comment_count>9</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2022-01-03 14:49:49 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 230613 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2046719</commentid>
    <comment_count>21</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2024-07-17 07:45:48 -0700</bug_when>
    <thetext>This issue was marked a duplicate of 230613 which was apparently fixed in 2022. I&apos;m not an Apple developer, but if there are still issues you should file a new issue, I doubt anyone from Apple is going to track comments on an old and apparently already fixed issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>