Skip to content

Videos only played in grayscale #157

Open
@kalbfuss

Description

I have an interesting phenomenon here when using ffpyplayer in combination with Kivy on the Radxa Zero 3W SBC: The majority of my videos are only played in grayscale albeit they are colored.

I am working on a photo frame application written in Python. The application runs on a Radxa Zero 3W SBC with Debian Bullseye installed. I have installed Kivy v2.3.0 and ffpyplayer v4.5.1 via pip.

By default, the Radxa Zero 3W does not support OpenGL, but only OpenGL ES. SDL2 thus falls back to software rendering via Mesa. This works perfectly, but is unfortunately too slow for my application.

I am thus using the GL4ES wrapper/driver, which in principle works fine. I am having no problems with images/photos. Also videos play fast and well with the single exception that most (but not all videos) are played in grayscale.

This is what ffprobe says about one of the videos played in grayscale:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1280x780.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.76.100
Duration: 00:00:10.30, start: 0.000000, bitrate: 3224 kb/s
Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m, progressive), 1280x780 [SAR 13:12 DAR 16:9], 3148 kb/s, 30.29 fps, 30.29 tbr, 13995000.00 tbn (default)

An this is what ffprobe says about a video played in color:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'P1070055.MOV':
Metadata:
creation_time : 2018-11-04T10:17:27.000000Z
Duration: 00:01:22.50, start: 0.000000, bitrate: 10895 kb/s
Stream #0:00x1: Video: mjpeg (Baseline) (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 640x480, 10830 kb/s, 30 fps, 30 tbr, 30 tbn (default)

With the video played in color, I get the following additional log messages:

[WARNING] [ffpyplayer ] [swscaler @ 0xffff48210840] deprecated pixel format used, make sure you did set range correctly
[WARNING] [ffpyplayer ] [swscaler @ 0xffff48210840] No accelerated colorspace conversion found from yuv420p to rgba.

So the problem appears to be linked to hardware accelerated colorspace conversion. I suspect for the video played in color, the swscaler falls back to software conversion, which does not seem to have any issues.

Additional hints:

  • Videos play slow with Mesa but in color.
  • Using ffplay, videos play fast and in color even with GL4ES.

Means, the problem occurs when I combine ffpyplayer with GL4ES, but ffmpeg is at least in principle capable of playing the videos correctly in combination with GL4ES. So there must be an additional factor.

Any idea what the problem might be? Anything I could do to debug further?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions