{ "name": "mediainfo", "version": "26.05", "summary": "mediainfo: shows the technical data and tags of video and audio files (codecs, bit rates, duration), as text, JSON or XML", "category": "tool", "license": "BSD-2-Clause", "homepage": "https://mediaarea.net/en/MediaInfo", "source": { "url": "https://mediaarea.net/download/source/mediainfo/26.05/mediainfo_26.05.tar.xz", "sha256": "f852093f9050022d699606eeabb38b24da5523d0212fab64dc4e4d3e46b56de1" }, "watch": {"kind": "index", "url": "https://mediaarea.net/download/source/mediainfo/", "regex": "href=\"([0-9]+(?:\\.[0-9]+)+)/\"", "pin": "any"}, "deps": [ "libmediainfo", "libzen", "zlib" ], "env_packages": [], "static": true, "nss": true, "check": "bin/mediainfo --Version | has 'v26.05' && t=$(mktemp -d) && python3 -c 'import wave, sys; w = wave.open(sys.argv[1], \"wb\"); w.setnchannels(1); w.setsampwidth(2); w.setframerate(8000); w.writeframes(bytes(2 * 8000 * 3)); w.close()' \"$t/a.wav\" && python3 -c 'import zlib, struct, sys; ch = lambda t, d: struct.pack(\">I\", len(d)) + t + d + struct.pack(\">I\", zlib.crc32(t + d)); raw = b\"\".join(b\"\\0\" + b\"\\xff\\x80\\x00\" * 3 for _ in range(2)); open(sys.argv[1], \"wb\").write(b\"\\x89PNG\\r\\n\\x1a\\n\" + ch(b\"IHDR\", struct.pack(\">IIBBBBB\", 3, 2, 8, 2, 0, 0, 0)) + ch(b\"IDAT\", zlib.compress(raw)) + ch(b\"IEND\", b\"\"))' \"$t/b.png\" && bin/mediainfo '--Inform=Audio;%Format% %SamplingRate% %Channels% %BitDepth% %Duration%' \"$t/a.wav\" | has -x 'PCM 8000 1 16 3000' && bin/mediainfo '--Inform=Image;%Format% %Width%x%Height%' \"$t/b.png\" | has -x 'PNG 3x2' && bin/mediainfo --Output=JSON \"$t/a.wav\" | python3 -c 'import json, sys; j = json.load(sys.stdin); a = [x for x in j[\"media\"][\"track\"] if x[\"@type\"] == \"Audio\"][0]; sys.exit(a[\"Format\"] != \"PCM\" or a[\"SamplingRate\"] != \"8000\")' && echo 'mediainfo 26.05: a WAV file (PCM, 8000 Hz, mono, 16 bit, 3 s) and a PNG (3x2) described, the WAV again as JSON'" }