Skip to content

Commit

Permalink
Create a new config file with urls to videos using for creating media…
Browse files Browse the repository at this point in the history
… assets. (#13)

* Create a new config file with urls to videos using for creating media assets.

* Remove unneccesary "BBB" and "TOS" from progressive test names
  • Loading branch information
lukasz-rutkowski-red authored Jul 6, 2022
1 parent c3d653c commit 54b5ec6
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 81 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
FROM httpd:latest

ARG MVT_PATH=/usr/local/apache2/htdocs
ENV MVT_PATH=$MVT_PATH

COPY . $MVT_PATH
WORKDIR $MVT_PATH
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ MVT introduces new tests, integration of MSE players and various media assets.

# Populate |TEST_MATERIALS_SRC| with media assets.
# Existing assets won't be overridden.
# If you want to use your own videos, you need to change URL's in media/media_urls.config,
# movies needs to be longer than 2 minutes and can be in any video format.
# Runs withing running container (mvt-app) and takes ~30 minutes on decent PC.
./docker_prepare_assets.sh

Expand Down Expand Up @@ -154,11 +156,10 @@ Most of the URL parameters can be combined. Here's a full list of supported quer
- dash-html5-test
- dash-shaka-test
- dash-dashjs-test
- dash-playready-shaka-test
- dash-playready-dashjs-test
- hls-shaka-test
- hls-hlsjs-test
- hss-html5-test
- hss-dashjs-test
- progressive-html5-test
- `command=run` - test run autostart. Please note it may not work on desktop browser, because they tend to block autoplay before user interaction.
- `tests=ID[,ID]|ID-ID2` - tests subset selection. Expected values:
Expand Down
6 changes: 3 additions & 3 deletions media/generate_cmaf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ function make_cmaf {
fi
}

make_cmaf $progressive_path/tos_h264_aac.mp4 libx264 ac3 $cmaf_path/h264_ac3
make_cmaf $progressive_path/tos_h264_aac.mp4 hevc eac3 $cmaf_path/hevc_eac3
make_cmaf $progressive_path/vid2_h264_aac.mp4 libx264 ac3 $cmaf_path/h264_ac3
make_cmaf $progressive_path/vid2_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
make_cmaf $progressive_path/vid2_h264_aac.mp4 libx264 mp3 $cmaf_path/h264_mp3
python3 $media_path/mpd_processor.py add_subtitles $cmaf_path/h264_mp3/manifest.mpd vtt $cmaf_path/h264_mp3/manifest_vtt.mpd
fi
18 changes: 9 additions & 9 deletions media/generate_dash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,34 +81,34 @@ function make_webm_dash {
fi
}

make_fmp4_dash $progressive_path/bbb_h264_aac.mp4 libx264 aac $dash_path/fmp4_h264_aac
make_fmp4_dash $progressive_path/bbb_h264_aac.mp4 libx264 ac3 $dash_path/fmp4_h264_ac3
make_fmp4_dash $progressive_path/bbb_h264_aac.mp4 libx265 eac3 $dash_path/fmp4_hevc_eac3
make_fmp4_dash $progressive_path/vid1_h264_aac.mp4 libx264 aac $dash_path/fmp4_h264_aac
make_fmp4_dash $progressive_path/vid1_h264_aac.mp4 libx264 ac3 $dash_path/fmp4_h264_ac3
make_fmp4_dash $progressive_path/vid1_h264_aac.mp4 libx265 eac3 $dash_path/fmp4_hevc_eac3

# fMP4 with single MP3 track (audio only)
if [ ! -f $dash_path/fmp4_mp3/manifest.mpd ]; then
mkdir -p $dash_path/fmp4_mp3
ffmpeg -i $progressive_path/tos_h264_aac.mp4 \
ffmpeg -i $progressive_path/vid2_h264_aac.mp4 \
-vn -c:a mp3 -streaming 1 -use_timeline 1 -seg_duration 5 \
-dash_segment_type mp4 -f dash $dash_path/fmp4_mp3/manifest.mpd
fi

# MPEG-2 video codec with codec name changed from mp4v.61 to mpeg in the manifest.
if [ ! -f $dash_path/fmp4_mpeg2_mp3/manifest.mpd ]; then
make_fmp4_dash $progressive_path/bbb_h264_aac.mp4 mpeg2video mp3 $dash_path/fmp4_mpeg2_mp3 "-s:v:0 640x360 -b:v:0 2500k"
make_fmp4_dash $progressive_path/vid1_h264_aac.mp4 mpeg2video mp3 $dash_path/fmp4_mpeg2_mp3 "-s:v:0 640x360 -b:v:0 2500k"
sed -i 's/codecs="mp4v.61"/codecs="mpeg"/g' $dash_path/fmp4_mpeg2_mp3/manifest.mpd
fi

# Multiple periods (20s long period multiplied 6 times)
if [ ! -f $dash_path/multiperiod/manifest.mpd ]; then
make_fmp4_dash $progressive_path/bbb_h264_aac.mp4 libx264 aac $dash_path/multiperiod "-t 20"
make_fmp4_dash $progressive_path/vid1_h264_aac.mp4 libx264 aac $dash_path/multiperiod "-t 20"
mv $dash_path/multiperiod/manifest.mpd $dash_path/multiperiod/single_period.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
mkdir -p $dash_path/fmp4_multiaudio
ffmpeg -i $progressive_path/bbb_h264_aac.mp4 -i $progressive_path/tos_h264_aac.mp4 \
ffmpeg -i $progressive_path/vid1_h264_aac.mp4 -i $progressive_path/vid2_h264_aac.mp4 \
-map 0:v:0 -map 0:a:0 -map 1:a:0 \
-b:v:0 1000k -c:v:1 h264 -filter:v:1 "scale=640:-1" -g 96 -keyint_min 24 \
-b:a:0 192k -c:a:0 aac -metadata:s:a:0 language=en \
Expand All @@ -120,13 +120,13 @@ 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
make_webm_dash $progressive_path/vid2_h264_aac.mp4 $dash_path/webm_vp9_opus
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
make_fmp4_dash $progressive_path/vid2_h264_aac.mp4 libx264 aac $dash_path/fmp4_h264_aac_ttml
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
12 changes: 6 additions & 6 deletions media/generate_hls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ function make_hls {
fi
}

make_hls $progressive_path/bbb_h264_aac.mp4 mpegts libx264 copy $hls_path/mpegts_h264_aac
make_hls $progressive_path/bbb_h264_aac.mp4 fmp4 libx264 eac3 $hls_path/fmp4_h264_eac3
make_hls $progressive_path/tos_h264_aac.mp4 fmp4 hevc ac3 $hls_path/fmp4_hevc_ac3
make_fmp4_audio_hls $progressive_path/tos_h264_aac.mp4 mp3 $hls_path/fmp4_mp3
make_hls $progressive_path/vid1_h264_aac.mp4 mpegts libx264 copy $hls_path/mpegts_h264_aac
make_hls $progressive_path/vid1_h264_aac.mp4 fmp4 libx264 eac3 $hls_path/fmp4_h264_eac3
make_hls $progressive_path/vid2_h264_aac.mp4 fmp4 hevc ac3 $hls_path/fmp4_hevc_ac3
make_fmp4_audio_hls $progressive_path/vid2_h264_aac.mp4 mp3 $hls_path/fmp4_mp3

# Two audio tracks with different languages
if [ ! -f $hls_path/fmp4_multiaudio/main.m3u8 ]; then
mkdir -p $hls_path/fmp4_multiaudio
ffmpeg -i $progressive_path/bbb_h264_aac.mp4 -i $progressive_path/tos_h264_aac.mp4 \
ffmpeg -i $progressive_path/vid1_h264_aac.mp4 -i $progressive_path/vid2_h264_aac.mp4 \
-map 0:v:0 -map 0:a:0 -map 1:a:0 \
-b:v:0 1000k -c:v:1 copy -filter:v:1 "scale=640:-1" -g 96 -keyint_min 24 \
-b:a:0 192k -c:a:0 copy -metadata:s:a:0 language=en \
Expand All @@ -90,7 +90,7 @@ fi
# WebVTT subtitles
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 \
ffmpeg -i $progressive_path/vid2_h264_aac.mp4 \
-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" \
Expand Down
28 changes: 14 additions & 14 deletions media/generate_progressive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,38 @@ function convert_video_codec {
fi
}

convert_container $progressive_path/bbb_h264_aac.mp4 $progressive_path/bbb_h264_aac.mkv
convert_container $progressive_path/vid1_h264_aac.mp4 $progressive_path/vid1_h264_aac.mkv

# create alternative audio codec versions
codecs="ac3 eac3 mp3"
for codec in $codecs; do
convert_audio_codec $progressive_path/bbb_h264_aac.mp4 "$progressive_path/bbb_h264_${codec}.mp4" $codec
convert_audio_codec $progressive_path/bbb_h264_aac.mkv "$progressive_path/bbb_h264_${codec}.mkv" $codec
convert_audio_codec $progressive_path/vid1_h264_aac.mp4 "$progressive_path/vid1_h264_${codec}.mp4" $codec
convert_audio_codec $progressive_path/vid1_h264_aac.mkv "$progressive_path/vid1_h264_${codec}.mkv" $codec
done

# create alternative video codec versions
codecs="mpeg2video vp9 mpeg4 hevc"
for codec in $codecs; do
convert_video_codec $progressive_path/bbb_h264_aac.mp4 "$progressive_path/bbb_${codec}_aac.mp4" $codec
convert_video_codec $progressive_path/bbb_h264_aac.mkv "$progressive_path/bbb_${codec}_aac.mkv" $codec
convert_video_codec $progressive_path/vid1_h264_aac.mp4 "$progressive_path/vid1_${codec}_aac.mp4" $codec
convert_video_codec $progressive_path/vid1_h264_aac.mkv "$progressive_path/vid1_${codec}_aac.mkv" $codec
done

# For subtitles test
convert_container $progressive_path/tos_h264_aac.mp4 $progressive_path/tos_h264_aac.mkv
convert_container $progressive_path/vid2_h264_aac.mp4 $progressive_path/vid2_h264_aac.mkv

# audio only
if [ ! -f "$progressive_path/tos_eac3.mp4" ]; then
ffmpeg -y -i $progressive_path/tos_h264_aac.mp4 -acodec "eac3" -movflags faststart -vn "$progressive_path/tos_eac3.mp4"
if [ ! -f "$progressive_path/vid2_eac3.mp4" ]; then
ffmpeg -y -i $progressive_path/vid2_h264_aac.mp4 -acodec "eac3" -movflags faststart -vn "$progressive_path/vid2_eac3.mp4"
fi
convert_container $progressive_path/tos_eac3.mp4 "$progressive_path/tos_eac3.mkv"
convert_container $progressive_path/vid2_eac3.mp4 "$progressive_path/vid2_eac3.mkv"

# video only
if [ ! -f "$progressive_path/tos_h264.mp4" ]; then
ffmpeg -y -i $progressive_path/tos_h264_aac.mp4 -an -vcodec copy "$progressive_path/tos_h264.mp4"
if [ ! -f "$progressive_path/vid2_h264.mp4" ]; then
ffmpeg -y -i $progressive_path/vid2_h264_aac.mp4 -an -vcodec copy "$progressive_path/vid2_h264.mp4"
fi
convert_container $progressive_path/tos_h264.mp4 $progressive_path/tos_h264.mkv
convert_container $progressive_path/vid2_h264.mp4 $progressive_path/vid2_h264.mkv

# MP3 container
if [ ! -f "$progressive_path/tos_mp3.mp3" ]; then
ffmpeg -y -i $progressive_path/tos_h264_aac.mp4 -acodec mp3 -vn "$progressive_path/tos_mp3.mp3"
if [ ! -f "$progressive_path/vid2_mp3.mp3" ]; then
ffmpeg -y -i $progressive_path/vid2_h264_aac.mp4 -acodec mp3 -vn "$progressive_path/vid2_mp3.mp3"
fi
2 changes: 2 additions & 0 deletions media/media_urls.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
url_video1="https://mirrors.dotsrc.org/blender/blender-demo/movies/BBB/bbb_sunflower_1080p_30fps_normal.mp4"
url_video2="http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov"
8 changes: 5 additions & 3 deletions media/prepare_media_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

set -e

source $MVT_PATH/media/media_urls.config

export root_dir="$(dirname $(dirname "$(readlink -f "$0")"))"
export test_materials_path=$root_dir/test-materials
export media_path=$root_dir/media
Expand All @@ -37,7 +39,7 @@ function download_progressive_stream {
local tmp_stream="${progressive_path}/.tmp_stream"
if [ ! -f $target_filename ]; then
echo "Downloading $1 into $target_filename"
wget $url -O $tmp_stream
wget $url --no-check-certificate -O $tmp_stream
ffmpeg -ss 00:00:00.000 -i $tmp_stream -t 120 \
-vcodec h264 -vf scale=1280:720,fps=24 -movflags faststart \
-acodec aac -ac 2 \
Expand All @@ -51,8 +53,8 @@ function download_progressive_stream {

mkdir -p $progressive_path

download_progressive_stream "https://mirrors.dotsrc.org/blender/blender-demo/movies/BBB/bbb_sunflower_1080p_30fps_normal.mp4" "bbb"
download_progressive_stream "http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov" "tos"
download_progressive_stream $url_video1 "vid1"
download_progressive_stream $url_video2 "vid2"

# Prepare subtitles
mkdir -p $test_materials_path/subtitles
Expand Down
Loading

0 comments on commit 54b5ec6

Please sign in to comment.