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
96b62209
Commit
96b62209
authored
6 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
simple_live_transcode: Added left2mono, downmix2mono and normalize options
parent
8346a4b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
simple_live_transcode.c
+11
-2
11 additions, 2 deletions
simple_live_transcode.c
with
11 additions
and
2 deletions
simple_live_transcode.c
+
11
−
2
View file @
96b62209
...
...
@@ -18,7 +18,7 @@ static void copy_to_log(int fd)
int
main
(
int
argc
,
char
*
argv
[])
{
int
ret
,
canceled
=
0
,
errpipe
[
2
]
=
{
-
1
,
-
1
};
char
*
src
,
*
dest
;
char
*
src
,
*
dest
,
*
options
,
*
afilter
;
pid_t
pid
;
struct
pollfd
fds
=
{.
fd
=
-
1
,
.
events
=
POLLIN
};
if
(
argc
!=
5
)
...
...
@@ -28,7 +28,15 @@ int main(int argc, char *argv[])
jobid
=
atoi
(
argv
[
1
]);
src
=
jstr
(
jlookup
(
argv
[
4
],
"src"
),
"rtmp://127.0.0.1:999999/nourl"
);
dest
=
jstr
(
jlookup
(
argv
[
4
],
"destbase"
),
"rtmp://127.0.0.1:999999/nourl"
);
options
=
jlookup
(
argv
[
4
],
"options"
);
afilter
=
""
;
if
(
jint
(
jlookup
(
options
,
"left2mono"
),
0
))
afilter
=
mprintf
(
"%span=mono|c0=c0,"
,
afilter
);
else
if
(
jint
(
jlookup
(
options
,
"downmix2mono"
),
0
))
afilter
=
mprintf
(
"%span=mono|c0=0.5*c0+0.5*c1,"
,
afilter
);
if
(
jint
(
jlookup
(
options
,
"normalize"
),
0
))
afilter
=
mprintf
(
"%sloudnorm,"
,
afilter
);
pipe
(
errpipe
);
if
(
!
(
pid
=
fork
()))
{
...
...
@@ -37,7 +45,8 @@ int main(int argc, char *argv[])
dup2
(
open
(
"/dev/null"
,
O_RDONLY
|
O_CLOEXEC
),
0
);
dup2
(
open
(
"/dev/null"
,
O_WRONLY
|
O_CLOEXEC
),
1
);
execlp
(
"ffmpeg"
,
"ffmpeg"
,
"-nostats"
,
"-i"
,
src
,
"-filter_complex"
,
mprintf
(
"[0:a]asplit=3[lowa][mida][higha]; movie=%s/video-logo-150px-trans.png,scale=w=100:h=100[logo]; [0:v]yadif,scale=1920:1080[tmp]; [tmp][logo]overlay=x=W-195:y=H-155,split=3[lowtmp][midtmp][high]; [lowtmp]scale=640:360[low]; [midtmp]scale=1280:720[mid]"
,
getenv
(
WORKER_RAW
)),
mprintf
(
"[0:a]%sasplit=3[lowa][mida][higha]; movie=%s/video-logo-150px-trans.png,scale=w=100:h=100[logo]; [0:v]yadif,scale=1920:1080[tmp]; [tmp][logo]overlay=x=W-195:y=H-155,split=3[lowtmp][midtmp][high]; [lowtmp]scale=640:360[low]; [midtmp]scale=1280:720[mid]"
,
afilter
,
getenv
(
WORKER_RAW
)),
"-map"
,
"[low]"
,
"-map"
,
"[lowa]"
,
OUTPUT_FORMAT
(
"512k"
),
mprintf
(
"%s_low"
,
dest
),
"-map"
,
"[mid]"
,
"-map"
,
"[mida]"
,
OUTPUT_FORMAT
(
"2024k"
),
mprintf
(
"%s_mid"
,
dest
),
"-map"
,
"[high]"
,
"-map"
,
"[higha]"
,
OUTPUT_FORMAT
(
"6024k"
),
mprintf
(
"%s_high"
,
dest
),
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