diff --git a/docker_prepare_assets.sh b/docker_prepare_assets.sh index 446e131..176d2f9 100755 --- a/docker_prepare_assets.sh +++ b/docker_prepare_assets.sh @@ -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 diff --git a/generate_cmaf.sh b/media/generate_cmaf.sh similarity index 92% rename from generate_cmaf.sh rename to media/generate_cmaf.sh index b005405..0e070db 100755 --- a/generate_cmaf.sh +++ b/media/generate_cmaf.sh @@ -19,7 +19,7 @@ set -e -cmaf_path=test-materials/cmaf +cmaf_path=$test_materials_path/cmaf function make_cmaf { local input=$1 @@ -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 diff --git a/generate_dash.sh b/media/generate_dash.sh similarity index 91% rename from generate_dash.sh rename to media/generate_dash.sh index a87b8ca..9107d33 100755 --- a/generate_dash.sh +++ b/media/generate_dash.sh @@ -19,7 +19,7 @@ set -e -dash_path=test-materials/dash +dash_path=$test_materials_path/dash function make_fmp4_dash { local input=$1 @@ -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 @@ -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 diff --git a/generate_hls.sh b/media/generate_hls.sh similarity index 98% rename from generate_hls.sh rename to media/generate_hls.sh index 749bb92..35b6a7b 100755 --- a/generate_hls.sh +++ b/media/generate_hls.sh @@ -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 @@ -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 \ diff --git a/generate_progressive.sh b/media/generate_progressive.sh similarity index 100% rename from generate_progressive.sh rename to media/generate_progressive.sh diff --git a/mpd_processor.py b/media/mpd_processor.py similarity index 100% rename from mpd_processor.py rename to media/mpd_processor.py diff --git a/prepare_media_assets.sh b/media/prepare_media_assets.sh similarity index 69% rename from prepare_media_assets.sh rename to media/prepare_media_assets.sh index 4c8c88d..b42000e 100755 --- a/prepare_media_assets.sh +++ b/media/prepare_media_assets.sh @@ -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 @@ -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!" diff --git a/subs_generator.py b/media/subs_generator.py similarity index 100% rename from subs_generator.py rename to media/subs_generator.py