Commit 68eb93cc authored by Julian Rother's avatar Julian Rother

Renamed extract-xmp to probe and probe-raw

parent 6ac10428
TARGETS = extract-xmp remux thumbnail transcode
TARGETS = probe probe-raw remux thumbnail transcode
CFLAGS = -I /usr/include/libxml2
LDFLAGS= -lcurl -lavcodec -lavformat -lavfilter -lswscale -lavutil -lxml2
all: ${TARGETS}
extract-xmp: extract-xmp.c *.h util/*.c
probe: probe.c *.h util/*.c
probe-raw: probe
cp probe probe-raw
remux: remux.c *.h util/*.c
......
......@@ -63,7 +63,7 @@ char *get_xmpchapters(char *xmp)
int main(int argc, char *argv[])
{
int err;
char *path, *xmp;
char *path, *xmp, *xmp_chapters = "[]";
AVFormatContext *demux, *mux;
AVDictionaryEntry *tag;
AVDictionary *opts;
......@@ -74,20 +74,21 @@ int main(int argc, char *argv[])
init_avlogbuf();
jobid = atoi(argv[1]);
path = mprintf("%s/%s", getenv(WORKER_RAW), jstr(jlookup(argv[4], "path"), ""));
if (!strcmp(argv[2], "probe-raw"))
path = mprintf("%s/%s", getenv(WORKER_RAW), jstr(jlookup(argv[4], "path"), ""));
else
path = mprintf("%s/%s", getenv(WORKER_RELEASED), jstr(jlookup(argv[4], "path"), ""));
ping_job(jobid, "running", 0);
opts = 0;
av_dict_set_int(&opts, "export_xmp", 1, 0);
av_dict_set_int(&opts, "export_xmp", 1, 0); /* Ignored if not supported */
demux = 0;
if (err = avformat_open_input(&demux, path, 0, &opts))
job_failed("Opening input file failed: %s", av_err2str(err));
avformat_find_stream_info(demux, 0);
if (tag = av_dict_get(demux->metadata, "xmp", 0, 0))
ping_job(jobid, "finished", "{\"xmp_chapters\": %s, \"log\": \"%s\"}",
get_xmpchapters(tag->value), jescape(get_avlogbuf()));
else
ping_job(jobid, "finished", "{\"xmp_chapters\": [], \"log\": \"%s\"}",
jescape(get_avlogbuf()));
xmp_chapters = get_xmpchapters(tag->value);
ping_job(jobid, "finished", "{%s, \"xmp_chapters\": %s, \"log\": \"%s\"}",
json_fileinfo(path), xmp_chapters, jescape(get_avlogbuf()));
return 0;
}
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