Skip to content

Build failure: lomiri.lomiri-thumbnailer (after gst-plugins-bad bump) #399599

Closed

Description

@OPNA2608

Nixpkgs version

  • Unstable (25.05)

Steps to reproduce

nix-build /path/to/nixpkgs/checkout -A lomiri.lomiri-thumbnailer

Can Hydra reproduce this build failure?

Yes, Hydra can reproduce this build failure.

Link to Hydra build job

https://hydra.nixos.org/build/294797714

Relevant log output

[ RUN      ] ExtractorTest.extract_mp4
/build/source/tests/vs-thumb/vs-thumb_test.cpp:139: Failure
Value of: extractor.has_video()
  Actual: false
Expected: true

[  FAILED  ] ExtractorTest.extract_mp4 (18 ms)
[ RUN      ] ExtractorTest.extract_mp4_rotate_90
ThumbnailExtractor: extract_video_frame(): failed to extract still frame, url: file:///build/source/tests/media/testvideo-90.mp4
unknown file: Failure
C++ exception with description "ThumbnailExtractor: extract_video_frame(): failed to extract still frame, url: file:///build/source/tests/media/testvideo-90.mp4" thrown in the test body.

[  FAILED  ] ExtractorTest.extract_mp4_rotate_90 (9 ms)
[ RUN      ] ExtractorTest.extract_mp4_rotate_180
ThumbnailExtractor: extract_video_frame(): failed to extract still frame, url: file:///build/source/tests/media/testvideo-180.mp4
unknown file: Failure
C++ exception with description "ThumbnailExtractor: extract_video_frame(): failed to extract still frame, url: file:///build/source/tests/media/testvideo-180.mp4" thrown in the test body.

[  FAILED  ] ExtractorTest.extract_mp4_rotate_180 (8 ms)
[ RUN      ] ExtractorTest.extract_mp4_rotate_270
ThumbnailExtractor: extract_video_frame(): failed to extract still frame, url: file:///build/source/tests/media/testvideo-270.mp4
unknown file: Failure
C++ exception with description "ThumbnailExtractor: extract_video_frame(): failed to extract still frame, url: file:///build/source/tests/media/testvideo-270.mp4" thrown in the test body.

[  FAILED  ] ExtractorTest.extract_mp4_rotate_270 (8 ms)

Additional context

Reverting fb659ab from #390268 fixes the failures.

Here is a smaller reproducer that I'm working on/with, based on the code from lomiri.lomiri-thumbnailer that's running into this failure:

thumbnailer-gst-check.c
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>

#include <glib-object.h>
#include <gst/gst.h>

typedef enum
{
	GST_PLAY_FLAG_VIDEO             = (1 << 0),
	GST_PLAY_FLAG_AUDIO             = (1 << 1),
	GST_PLAY_FLAG_TEXT              = (1 << 2),
	GST_PLAY_FLAG_VIS               = (1 << 3),
	GST_PLAY_FLAG_SOFT_VOLUME       = (1 << 4),
	GST_PLAY_FLAG_NATIVE_AUDIO      = (1 << 5),
	GST_PLAY_FLAG_NATIVE_VIDEO      = (1 << 6),
	GST_PLAY_FLAG_DOWNLOAD          = (1 << 7),
	GST_PLAY_FLAG_BUFFERING         = (1 << 8),
	GST_PLAY_FLAG_DEINTERLACE       = (1 << 9),
	GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10),
	GST_PLAY_FLAG_FORCE_FILTERS     = (1 << 11),
} GstPlayFlags;

int main (int argc, char** argv) {
	if (argc != 2) {
		fprintf (stderr, "%s: /path/to/file\n", argv[0]);
		return 1;
	};

	gst_init (&argc, &argv);

	char* video_file = argv[1];

	gint64 duration = -1;

	GstElement* pb = gst_element_factory_make ("playbin", "playbin");
	if (!pb) {
		fprintf (stderr, "Could not create playbin\n");
		return 1;
	};

	GstElement* audio_sink = gst_element_factory_make ("fakesink", "audio-fake-sink");
	if (!audio_sink) {
		g_object_unref (pb);
		fprintf (stderr, "Could not create audio-fake-sink\n");
		return 1;
	};

	GstElement* video_sink = gst_element_factory_make ("fakesink", "video-fake-sink");
	if (!video_sink) {
		g_object_unref (audio_sink);
		g_object_unref (pb);
		fprintf (stderr, "Could not create video-fake-sink\n");
		return 1;
	};

	g_object_set (video_sink, "sync", true, NULL);
	g_object_set (pb,
		"audio-sink", audio_sink,
		"video-sink", video_sink,
		"flags", GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO,
		NULL);

	/* reset */
	gst_element_set_state (pb, GST_STATE_NULL);

	/* set_urls */
	g_object_set (pb, "uri", video_file, NULL);
	gst_element_set_state (pb, GST_STATE_PAUSED);
	if (!gst_element_query_duration(pb, GST_FORMAT_TIME, &duration)) {
		duration = -1;
	};
	printf ("Duration: %" PRId64 "\n", duration);

	/* extract_video_frame */
	gint64 seek_point = 10 & GST_SECOND;
	if (duration >= 0) {
		seek_point = 2 * duration / 7;
	}
	gst_element_seek_simple (pb,
		GST_FORMAT_TIME, (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), seek_point);
	gst_element_get_state (pb, NULL, NULL, GST_CLOCK_TIME_NONE);

	GstCaps* desired_caps = gst_caps_new_simple ("video/x-raw",
		"format", G_TYPE_STRING, "RGB",
		"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
		NULL);
	GstSample* s;
	g_signal_emit_by_name (pb, "convert-sample", desired_caps, &s);
	if (!s) {
		gst_caps_unref (desired_caps);
		g_object_unref (video_sink);
		g_object_unref (audio_sink);
		g_object_unref (pb);
		fprintf (stderr, "failed to extract still frame\n");
		return 1;
	}

	return 0;
}
thumbnailer-gst-check.nix
let
  pkgs = import ./. {};
in

pkgs.callPackage (
{
  stdenv,
  glib,
  gst_all_1,
  lomiri,
  makeFontsConf,
  pkg-config,
  wrapGAppsHook3,
  writableTmpDirAsHomeHook,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "thumbnailer-gst-check";
  version = "local";

  src = ./thumbnailer-gst-check.c;
  dontUnpack = true;

  nativeBuildInputs = [
    pkg-config
    wrapGAppsHook3
  ];

  buildInputs =
    [
      glib
    ] ++ (with gst_all_1; [
      gstreamer
      gst-plugins-base
      gst-plugins-good
      gst-plugins-bad
    ]);

  nativeCheckInputs = [
    writableTmpDirAsHomeHook
  ];

  dontConfigure = true;

  buildPhase = ''
    runHook preBuild

    $CC \
      -std=c99 -Wall -Wextra -pedantic \
      $($PKG_CONFIG --cflags glib-2.0 gstreamer-1.0) \
      $src -o $out \
      $($PKG_CONFIG --libs glib-2.0 gstreamer-1.0)

    runHook postBuild
  '';

  doCheck = true;

  env.FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };

  checkPhase = ''
    runHook preCheck

    printenv | grep '^GST'

    for mp4File in ${lomiri.lomiri-thumbnailer.src}/tests/media/*.mp4; do
      $out "file://''${mp4File}"
    done

    runHook postCheck
  '';
})

) {}

Running this against current master gives the following output when trying to process any of the test files:

(gst-plugin-scanner:89): libsoup-ERROR **: 21:22:14.079: libsoup3 symbols detected. Using libsoup2 and libsoup3 in the same process is not supported.
Duration: -1
failed to extract still frame

At first it seems like this might be #371265? But while adjusting the build so it doesn't build webrtc stuff and doesn't get libnice in buildInputs does make the libsoup error go away, it does not fix the extraction failure.

System metadata

  • system: "aarch64-linux"
  • host os: Linux 6.14.1, NixOS, 25.05 (Warbler), 25.05pre781462.f675531bc7e6
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Lix, like Nix) 2.91.1 System type: aarch64-linux Additional system types: armv7l-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/puna/.config/nix/nix.conf:/etc/xdg/xdg-miriway/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/puna/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/puna/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/puna/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/zdpnl9yjm9qcx180ykbsi1ydlqmqf0y9-lix-2.91.1/share
  • channels(root): "nix-index-database, nixos, nixos-hardware"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Notify maintainers

@OPNA2608 (me 🙂)


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: build failure
    on Apr 17, 2025
  2. OPNA2608 commented on Apr 18, 2025

    @OPNA2608
    ContributorAuthor

    The issue seems to be with this gstreamer PR that has made it into the latest gst-plugins-bad release. Building without -Dlcevcdecoder=disabled somehow produces a setup where the openh264 plugin cannot be found anymore?

    The PR adds a new H.264 de-/encoder, so maybe something's broken there? But trying to replicate the pipeline from the code with gst-launch-1.0 (emphasis on trying, as I've never used this CLI before & can't figure out how to set some properties properly) gives no issues:

    gst-launch-1.0 playbin uri=file:///nix/store/m1amdr0nhhbisl68bn22f9q543dgsbrp-source/tests/media/testvideo.mp4 audio-sink=fakesink video-sink=fakesink flags=audio+video
    

    (with GST_PLUGIN_SYSTEM_PATH_1_0 set up accordingly ofc)

    What works, is providing gst_all_1.gst-libav in buildInputs, so the process can fall back on using FFmpeg for decoding. I'm unsure if this is really a solution though, since I can't tell whose code is broken here...

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: build failure

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions