Skip to content

Commit

Permalink
Move assets generation to |media| directory
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-kolanski-red committed Jun 24, 2022
1 parent e8954ac commit c6fbb82
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docker_prepare_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

docker exec -it mvt-app ./prepare_media_assets.sh
docker exec -it mvt-app ./media/prepare_media_assets.sh
4 changes: 2 additions & 2 deletions generate_cmaf.sh → media/generate_cmaf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

set -e

cmaf_path=test-materials/cmaf
cmaf_path=$test_materials_path/cmaf

function make_cmaf {
local input=$1
Expand Down Expand Up @@ -49,5 +49,5 @@ make_cmaf $progressive_path/tos_h264_aac.mp4 hevc eac3 $cmaf_path/hevc_eac3
# h264+mp3 with VTT subtitles for DASH
if [ ! -f $cmaf_path/h264_mp3/manifest_vtt.mpd ]; then
make_cmaf $progressive_path/tos_h264_aac.mp4 libx264 mp3 $cmaf_path/h264_mp3
python3 mpd_processor.py add_subtitles $cmaf_path/h264_mp3/manifest.mpd vtt $cmaf_path/h264_mp3/manifest_vtt.mpd
python3 $media_path/mpd_processor.py add_subtitles $cmaf_path/h264_mp3/manifest.mpd vtt $cmaf_path/h264_mp3/manifest_vtt.mpd
fi
9 changes: 5 additions & 4 deletions generate_dash.sh → media/generate_dash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

set -e

dash_path=test-materials/dash
dash_path=$test_materials_path/dash

function make_fmp4_dash {
local input=$1
Expand Down Expand Up @@ -103,7 +103,7 @@ fi
if [ ! -f $dash_path/multiperiod/manifest.mpd ]; then
make_fmp4_dash $progressive_path/bbb_h264_aac.mp4 libx264 aac $dash_path/multiperiod "-t 20"
mv $dash_path/multiperiod/manifest.mpd $dash_path/multiperiod/single_period.mpd
python3 mpd_processor.py multiperiod $dash_path/multiperiod/single_period.mpd 20 6 $dash_path/multiperiod/manifest.mpd
python3 $media_path/mpd_processor.py multiperiod $dash_path/multiperiod/single_period.mpd 20 6 $dash_path/multiperiod/manifest.mpd
fi

if [ ! -f $dash_path/fmp4_multiaudio/manifest.mpd ]; then
Expand All @@ -121,11 +121,12 @@ fi
# WEBM with VTT subtitles
if [ ! -f $dash_path/webm_vp9_opus/manifest_vtt.mpd ]; then
make_webm_dash $progressive_path/tos_h264_aac.mp4 $dash_path/webm_vp9_opus
python3 mpd_processor.py add_subtitles $dash_path/webm_vp9_opus/manifest.mpd vtt $dash_path/webm_vp9_opus/manifest_vtt.mpd
python3 $media_path/mpd_processor.py add_subtitles $dash_path/webm_vp9_opus/manifest.mpd vtt $dash_path/webm_vp9_opus/manifest_vtt.mpd
fi

# fMP4 with TTML subtitles
if [ ! -f $dash_path/fmp4_h264_aac_ttml/manifest_ttml.mpd ]; then
make_fmp4_dash $progressive_path/tos_h264_aac.mp4 libx264 aac $dash_path/fmp4_h264_aac_ttml
python3 mpd_processor.py add_subtitles $dash_path/fmp4_h264_aac_ttml/manifest.mpd ttml $dash_path/fmp4_h264_aac_ttml/manifest_ttml.mpd
python3 $media_path/mpd_processor.py add_subtitles $dash_path/fmp4_h264_aac_ttml/manifest.mpd ttml \
$dash_path/fmp4_h264_aac_ttml/manifest_ttml.mpd
fi
4 changes: 2 additions & 2 deletions generate_hls.sh → media/generate_hls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

set -e

hls_path=test-materials/hls
hls_path=$test_materials_path/hls

function make_fmp4_audio_hls {
local input=$1
Expand Down Expand Up @@ -91,7 +91,7 @@ fi
if [ ! -f $hls_path/fmp4_h264_aac_vtt/main.m3u8 ]; then
mkdir -p $hls_path/fmp4_h264_aac_vtt
ffmpeg -i $progressive_path/tos_h264_aac.mp4 \
-i test-materials/subtitles/countdown-en.vtt \
-i $test_materials_path/subtitles/countdown-en.vtt \
-map 0:v:0 -map 0:a:0 -map 1:s:0 \
-b:v:0 1000k -c:v:1 copy -filter:v:1 "scale=640:-1" \
-b:a:0 192k -c:a:0 copy -metadata:s:a:0 language=en \
Expand Down
File renamed without changes.
File renamed without changes.
27 changes: 15 additions & 12 deletions prepare_media_assets.sh → media/prepare_media_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

set -e

export progressive_path=test-materials/progressive
export root_dir="$(dirname $(dirname "$(readlink -f "$0")"))"
export test_materials_path=$root_dir/test-materials
export media_path=$root_dir/media
export progressive_path=$test_materials_path/progressive

echo Checking ffmpeg availability
if [ ! -x "$(command -v ffmpeg)" ]; then
Expand Down Expand Up @@ -52,17 +55,17 @@ download_progressive_stream "https://mirrors.dotsrc.org/blender/blender-demo/mov
download_progressive_stream "http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov" "tos"

# Prepare subtitles
mkdir -p test-materials/subtitles
mkdir -p test-materials/js
python3 subs_generator.py 120 en test-materials/subtitles
python3 subs_generator.py 120 de test-materials/subtitles
python3 subs_generator.py 120 fr test-materials/subtitles
python3 subs_generator.py 120 es test-materials/subtitles
mv test-materials/subtitles/*.js test-materials/js
mkdir -p $test_materials_path/subtitles
mkdir -p $test_materials_path/js
python3 $media_path/subs_generator.py 120 en $test_materials_path/subtitles
python3 $media_path/subs_generator.py 120 de $test_materials_path/subtitles
python3 $media_path/subs_generator.py 120 fr $test_materials_path/subtitles
python3 $media_path/subs_generator.py 120 es $test_materials_path/subtitles
mv $test_materials_path/subtitles/*.js $test_materials_path/js

./generate_progressive.sh
./generate_dash.sh
./generate_hls.sh
./generate_cmaf.sh
$media_path/generate_progressive.sh
$media_path/generate_dash.sh
$media_path/generate_hls.sh
$media_path/generate_cmaf.sh

echo "All test materials downloaded!"
File renamed without changes.

0 comments on commit c6fbb82

Please sign in to comment.