Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
F
ffworker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Video AG Infrastruktur
ffworker
Commits
1af75a44
Commit
1af75a44
authored
Dec 04, 2017
by
Julian Rother
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added publish_video
parent
c4fd51df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
Makefile
Makefile
+3
-1
publish_video.c
publish_video.c
+28
-0
No files found.
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
Markdown
is supported
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