Coder Social home page Coder Social logo

Comments (18)

adfghzhang avatar adfghzhang commented on June 8, 2024 1

yes, I change the size with my phone. But it still not work. Can you email to me and give me some help. My emil-addr:[email protected]

from androidmirrroing.

vuquangtrong avatar vuquangtrong commented on June 8, 2024

Hi, the project is at very beginning stage, so I just fixed the size of a frame.
please edit the width and height in file mirror.js

ws.send(JSON.stringify({
      action: 'init',
      width: '720',
      height: '1280'
    }));

and in index.html

wsavc.swipe(
            startX * 720 / width,
            startY * 1280 / height, 
            endX * 720 / width, 
            endY * 1280 / height,
            elapsedTime);

Please try and send me your feedback. I will update the code to send the frame size to client soon.

from androidmirrroing.

vuquangtrong avatar vuquangtrong commented on June 8, 2024

What is your phone model and its android version? scrcpy requires android 5.0+ (my old one is 4.3 and scrcpy doesnot work with it)

Could you add console.log() in the http-live-player.js at line 4446?

this.ws.onmessage = (evt) => {
      if(typeof evt.data == "string")
        return this.cmd(JSON.parse(evt.data));

      this.pktnum++;
      var frame = new Uint8Array(evt.data);
      console.log("[Pkt " + this.pktnum + " (" + evt.data.byteLength + " bytes)]");
      console.log(frame);
      //this.decode(frame);
      framesList.push(frame);
    };

Then in browser console, check the frame data which should be start with [0,0,0,1].
One more, please check the port 8091. it maybe blocked.

I have tested with Samsung S7 ( set at 720x1280, 1080x1920, 1440x2560) and Nexus 6P (1440x2560).

from androidmirrroing.

powerProgrammerMa avatar powerProgrammerMa commented on June 8, 2024

image

image

image
Uploading image.png…

from androidmirrroing.

powerProgrammerMa avatar powerProgrammerMa commented on June 8, 2024

image

from androidmirrroing.

powerProgrammerMa avatar powerProgrammerMa commented on June 8, 2024

This mistake occasionally occurs.

from androidmirrroing.

adfghzhang avatar adfghzhang commented on June 8, 2024

My Phone is Honor 7i with Android version 6.0 (1080x1920), RedMe Note4x with Android 6.0 (1080x1920)
powerProgrammerMa is my partner

from androidmirrroing.

vuquangtrong avatar vuquangtrong commented on June 8, 2024

It seems that the problem comes from Broadway.js which cannot render portrait mode (1080x1920) but can render landscape mode (1920x1080).
image

I will check more and if problem is in Broadway.js, we should talk to him.

from androidmirrroing.

adfghzhang avatar adfghzhang commented on June 8, 2024

I test on a genymotion emulator with landscape mode (1280x720), it works right. And I changed it to 720x1280 also work well.

from androidmirrroing.

vuquangtrong avatar vuquangtrong commented on June 8, 2024

You should test with Broadway.js or h264-live-player.js on browser. Genymobile's scrcpy emulator does not use JS rendering.

As I tested on browser, only portrait at size of 1080x1920 is not working.
Could you make a test with ffmpeg to stream 1080x1920 h264 to a web page? if it also fails, then the problem is from Broadway.js.

from androidmirrroing.

wzrf avatar wzrf commented on June 8, 2024

Hi guys, did you figure it out? I'm using 1080 x 1920 device, and it's also not decoding properly.

from androidmirrroing.

Snotra-p avatar Snotra-p commented on June 8, 2024

how can i decode correctly 2220x1080 ? plz help me

from androidmirrroing.

krishtoautomate avatar krishtoautomate commented on June 8, 2024

same issue

from androidmirrroing.

wj2008 avatar wj2008 commented on June 8, 2024

which android version can't decode ? 是不是这个原因 “因为 Broadway 插件不支持 H264 baseline”

from androidmirrroing.

MilkFlavor avatar MilkFlavor commented on June 8, 2024

I think I got it. According to the original author of this project, this is a problem with Broadway.js. Apparently, it can only run in landscape mode. So I created a fork fixing these issues, however, the project still doesn't have rotation support. Here is the link: https://github.com/MilkFlavor/androidmirrroing

I'm gonna try adding rotation support, but for now, it only works on landscape mode. One of my solutions is to reduce the resolution of the images or the phone itself.

from androidmirrroing.

airhandsome avatar airhandsome commented on June 8, 2024

I think I got it. According to the original author of this project, this is a problem with Broadway.js. Apparently, it can only run in landscape mode. So I created a fork fixing these issues, however, the project still doesn't have rotation support. Here is the link: https://github.com/MilkFlavor/androidmirrroing

I'm gonna try adding rotation support, but for now, it only works on landscape mode. One of my solutions is to reduce the resolution of the images or the phone itself.

Hello, I downloaded your project and tried to run it. However nothing is shown in to web. Can you help? My Email Address is: [email protected]

from androidmirrroing.

MilkFlavor avatar MilkFlavor commented on June 8, 2024

Did you run it with both scripts? You have to run it with scrcpy.bat, then go into the mirroring folder and run npm run start. I find this process kind of tedious so I'll try simplifying it to one command and completely getting rid of the .bat files at a later date. For the time being, you have to give more information about your situation. Also, feel free to create an issue or pull a request on my project.

from androidmirrroing.

MilkFlavor avatar MilkFlavor commented on June 8, 2024

I think of manually starting the adb server by running scrcpy.bat it'll be more efficient if we replace that with appium-adb
I'm also thinking of compiling the project to web assembly. Apparently, "Wasm is 1.15-1.67 times faster than JavaScript on Google Chrome on a desktop", it shouldn't be that difficult.

from androidmirrroing.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.