Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.92k stars 165 forks source link

ffmpeg decoder breakage #4344

Closed totaam closed 3 weeks ago

totaam commented 3 weeks ago

Not sure when this started happening - especially now that I most often test with v6.x which doesn't have it. Reproducible with every supported branch and the builtin test data (which has been unchanged for years):

Here it is with v3.1.x and Fedora 40 with ffmpeg 6.1.1:

$ python3.10 ./xpra/codecs/loader.py dec_avcodec2
Error: avcodec error decoding 666 bytes of h264 data:
 'no picture'
 frame 0
 decoder state:
                version = 60, 31, 102
               encoding = h264
                formats = YUV420P, YUV422P, YUV444P, RGB, XRGB, BGRX, ARGB, BGRA, GBRP, GBRP9LE
                   type = avcodec
                 frames = 0
                  width = 24
                 height = 16
             colorspace = YUV420P
      actual_colorspace = YUV420P
          decoder_width = 24
         decoder_height = 16
avcodec2: h264 decoding failed: failed to decode test data for encoding 'h264' with colorspace 'YUV420P'
codecs and csc modules found:
* dec_avcodec2         : /usr/lib64/python3.10/site-packages/xpra/codecs/dec_avcodec2/decoder.cpython-310-x86_64-linux-gnu.so

codecs versions:
* avcodec2                        : 60.31.102
* numpy                           : 1.26.4
totaam commented 3 weeks ago

Even older versions now fail with the same error - tried as far back as v3.1.1 on Fedora 39. Probably something to do with ffmpeg 6.1.1

This is going to be a problem with MSYS2 and MacOS builds for all branches before v6

totaam commented 3 weeks ago

Scratch that, this only affects 6.1.1 and not 7.x (7.0.2 with current MSYS2) So less of an issue?

The self-tests are really working as intended and do allow the other codecs to be enabled - that is, my Fedora system can still decode vp8, vp9, mpeg1, mpeg2 and mpeg4 using the same decoder, it only avoids h264.

totaam commented 3 weeks ago

Works with Ubuntu 24.04 and libavcodec 6.1.1. Works with Fedora 41 and ffmpeg-devel 6.1.2 but not with libavcodec-free-devel 6.1.1.

Fixed by installing libavcodec-freeworld. The development headers include h264, but you need the "freeworld" package to actually get "h264" decoding support.