Commit fee17fa3 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Add hls test (needs to be run manually for now).

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 93997efb
......@@ -4,7 +4,7 @@ check: detect-speed-test block-decoder-test clip-decoder-test \
EXTRA_DIST = detect-speed-test.sh block-decoder-test.sh clip-decoder-test.sh \
pipe-test.sh short-payload-test.sh sync-test.sh sample-rate-test.sh \
key-test.sh
key-test.sh hls-test.sh
detect-speed-test:
Q=1 $(top_srcdir)/tests/detect-speed-test.sh
......
#!/bin/bash
source test-common.sh
if [ "x$Q" == "x1" ] && [ -z "$V" ]; then
FFMPEG_Q="-v quiet"
fi
set -e
HLS_DIR=hls-test
mkdir -p $HLS_DIR
# generate input sample
audiowmark test-gen-noise $HLS_DIR/test-input.wav 200 44100
# convert to hls
ffmpeg $FFMPEG_Q -i $HLS_DIR/test-input.wav \
-f hls \
-c:a:0 aac -ab 192k \
-master_pl_name replay.m3u8 \
-hls_list_size 0 -hls_time 10 $HLS_DIR/as%v/out.m3u8
# prepare hls segments for watermarking
audiowmark hls-prepare $HLS_DIR/as0 $HLS_DIR/as0prep out.m3u8 $HLS_DIR/test-input.wav
# watermark hls segments individually
mkdir -p $HLS_DIR/as0m
for i in $(cd $HLS_DIR/as0; ls out*.ts)
do
audiowmark hls-add $HLS_DIR/as0prep/$i $HLS_DIR/as0m/$i $TEST_MSG
done
cp $HLS_DIR/as0/out.m3u8 $HLS_DIR/as0m/out.m3u8
# convert watermarked hls back to wav
ffmpeg $FFMPEG_Q -y -i $HLS_DIR/as0m/out.m3u8 $HLS_DIR/test-output.wav
# detect watermark from wav
audiowmark_cmp --expect-matches 5 $HLS_DIR/test-output.wav $TEST_MSG
rm hls-test/as0*/*.ts
rm hls-test/as0*/out.m3u8
rmdir hls-test/as0*
rm hls-test/test-*.wav
rm hls-test/replay.m3u8
rmdir hls-test
exit 0
......@@ -18,7 +18,7 @@ audiowmark()
else
echo >&2 ==== audiowmark "$@" ====
fi
$AUDIOWMARK --strict "$@" || die "failed to run audiowmark $@"
$AUDIOWMARK $AUDIOWMARK_Q --strict "$@" || die "failed to run audiowmark $@"
}
audiowmark_add()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment