<?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>245511</bug_id>
          
          <creation_ts>2022-09-21 20:06:55 -0700</creation_ts>
          <short_desc>The size of a video track&apos;s settings is incorrect in the second MediaStream created when the &apos;aspectRatio&apos; contraint is applied</short_desc>
          <delta_ts>2022-11-07 17:16:59 -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 16</version>
          <rep_platform>All</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://codesandbox.io/s/blissful-snowflake-qdq6fo?file=/src/App.js</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>inanelit</reporter>
          <assigned_to name="Eric Carlson">eric.carlson</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>akeerthi</cc>
    
    <cc>bryan</cc>
    
    <cc>cdumez</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>mbrice</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1900289</commentid>
    <comment_count>0</comment_count>
    <who name="">inanelit</who>
    <bug_when>2022-09-21 20:06:55 -0700</bug_when>
    <thetext>If a webcam video stream is attached to a video element that is not rendered in the DOM, and then we render a video element with the same media constraints, that video element will have incorrect videoHeight and videoWidth.

This issue repros in Safari 16 on desktop and mobile.

For an example, go to https://codesandbox.io/s/blissful-snowflake-qdq6fo?file=/src/App.js and click &quot;Show Webcam&quot;

In this example, a useEffect hook creates an unrendered video element and attaches a media stream to it. Clicking show webcam causes a second video element to be rendered using the same video constraints (not the same video stream), along with a canvas that we are drawing from the video to every second. The captured frame drawn on the canvas is distorted because videoHeight and videoWidth are incorrect.

Webcam used was built-in webcam for M1 Macbook Pro</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900295</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-09-21 20:42:31 -0700</bug_when>
    <thetext>&lt;rdar://problem/100254156&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900749</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-23 13:10:16 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 16 and Safari Technology Preview 154 and the second stream video is distorted and like crushed or squeezed. While I am not able to reproduce this in Chrome Canary 108 and Firefox Nightly 107. Just wanted to update latest testing results. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910124</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2022-11-03 11:12:26 -0700</bug_when>
    <thetext>The bug is that the sections of the second video stream track are incorrect when the &apos;aspectRatio&apos; constraint is used. The camera stream is captured at the correct size, but MediaTrackSettings.width and MediaTrackSettings.height have the values of the unconstrained width and height.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910131</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2022-11-03 11:29:45 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6093</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910944</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-07 17:16:56 -0800</bug_when>
    <thetext>Committed 256433@main (fc20b78a56dc): &lt;https://commits.webkit.org/256433@main&gt;

Reviewed commits have been landed. Closing PR #6093 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>