Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Commit ad45ffe

Browse files
authored
Merge pull request #123 from xwu2git/master
fix font file path
2 parents b7a654d + 6d19d18 commit ad45ffe

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

ad-insertion/ad-segment/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
FROM openvisualcloud/xeon-ubuntu1804-media-ffmpeg:20.1
3-
RUN apt-get update && apt-get install -y -q youtube-dl bc wget && rm -rf /var/lib/apt/lists/*;
3+
RUN apt-get update && apt-get install -y -q bc && rm -rf /var/lib/apt/lists/*;
44

55
####
66
ARG USER

ad-insertion/ad-segment/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ case "$(cat /proc/1/sched | head -n 1)" in
1212
clip_name="${clip/*\//}"
1313
#echo $clip_name
1414
if test ! -f "segment/archive/$clip_name"; then
15-
ffmpeg -i "archive/$clip_name" -vf "scale=1920:960,pad=1920:1080:0:60:black,drawtext=text='Server-Side AD Insertion':x=(w-text_w)/2:y=(h-text_h)/3:fontsize=100:fontcolor=white" -y "segment/archive/$clip_name"
15+
ffmpeg -i "archive/$clip_name" -vf "scale=1920:960,pad=1920:1080:0:60:black,drawtext=text='Server-Side AD Insertion':x=(w-text_w)/2:y=(h-text_h)/3:fontsize=100:fontcolor=white:fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" -y "segment/archive/$clip_name"
1616
fi
1717
if test "$1" == "dash"; then
1818
/home/create_dash.sh "$clip_name" ${2} &

ad-insertion/ad-static/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
FROM ubuntu:18.04
3-
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q ffmpeg
2+
FROM openvisualcloud/xeon-ubuntu1804-media-ffmpeg:20.1
43

54
####
65
ARG USER

ad-insertion/ad-static/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ case "$(cat /proc/1/sched | head -n 1)" in
3737
fi
3838

3939
if test ! -f ${h}p_000.ts; then
40-
ffmpeg -f lavfi -i anullsrc=sample_rate=48000 -f lavfi -i color=c=blue:s=$s:d=$DE -vf "drawtext=text='Server-Side AD Insertion':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=45:fontcolor_expr=ffffff%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }" -shortest -c:a aac -c:v libx264 -g ${FR} -keyint_min ${FR} -f hls -hls_segment_filename ${h}p_%03d.ts -hls_time $SEG -y -hls_list_size $((DE/SEG)) ${h}p.m3u8
40+
ffmpeg -f lavfi -i anullsrc=sample_rate=48000 -f lavfi -i color=c=blue:s=$s:d=$DE -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:text='Server-Side AD Insertion':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=45:fontcolor_expr=ffffff%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }" -shortest -c:a aac -c:v libx264 -g ${FR} -keyint_min ${FR} -f hls -hls_segment_filename ${h}p_%03d.ts -hls_time $SEG -y -hls_list_size $((DE/SEG)) ${h}p.m3u8
4141
fi
4242
if test ! -f ${h}p-chunk-stream1-00001.m4s; then
43-
ffmpeg -f lavfi -i anullsrc=sample_rate=48000 -f lavfi -i color=c=blue:s=$s:d=$DE -vf "drawtext=text='Server-Side AD Insertion':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=45:fontcolor_expr=ffffff%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }" -shortest -c:a aac -c:v libx264 -g ${FR} -keyint_min ${FR} -f dash -init_seg_name ${h}p-'init-stream$RepresentationID$.m4s' -media_seg_name ${h}p-'chunk-stream$RepresentationID$-$Number%05d$.m4s' -use_template 1 -min_seg_duration ${SEG_DASH} -use_timeline 0 -y ${h}p.mpd
43+
ffmpeg -f lavfi -i anullsrc=sample_rate=48000 -f lavfi -i color=c=blue:s=$s:d=$DE -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:text='Server-Side AD Insertion':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=45:fontcolor_expr=ffffff%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }" -shortest -c:a aac -c:v libx264 -g ${FR} -keyint_min ${FR} -f dash -init_seg_name ${h}p-'init-stream$RepresentationID$.m4s' -media_seg_name ${h}p-'chunk-stream$RepresentationID$-$Number%05d$.m4s' -use_template 1 -min_seg_duration ${SEG_DASH} -use_timeline 0 -y ${h}p.mpd
4444
fi
4545
done
4646
;;

0 commit comments

Comments
 (0)