Giter Site home page Giter Site logo

mediamtx-scrcpy-audio's Introduction

mediamtx-scrcpy-audio

Just a simple personal solution, used with ws-scrcpy
I use Flutter to write an App myself,
use inappwebview to open the NetrisTV/ws-scrcpy webpage (with viewport to improve resolution),
and then use the headless (inappwebview) background to open the audio webpage

The following is a simple method to play mobile phone audio on the web page

  1. Start bluenviron/mediamtx
    docker run --name=mediamtx \
    --env=MTX_WEBRTCADDITIONALHOSTS=<External public network IP>,<Internal network host IP> \
    -p 1935:1935 \
    -p 8189:8189  \
    -p 8189:8189/udp \
    -p 8554:8554 \
    -p 8888:8888 \
    -p 8889:8889 \
    -p 8890:8890/udp  \
    bluenviron/mediamtx
  2. Start Genymobile/scrcpy and use ffmpeg push the audio to mediamtx
    [/config/.android] <- Used for adb authorization to avoid having to confirm every time you operate the phone
    The 3000 port is kasmVnc. I originally used this webpage to play audio, but the network usage was relatively high.
    docker run --name=mediamtx-scrcpy-audio \
    --env=SCRCPY_IP=<mobile phone ip:5555> \
    --env=RTSP_SERVER=rtsp://mediamtx:8554/myaudio1 \
    --volume=./android:/config/.android:ro  \
    -p 3000:3000 \
    ghcr.io/otaku840726/mediamtx-scrcpy-audio:latest
  3. Open the audio webpage
    First use the internal network to confirm that the audio is normal. The external network needs to enable 8189/udp to use webrtc normally.
    kasmVNC is about 400k/s, Mediamtx webrtc is about 30k/s
    But of course there will be differences in sound quality. You can also use the Docerfile to rebuild it yourself. There is bitrate/compression_level/frame_duration in root/entrypoint.sh to improve it.
    mediamtx-webrtc: http://mediamtx:8889/myaudio1
    kasmVNC: http://mediamtx-scrcpy-audio:3000

mediamtx-scrcpy-audio's People

Contributors

otaku840726 avatar

Watchers

 avatar

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.