Skip to content

Instantly share code, notes, and snippets.

@midchildan
Created May 2, 2021 12:20
Show Gist options
  • Save midchildan/6e49aa1b0b0986cfcbc79620644e4600 to your computer and use it in GitHub Desktop.
Save midchildan/6e49aa1b0b0986cfcbc79620644e4600 to your computer and use it in GitHub Desktop.
Test the intel-media-sdk package in Nixpkgs
{ lib
, fetchurl
, runCommandNoCC
, runtimeShell
, writers
, ffmpeg-full
, intel-media-driver
}:
let
fixtures = {
mp4 = fetchurl {
url = "https://archive.org/download/BigBuckBunny_310/big_buck_bunny_640_512kb.mp4";
sha256 = "1f74psji5c5yzbp150gg1z6mw4pvh90177dclp28dlnkl6yhqd3p";
meta.license = lib.licenses.cc-by-30;
};
};
in
writers.writeBash "test-ffmpeg-mfx.sh" ''
set -euo pipefail
export LIBVA_DRIVER_NAME='iHD';
export LD_LIBRARY_PATH='${intel-media-driver}/lib';
export LIBGL_DRIVERS_PATH='${intel-media-driver}/lib/dri';
${ffmpeg-full}/bin/ffmpeg \
-hwaccel qsv \
-c:v h264_qsv \
-i '${fixtures.mp4}' \
-c:v mpeg2_qsv \
-c:a copy \
result.ts
''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment