Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
111.81k stars 10.7k forks source link

scrcpy cannot connect audio #4717

Open pengpeng1992 opened 8 months ago

pengpeng1992 commented 8 months ago

Environment

Describe the bug command: scrcpy -d scrcpy 2.3.1 https://github.com/Genymobile/scrcpy INFO: ADB device found: INFO: --> (usb) 29a9d976 device RMX3370 INFO: (tcpip) 192.168.5.48:5555 device RMX3370 /usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 13.8 MB/s (66007 bytes in 0.005s) [server] INFO: Device: [realme] realme RMX3370 (Android 13) INFO: Renderer: opengl INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2 INFO: Trilinear filtering enabled INFO: Texture: 1080x2400 ERROR: Demuxer 'audio': stream disabled due to missing decoder ERROR: Demuxer error

Works fine if audio is not connected

rom1v commented 8 months ago

Your ffmpeg is compiled without opus support.

Either use a ffmpeg versio' which supports opus, or pass --audio-codec=aac instead.

pengpeng1992 commented 8 months ago

@rom1v I added --audio-codec=aac,but still can't connect

scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  29a9d976                        device  RMX3370
INFO:         (tcpip)  192.168.5.48:5555               device  RMX3370
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 9.6 MB/s (66007 bytes in 0.007s)
[server] INFO: Device: [realme] realme RMX3370 (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
INFO: Trilinear filtering enabled
INFO: Texture: 1080x2400
ERROR: [FFmpeg] Input channel count and layout are unset
ERROR: Failed to initialize the resampling context
ERROR: Demuxer error
rom1v commented 8 months ago

OK, so your ffmpeg build has other issues. Where does it come from?

pengpeng1992 commented 8 months ago

@rom1v ffmpeg is installed by apt, the version is 4.4. 2. I compiled the 6.0.1 version myself, and it can be used to connect audio.thank you