Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
112.25k stars 10.73k forks source link

ERROR: [FFmpeg] Your platform doesn't support hardware accelerated AV1 decoding. #4744

Open BPplays opened 8 months ago

BPplays commented 8 months ago

Environment

Describe the bug it seems to want hardware av1 decoding and wont use software decoding ‎ command output:

-> .\scrcpy --video-bit-rate 1500k --video-codec=av1
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  RFCW71HBS5P                     device  SM_F946U1
C:\Users\suzuko\Programs\misc\scrcpy-win64-v2.4\scrcpy... pushed, 0 skipped. 126.7 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [samsung] samsung SM-F946U1 (Android 14)
[server] ERROR: Encoding error: java.lang.IllegalArgumentException:
[server] INFO: Retrying with -m1920...
[server] INFO: Retrying...
INFO: Renderer: direct3d
INFO: Texture: 1808x2176
ERROR: [FFmpeg] Your platform doesn't support hardware accelerated AV1 decoding.
ERROR: [FFmpeg] Failed to get pixel format.
ERROR: Decoder 'video': could not send video packet: -40
ERROR: Demuxer error

‎ --list-encoders:

-> .\scrcpy --list-encoders
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  RFCW71HBS5P                     device  SM_F946U1
C:\Users\suzuko\Programs\misc\scrcpy-win64-v2.4\scrcpy...e pushed, 0 skipped. 90.3 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [samsung] samsung SM-F946U1 (Android 14)
[server] INFO: List of video encoders:
    --video-codec=h264 --video-encoder='c2.qti.avc.encoder'
    --video-codec=h264 --video-encoder='OMX.qcom.video.encoder.avc'
    --video-codec=h264 --video-encoder='c2.android.avc.encoder'
    --video-codec=h264 --video-encoder='OMX.google.h264.encoder'
    --video-codec=h265 --video-encoder='c2.qti.hevc.encoder'
    --video-codec=h265 --video-encoder='OMX.qcom.video.encoder.hevc'
    --video-codec=h265 --video-encoder='c2.qti.hevc.encoder.cq'
    --video-codec=h265 --video-encoder='OMX.qcom.video.encoder.hevc.cq'
    --video-codec=h265 --video-encoder='c2.qti.hevc.encoder.hdr'
    --video-codec=h265 --video-encoder='c2.android.hevc.encoder'
    --video-codec=av1 --video-encoder='c2.android.av1.encoder'
[server] INFO: List of audio encoders:
    --audio-codec=opus --audio-encoder='c2.android.opus.encoder'
    --audio-codec=aac --audio-encoder='c2.android.aac.encoder'
    --audio-codec=aac --audio-encoder='OMX.google.aac.encoder'
    --audio-codec=aac --audio-encoder='c2.sec.aac.encoder'
    --audio-codec=flac --audio-encoder='c2.android.flac.encoder'
    --audio-codec=flac --audio-encoder='OMX.google.flac.encoder'
rom1v commented 8 months ago

On Windows, it probably requires to build dav1d for Windows and to enable libdav1d in ffmpeg builds:

diff --git a/app/deps/ffmpeg.sh b/app/deps/ffmpeg.sh
index 19fb2991d..9e1a809ac 100755
--- a/app/deps/ffmpeg.sh
+++ b/app/deps/ffmpeg.sh
@@ -67,6 +67,7 @@ else
         --disable-network \
         --disable-everything \
         --enable-swresample \
+        --enable-libdav1d \
         --enable-decoder=h264 \
         --enable-decoder=hevc \
         --enable-decoder=av1 \