Commit be839aa0 authored by Carsten Schlote's avatar Carsten Schlote

Updated examples

parent 16806f7c
{
"description": "Some example code for the lmdb binding.",
"description": "Some example code for the libmediainfo binding.",
"license": "Public Domain",
"authors": [
"Johannes Pfau", "Carsten Schlote"
],
"copyright": "Created © 2018, Carsten Schlote",
"dependencies": {
"mediainfo-d":">=0.0.1"
"mediainfo-d":">=0.0.3"
},
"name": "mediainfo-demo1"
}
\ No newline at end of file
......@@ -8,25 +8,33 @@ import mediainfo;
int main(string[] args)
{
if (args.length < 2)
return 1;
string fileName;
assert(args.length >= 2, "Pass a filename to the program.");
fileName = args[1];
auto info = MediaInfo();
string vstring = info.option("Info_Version", "0.7.38.0;DTest;0.1");
writefln("Found version %s", vstring);
if (vstring == "")
throw new Exception("Incompatible mediainfo version");
string infoParams = info.option("Info_Parameters");
string infoCodecs = info.option("Info_Codecs");
info.option("Internet", "No");
info.open(args[1]);
info.open(fileName);
scope (exit)
{
info.close();
}
string inform = info.inform();
writefln("Got inform: %s", inform);
ulong nVideo = info.getCount(MediaInfo_stream_t.MediaInfo_Stream_Video);
ulong nAudio = info.getCount(MediaInfo_stream_t.MediaInfo_Stream_Audio);
ulong nText = info.getCount(MediaInfo_stream_t.MediaInfo_Stream_Text);
const ulong nVideo = info.getCount(MediaInfo_stream_t.MediaInfo_Stream_Video);
const ulong nAudio = info.getCount(MediaInfo_stream_t.MediaInfo_Stream_Audio);
const ulong nText = info.getCount(MediaInfo_stream_t.MediaInfo_Stream_Text);
if (nText == 0 && nVideo == 0 && nAudio == 0)
return 0;
......
{
"description": "Some example code for the lmdb binding.",
"description": "Some example code for the libmediainfo binding.",
"license": "Public Domain",
"authors": [
"Johannes Pfau", "Carsten Schlote"
],
"copyright": "Created © 2018, Carsten Schlote",
"dependencies": {
"mediainfo-d":">=0.0.1"
"mediainfo-d":">=0.0.3"
},
"name": "mediainfo-demo2"
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment