Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
ffworker
Commits
68eb93cc
Commit
68eb93cc
authored
Nov 30, 2017
by
Julian Rother
Browse files
Renamed extract-xmp to probe and probe-raw
parent
6ac10428
Changes
2
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
68eb93cc
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
...
...
extract-xmp
.c
→
probe
.c
View file @
68eb93cc
...
...
@@ -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
]);
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
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment