title: How to flip the webcam video on canvas without inverting the texts written in the canvas
body: <p>I flipped a webcam stream to make it mirrored using <code>ctx.translate()</code> and <code>ctx.scale()</code> but it also does flip everything else drawn on the canvas. Is there a way to flip the webcam video but not the other drawings on the canvas like texts?</p>
  <p>Here is the code I am currently using (excerpt):</p>
  <pre class="lang-js prettyprint-override"><code>const setupcamera = () =&gt; {
    navigator.mediaDevices
      .getUserMedia({
        video: { width: 600, height: 400 },
        audio: false,
      })
      .then((stream) =&gt; {
        video.srcObject = stream;
      });
  };
  
  const detectpose = async () =&gt; {
    const poses = await detector.estimatePoses(video, false);
  
    console.log(poses);
    ctx.drawImage(video, 0, 0, 600, 400);
  
    ctx.font = &quot;30px Comic Sans MS&quot;;
      ctx.fillStyle = &quot;green&quot;;
      ctx.fillText(po, elbowx, elbowy);
  
  setupcamera();
  
  video.addEventListener(&quot;loadeddata&quot;, async () =&gt; {
    ctx.translate(600, 0);
    ctx.scale(-1, 1);
    detector = await poseDetection.createDetector(
      poseDetection.SupportedModels.MoveNet
    );
    setInterval(detectpose, 20);
  });
  </code></pre>
  <p>I thought about drawing a new canvas over the flipped canvas but if possible I would like to draw everything on the same canvas.</p>