Skip to content

Recording always forces yuv420p for h264 codecs even if encoder doesn't support it #2084

@luctowers

Description

@luctowers

Hi, I built mgba-qt from source on Ubuntu Focal. I tried to record with the 'lossless' preset and got an error.

[libx264rgb @ 0x55d9e8876300] Specified pixel format yuv420p is invalid or not supported

found this bug

if (encoder->video->codec->id == AV_CODEC_ID_H264 &&
    (strcasecmp(encoder->containerFormat, "mp4") ||
        strcasecmp(encoder->containerFormat, "m4v") ||
        strcasecmp(encoder->containerFormat, "mov"))) {
    // QuickTime and a few other things require YUV420
    encoder->video->pix_fmt = AV_PIX_FMT_YUV420P;
}

strcasecmp returns zero when strings are equal, this code to assumes the opposite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions