Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ffworker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Video AG Infrastruktur
ffworker
Commits
1af75a44
Commit
1af75a44
authored
7 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Added publish_video
parent
c4fd51df
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+3
-1
3 additions, 1 deletion
Makefile
publish_video.c
+28
-0
28 additions, 0 deletions
publish_video.c
with
31 additions
and
1 deletion
Makefile
+
3
−
1
View file @
1af75a44
TARGETS
=
probe probe-raw remux thumbnail transcode
TARGETS
=
probe probe-raw remux thumbnail transcode
publish_video
CFLAGS
=
-I
/usr/include/libxml2
CFLAGS
=
-I
/usr/include/libxml2
LDFLAGS
=
-lcurl
-lavcodec
-lavformat
-lavfilter
-lswscale
-lavutil
-lxml2
LDFLAGS
=
-lcurl
-lavcodec
-lavformat
-lavfilter
-lswscale
-lavutil
-lxml2
...
@@ -16,5 +16,7 @@ thumbnail: thumbnail.c *.h util/*.c
...
@@ -16,5 +16,7 @@ thumbnail: thumbnail.c *.h util/*.c
transcode
:
transcode.c *.h util/*.c
transcode
:
transcode.c *.h util/*.c
publish_video
:
publish_video.c *.h util/*.c
clean
:
clean
:
rm
-f
${
TARGETS
}
rm
-f
${
TARGETS
}
This diff is collapsed.
Click to expand it.
publish_video.c
0 → 100644
+
28
−
0
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
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment