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

Commit

Permalink
Merge pull request #123 from xwu2git/master
Browse files Browse the repository at this point in the history
fix font file path
  • Loading branch information
xwu2git authored Jan 15, 2020
2 parents b7a654d + 6d19d18 commit ad45ffe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ad-insertion/ad-segment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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

####
ARG USER
Expand Down
2 changes: 1 addition & 1 deletion ad-insertion/ad-segment/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ case "$(cat /proc/1/sched | head -n 1)" in
clip_name="${clip/*\//}"
#echo $clip_name
if test ! -f "segment/archive/$clip_name"; then
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"
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"
fi
if test "$1" == "dash"; then
/home/create_dash.sh "$clip_name" ${2} &
Expand Down
3 changes: 1 addition & 2 deletions ad-insertion/ad-static/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

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

####
ARG USER
Expand Down
4 changes: 2 additions & 2 deletions ad-insertion/ad-static/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ case "$(cat /proc/1/sched | head -n 1)" in
fi

if test ! -f ${h}p_000.ts; then
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
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
fi
if test ! -f ${h}p-chunk-stream1-00001.m4s; then
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
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
fi
done
;;
Expand Down

0 comments on commit ad45ffe

Please sign in to comment.