Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
ffworker
Commits
1af75a44
Commit
1af75a44
authored
Dec 04, 2017
by
Julian Rother
Browse files
Added publish_video
parent
c4fd51df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
1af75a44
TARGETS
=
probe probe-raw remux thumbnail transcode
TARGETS
=
probe probe-raw remux thumbnail transcode
publish_video
CFLAGS
=
-I
/usr/include/libxml2
LDFLAGS
=
-lcurl
-lavcodec
-lavformat
-lavfilter
-lswscale
-lavutil
-lxml2
...
...
@@ -16,5 +16,7 @@ thumbnail: thumbnail.c *.h util/*.c
transcode
:
transcode.c *.h util/*.c
publish_video
:
publish_video.c *.h util/*.c
clean
:
rm
-f
${TARGETS}
publish_video.c
0 → 100644
View file @
1af75a44
#include
<unistd.h>
#include
<libgen.h>
#include
<sys/stat.h>
#include
"util.h"
int
main
(
int
argc
,
char
*
argv
[])
{
char
*
src
,
*
dest
,
*
destdir
;
if
(
argc
!=
5
)
return
1
;
av_register_all
();
init_env
();
init_avlogbuf
();
jobid
=
atoi
(
argv
[
1
]);
src
=
mprintf
(
"%s/%s"
,
getenv
(
WORKER_TMP
),
jstr
(
jlookup
(
argv
[
4
],
"source"
),
""
));
dest
=
mprintf
(
"%s/%s"
,
getenv
(
WORKER_RELEASED
),
jstr
(
jlookup
(
argv
[
4
],
"path"
),
""
));
destdir
=
dirname
(
mprintf
(
"%s/%s"
,
getenv
(
WORKER_RELEASED
),
jstr
(
jlookup
(
argv
[
4
],
"path"
),
""
)));
ping_job
(
jobid
,
"running"
,
0
);
overwrite_check
(
dest
,
0
,
0
);
if
(
mkdir
(
destdir
,
02775
)
&&
errno
!=
EEXIST
)
job_failed
(
"Could not create target directory
\"
%s
\"
: %s"
,
destdir
,
strerror
(
errno
));
if
(
rename
(
src
,
dest
))
job_failed
(
"Overwriting target file failed: %s"
,
strerror
(
errno
));
ping_job
(
jobid
,
"finished"
,
"{%s,
\"
log
\"
:
\"
%s
\"
}"
,
json_fileinfo
(
dest
),
jescape
(
get_avlogbuf
()));
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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