Skip to content

Commit

Permalink
x264 lossless assets and fixtures
Browse files Browse the repository at this point in the history
new assets with audio
  • Loading branch information
rectalogic committed Jan 16, 2024
1 parent 08b7936 commit 5e724e5
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 43 deletions.
17 changes: 9 additions & 8 deletions src/MediaFX/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <QStringLiteral>
#include <QUrl>

const auto ffmpegPreamble = qSL("-hide_banner -loglevel warning -f rawvideo -video_size ${MEDIAFX_FRAMESIZE} -pixel_format rgb0 -framerate ${MEDIAFX_FRAMERATE} -i async:pipe:${MEDIAFX_VIDEOFD}");
const auto ffmpegPreamble = qSL(" -hide_banner -loglevel warning -f rawvideo -video_size ${MEDIAFX_FRAMESIZE} -pixel_format rgb0 -framerate ${MEDIAFX_FRAMERATE} -i async:pipe:${MEDIAFX_VIDEOFD} ");

int main(int argc, char* argv[])
{
Expand Down Expand Up @@ -61,20 +61,21 @@ int main(int argc, char* argv[])
command = parser.value(qSL("command"));
if (command == qSL("ffplay")) {
// XXX need to handle audio eventually
command = qSL("ffplay -autoexit -infbuf ") + ffmpegPreamble;
} else if (command.startsWith(qSL("ffmpeg:"))) {
command = qSL("ffplay -autoexit -infbuf") + ffmpegPreamble;
} else if (command == qSL("ffmpeg") || command.startsWith(qSL("ffmpeg:"))) {
if (!parser.isSet(qSL("output"))) {
parser.showHelp(1);
}
if (command == qSL("ffmpeg:lossless")) {
command = qSL("ffmpeg ") + ffmpegPreamble + qSL(" -f nut -vcodec ffv1 -flags bitexact -g 1 -level 3 -pix_fmt rgb32 -fflags bitexact -y ${MEDIAFX_OUTPUT}");
command = qSL("ffmpeg") + ffmpegPreamble + qSL("-f mp4 -codec:v libx264 -preset veryslow -qp 0 -y ${MEDIAFX_OUTPUT}");
} else if (command == qSL("ffmpeg:mov")) {
command = qSL("ffmpeg ") + ffmpegPreamble + qSL(" -f mov -vcodec rawvideo -pix_fmt uyvy422 -vtag yuvs -y ${MEDIAFX_OUTPUT}");
} else if (command == qSL("ffmpeg:")) {
command = qSL("ffmpeg") + ffmpegPreamble + qSL("-f mov -codec:v rawvideo -pix_fmt uyvy422 -vtag yuvs -y ${MEDIAFX_OUTPUT}");
} else if (command == qSL("ffmpeg")) {
// Let ffmpeg choose codec/format based on filename suffix
command = qSL("ffmpeg ") + ffmpegPreamble + qSL(" -y ${MEDIAFX_OUTPUT}");
command = qSL("ffmpeg") + ffmpegPreamble + qSL("-y ${MEDIAFX_OUTPUT}");
} else {
parser.showHelp(1);
// Treat arguments as encoding parameters
command = qSL("ffmpeg") + ffmpegPreamble + command.last(command.size() - qSL("ffmpeg:").size()) + qSL(" -y ${MEDIAFX_OUTPUT}");
}
}
}
Expand Down
19 changes: 9 additions & 10 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ macro(add_compile_shaders)
endmacro()

macro(add_qml_test)
cmake_parse_arguments(QML_TEST "" "NAME;OUTPUTSPEC;QMLFILE;OUTPUTFILE;THRESHOLD" "ASSETSPECS" ${ARGN})
cmake_parse_arguments(QML_TEST "" "NAME;OUTPUTSPEC;QMLFILE;OUTPUTFILE;THRESHOLD" "" ${ARGN})
add_test(NAME ${QML_TEST_NAME} COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/qmltest.sh
$<TARGET_FILE:mediafxtool>
${QML_TEST_OUTPUTSPEC}
${CMAKE_CURRENT_SOURCE_DIR}/qml/${QML_TEST_QMLFILE}
${CMAKE_CURRENT_SOURCE_DIR}/../build/${CMAKE_SYSTEM_NAME}/output/${QML_TEST_OUTPUTFILE}
${QML_TEST_THRESHOLD}
${QML_TEST_ASSETSPECS}
)
set_tests_properties(${QML_TEST_NAME} PROPERTIES DEPENDS "tst_shaders")
endmacro()
Expand All @@ -51,14 +50,14 @@ qt_add_executable(tst_encoder tst_encoder.cpp)
add_test(NAME tst_encoder COMMAND tst_encoder)
target_link_libraries(tst_encoder PRIVATE mediafx Qt::Test)

add_qml_test(NAME tst_qml_static OUTPUTSPEC 15:320x180 QMLFILE static.qml OUTPUTFILE static.nut THRESHOLD 99.999)
add_qml_test(NAME tst_qml_animated OUTPUTSPEC 15:320x180 QMLFILE animated.qml OUTPUTFILE animated.nut THRESHOLD 99.999)
add_qml_test(NAME tst_qml_video_clipstart OUTPUTSPEC 15:320x180 QMLFILE video-clipstart.qml OUTPUTFILE video-clipstart.nut THRESHOLD 99.999 ASSETSPECS nut:red:320x180:15:8)
add_qml_test(NAME tst_qml_multisink OUTPUTSPEC 30:640x360 QMLFILE multisink.qml OUTPUTFILE multisink.nut THRESHOLD 99.999 ASSETSPECS nut:red:640x360:30:4 png:red:160x120)
add_qml_test(NAME tst_qml_video_ad_insertion OUTPUTSPEC 30:320x180 QMLFILE video-ad-insertion.qml OUTPUTFILE video-ad-insertion.nut THRESHOLD 99.999 ASSETSPECS nut:red:320x180:15:8 nut:blue:320x180:30:3)
add_qml_test(NAME tst_qml_video_multieffect OUTPUTSPEC 30:320x180 QMLFILE video-multieffect.qml OUTPUTFILE video-multieffect.nut THRESHOLD 99.999 ASSETSPECS nut:blue:320x180:30:3)
add_qml_test(NAME tst_qml_video_shadereffect OUTPUTSPEC 30:320x180 QMLFILE video-shadereffect.qml OUTPUTFILE video-shadereffect.nut THRESHOLD 99.999 ASSETSPECS nut:blue:320x180:30:3)
add_qml_test(NAME tst_qml_sequence OUTPUTSPEC 15:320x180 QMLFILE sequence.qml OUTPUTFILE sequence.nut THRESHOLD 98.999 ASSETSPECS nut:red:320x180:15:8 nut:green:320x180:15:3 nut:yellow:320x180:15:3 png:red:160x120)
add_qml_test(NAME tst_qml_static OUTPUTSPEC 15:320x180 QMLFILE static.qml OUTPUTFILE static.mp4 THRESHOLD 99.999)
add_qml_test(NAME tst_qml_animated OUTPUTSPEC 15:320x180 QMLFILE animated.qml OUTPUTFILE animated.mp4 THRESHOLD 99.999)
add_qml_test(NAME tst_qml_video_clipstart OUTPUTSPEC 15:320x180 QMLFILE video-clipstart.qml OUTPUTFILE video-clipstart.mp4 THRESHOLD 99.999)
add_qml_test(NAME tst_qml_multisink OUTPUTSPEC 30:640x360 QMLFILE multisink.qml OUTPUTFILE multisink.mp4 THRESHOLD 99.999)
add_qml_test(NAME tst_qml_video_ad_insertion OUTPUTSPEC 30:320x180 QMLFILE video-ad-insertion.qml OUTPUTFILE video-ad-insertion.mp4 THRESHOLD 99.999)
add_qml_test(NAME tst_qml_video_multieffect OUTPUTSPEC 30:320x180 QMLFILE video-multieffect.qml OUTPUTFILE video-multieffect.mp4 THRESHOLD 99.999)
add_qml_test(NAME tst_qml_video_shadereffect OUTPUTSPEC 30:320x180 QMLFILE video-shadereffect.qml OUTPUTFILE video-shadereffect.mp4 THRESHOLD 99.999)
add_qml_test(NAME tst_qml_sequence OUTPUTSPEC 15:320x180 QMLFILE sequence.qml OUTPUTFILE sequence.mp4 THRESHOLD 98.999)

# Label tests that require a GPU
set_tests_properties(tst_qml_static tst_qml_animated tst_qml_video_clipstart tst_qml_multisink tst_qml_video_ad_insertion tst_qml_video_multieffect tst_qml_video_shadereffect tst_qml_sequence PROPERTIES LABELS GPU)
2 changes: 1 addition & 1 deletion tests/fixtures
Submodule fixtures updated 48 files
+ animated.mp4
+40 −0 animated.mp4.framehash
+ animated.nut
+0 −41 animated.nut.framehash
+ assets/bbbjumprope-320x180-15fps-5.5s.mp4
+ assets/blue-320x180-30fps-3s.mp4
+ assets/blue-320x180-30fps-3s.nut
+ assets/cosmosregret-320x134par-15fps-5.3s.mp4
+ assets/edjustforyou-320x180-15fps-5.2s.mp4
+ assets/ednotsafe-320x180-15fps-1.53s.mp4
+ assets/edquestions-320x180-15fps-2.4s.mp4
+ assets/green-320x180-15fps-3s.mp4
+ assets/green-320x180-15fps-3s.nut
+ assets/red-160x120.png
+ assets/red-320x180-15fps-8s.mp4
+ assets/red-320x180-15fps-8s.nut
+ assets/red-640x360-30fps-4s.mp4
+ assets/red-640x360-30fps-4s.nut
+ assets/yellow-320x180-15fps-3s.mp4
+ assets/yellow-320x180-15fps-3s.nut
+ multisink.mp4
+40 −0 multisink.mp4.framehash
+ multisink.nut
+0 −41 multisink.nut.framehash
+ sequence.mp4
+209 −0 sequence.mp4.framehash
+ sequence.nut
+0 −179 sequence.nut.framehash
+ static.mp4
+10 −0 static.mp4.framehash
+ static.nut
+0 −11 static.nut.framehash
+ video-ad-insertion.mp4
+341 −0 video-ad-insertion.mp4.framehash
+ video-ad-insertion.nut
+0 −342 video-ad-insertion.nut.framehash
+ video-clipstart.mp4
+54 −0 video-clipstart.mp4.framehash
+ video-clipstart.nut
+0 −55 video-clipstart.nut.framehash
+ video-multieffect.mp4
+100 −0 video-multieffect.mp4.framehash
+ video-multieffect.nut
+0 −101 video-multieffect.nut.framehash
+ video-shadereffect.mp4
+100 −0 video-shadereffect.mp4.framehash
+ video-shadereffect.nut
+0 −101 video-shadereffect.nut.framehash
2 changes: 1 addition & 1 deletion tests/qml/multisink.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Item {
id: videoClip

startTime: 3000
source: Qt.resolvedUrl("../fixtures/assets/red-640x360-30fps-4s.nut")
source: Qt.resolvedUrl("../fixtures/assets/red-640x360-30fps-4s.mp4")

Component.onCompleted: {
videoClip.clipEnded.connect(MediaManager.finishEncoding);
Expand Down
16 changes: 12 additions & 4 deletions tests/qml/sequence.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Item {
WipeMixer {
direction: WipeMixer.Direction.Right
transitionWidth: 2.0
},
WipeMixer {
direction: WipeMixer.Direction.Left
blindsEffect: 0.05
}
]

Expand All @@ -30,21 +34,25 @@ Item {
}

MediaClip {
source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.nut")
source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.mp4")
}
MediaClip {
endTime: 3000
source: Qt.resolvedUrl("../fixtures/assets/red-320x180-15fps-8s.nut")
source: Qt.resolvedUrl("../fixtures/assets/red-320x180-15fps-8s.mp4")
}
MediaClip {
source: Qt.resolvedUrl("../fixtures/assets/green-320x180-15fps-3s.nut")
source: Qt.resolvedUrl("../fixtures/assets/green-320x180-15fps-3s.mp4")
}
MediaClip {
endTime: 3000
source: Qt.resolvedUrl("../fixtures/assets/red-160x120.png")
}
MediaClip {
source: Qt.resolvedUrl("../fixtures/assets/yellow-320x180-15fps-3s.nut")
source: Qt.resolvedUrl("../fixtures/assets/yellow-320x180-15fps-3s.mp4")
}
MediaClip {
endTime: 3000
source: Qt.resolvedUrl("../fixtures/assets/edjustforyou-320x180-15fps-5.2s.mp4")
}
}
}
4 changes: 2 additions & 2 deletions tests/qml/video-ad-insertion.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Item {
MediaClip {
id: videoClip

source: Qt.resolvedUrl("../fixtures/assets/red-320x180-15fps-8s.nut")
source: Qt.resolvedUrl("../fixtures/assets/red-320x180-15fps-8s.mp4")

Component.onCompleted: {
// End encoding when main videoClip finishes
Expand All @@ -19,7 +19,7 @@ Item {
MediaClip {
id: adClip

source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.nut")
source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.mp4")

// Switch back to default state when ad ends - main videoClip playing
onClipEnded: videoOutput.state = ""
Expand Down
2 changes: 1 addition & 1 deletion tests/qml/video-clipstart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Item {
id: videoClip

startTime: 5000
source: Qt.resolvedUrl("../fixtures/assets/red-320x180-15fps-8s.nut")
source: Qt.resolvedUrl("../fixtures/assets/red-320x180-15fps-8s.mp4")

Component.onCompleted: {
videoClip.clipEnded.connect(MediaManager.finishEncoding);
Expand Down
2 changes: 1 addition & 1 deletion tests/qml/video-multieffect.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Item {
MediaClip {
id: videoClip

source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.nut")
source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.mp4")

Component.onCompleted: {
videoClip.clipEnded.connect(MediaManager.finishEncoding);
Expand Down
2 changes: 1 addition & 1 deletion tests/qml/video-shadereffect.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Item {
MediaClip {
id: videoClip

source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.nut")
source: Qt.resolvedUrl("../fixtures/assets/blue-320x180-30fps-3s.mp4")

Component.onCompleted: {
videoClip.clipEnded.connect(MediaManager.finishEncoding);
Expand Down
11 changes: 4 additions & 7 deletions tests/qmltest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2023 Andrew Wason
# SPDX-License-Identifier: GPL-3.0-or-later

usage="$0 <mediafxpath> <framerate>:<WxH> <qml-file> <output-file> <threshold> [asset-spec ...]"
usage="$0 <mediafxpath> <framerate>:<WxH> <qml-file> <output-file> <threshold>"

BASE=${BASH_SOURCE%/*}

Expand All @@ -17,17 +17,14 @@ QML=${1:?$usage}
shift
OUTPUT=${1:?$usage}
shift
mkdir -p $(dirname "${OUTPUT}")
THRESHOLD=${1:?$usage}
shift
mkdir -p $(dirname "${OUTPUT}")

for assetspec in "$@"; do
"${BASE}/../tools/create-asset.sh" "${ASSETS}" ${assetspec} || exit 1
done

echo Testing ${QML}
export QT_LOGGING_RULES="qt.qml.binding.removal.info=true"
"${MEDIAFX}" --exitOnWarning --fps ${FRAMERATE} --size ${SIZE} --output "${OUTPUT}" --command "ffmpeg:lossless" "${QML}" || exit 1

"${BASE}/../tools/framehash.sh" "${OUTPUT}" > "${OUTPUT}.framehash" || exit 1

# If framehash is different, then pixel difference each frame.
Expand All @@ -38,5 +35,5 @@ FIXTURE=${FIXTURES}/$(basename "${OUTPUT}")
if ( ! diff "${FIXTURE}.framehash" "${OUTPUT}.framehash" ); then
echo Warning: framehash is different, comparing frames
mkdir -p "${OUTPUT}-png"
( ! ffmpeg -hide_banner -i "${FIXTURE}" -i "${OUTPUT}" -filter_complex "blend=all_mode=difference,blackframe=amount=0:threshold=3,metadata=select:key=lavfi.blackframe.pblack:value=${THRESHOLD}:function=less,metadata=print:file=-" -an -v 24 "${OUTPUT}-png/frame-%05d.png" | grep pblack ) || exit 1
( ! ffmpeg -hide_banner -i "${FIXTURE}" -i "${OUTPUT}" -filter_complex "blend=all_mode=difference,blackframe=amount=0:threshold=3,metadata=select:key=lavfi.blackframe.pblack:value=${THRESHOLD}:function=less,metadata=print:file=-" -an -loglevel warning "${OUTPUT}-png/frame-%05d.png" | grep pblack ) || exit 1
fi
12 changes: 7 additions & 5 deletions tools/create-asset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# Copyright (C) 2023 Andrew Wason
# SPDX-License-Identifier: GPL-3.0-or-later

# Create a colored "testsrc" video/image asset, with no audio

BASE=${BASH_SOURCE%/*}

usage="$0 <outputdir> <png|nut>:[[color]:[WxH]:[framerate]:[duration]]"
IFS=: read -r TYPE COLOR SIZE FRAMERATE DURATION <<< $2
usage="$0 <outputdir> <png|mp4>~[[color]~[WxH]~[framerate]~[duration]]"
IFS='~' read -r TYPE COLOR SIZE FRAMERATE DURATION <<< $2

COLOR=${COLOR:-red}
SIZE=${SIZE:-640x360}
Expand All @@ -16,18 +18,18 @@ mkdir -p "$1"


case ${TYPE:?$usage} in
nut)
mp4)
OUTPUT=${1:?$usage}/${COLOR}-${SIZE}-${FRAMERATE}fps-${DURATION}s.${TYPE}
if [ ! -f "${OUTPUT}" ]; then
echo Creating ${OUTPUT}
ffmpeg -f lavfi -i "testsrc=duration=${DURATION}:size=${SIZE}:rate=${FRAMERATE}:decimals=2,drawbox=color=${COLOR}:t=ih/16,drawtext=text=${COLOR} f%{frame_num}:x=w/10:y=x/dar:shadowx=3:shadowy=3:fontsize=h/3.75:[email protected]:fontfile=${BASE}/JetBrainsMono-Regular.ttf" -f nut -vcodec ffv1 -g 1 -level 3 -pix_fmt rgb32 -framerate ${FRAMERATE} -y "${OUTPUT}" || exit 1
ffmpeg -f lavfi -i "testsrc=duration=${DURATION}:size=${SIZE}:rate=${FRAMERATE}:decimals=2,drawbox=color=${COLOR}:t=ih/16,drawtext=text=${COLOR} f%{frame_num}:x=w/10:y=x/dar:shadowx=3:shadowy=3:fontsize=h/3.75:[email protected]:fontfile=${BASE}/JetBrainsMono-Regular.ttf" -f mp4 -vcodec libx264 -preset veryslow -qp 0 -y "${OUTPUT}" || exit 1
fi
;;
png)
OUTPUT=${1:?$usage}/${COLOR}-${SIZE}.${TYPE}
if [ ! -f "${OUTPUT}" ]; then
echo Creating ${OUTPUT}
ffmpeg -f lavfi -i "smptebars=duration=1:size=${SIZE}:rate=1,drawbox=color=${COLOR}:t=ih/16,drawtext=text=${COLOR}:x=w/10:y=x/dar:shadowx=3:shadowy=3:fontsize=h/3.75:[email protected]:fontfile=${BASE}/JetBrainsMono-Regular.ttf" -r 1 -vframes 1 -c:v png -y "${OUTPUT}" || exit 1
ffmpeg -f lavfi -i "color=color=${COLOR}:duration=1:size=${SIZE}:rate=1,drawtext=text=${COLOR}:x=w/10:y=x/dar:shadowx=3:shadowy=3:fontsize=h/3.75:[email protected]:fontfile=${BASE}/JetBrainsMono-Regular.ttf" -r 1 -vframes 1 -c:v png -y "${OUTPUT}" || exit 1
fi
;;
*)
Expand Down
18 changes: 18 additions & 0 deletions tools/encode-asset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Copyright (C) 2024 Andrew Wason
# SPDX-License-Identifier: GPL-3.0-or-later

# Transcode a segment of a video, with timestamps overlayed

BASE=${BASH_SOURCE%/*}

usage="$0 <sourcevideo> <outputvideo> <filters> <framerate> <starttime> <endtime>"
SOURCE=${1:?$usage}
OUTPUT=${2:?$usage}
FILTERS=${3:?$usage}
FRAMERATE=${4:?$usage}
STARTTIME=${5:?$usage}
ENDTIME=${6:?$usage}

printf -v TEXT "'%s\n%s'" "f%{frame_num}" "t%{pts\:hms}"
ffmpeg -ss ${STARTTIME} -to ${ENDTIME} -i "${SOURCE}" -vf "${FILTERS},framerate=${FRAMERATE},drawtext=text=${TEXT}:x=0:y=x/dar:shadowx=3:shadowy=3:fontsize=h/6:[email protected]:fontfile=${BASE}/JetBrainsMono-Regular.ttf" -f mp4 -vcodec libx264 -preset veryslow -qp 0 -codec:a aac -ac 2 -y "${OUTPUT}" || exit 1
2 changes: 1 addition & 1 deletion tools/framehash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Copyright (C) 2023 Andrew Wason
# SPDX-License-Identifier: GPL-3.0-or-later

ffmpeg -loglevel error -i ${1:?specify input video} -c copy -f framehash -hash md5 -fflags bitexact -
ffmpeg -loglevel error -i ${1:?specify input video} -f framehash -hash md5 -fflags bitexact -
42 changes: 42 additions & 0 deletions tools/generate-assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# Copyright (C) 2024 Andrew Wason
# SPDX-License-Identifier: GPL-3.0-or-later


BASE=${BASH_SOURCE%/*}
usage="$0 <sourcevideodir>"

SOURCEDIR=${1:-}

# Create a colored "testsrc" video/image asset, with no audio
for ASSET in 'mp4~blue~320x180~30~3' 'mp4~green~320x180~15~3' 'mp4~red~320x180~15~8' 'mp4~red~640x360~30~4' 'mp4~yellow~320x180~15~3' 'png~red~160x120'; do
${BASE}/create-asset.sh "${BASE}/../tests/fixtures/assets" "${ASSET}"
done

# Download source videos:
# bbb_sunflower_1080p_30fps_normal.mp4
# https://download.blender.org/demo/movies/BBB/bbb_sunflower_1080p_30fps_normal.mp4.zip
# ed_hd.avi
# https://archive.org/download/ElephantsDream/ed_hd.avi
# cosmos_laundromat_2k.mp4
# https://pillar.blender.cloud/p/cosmos-laundromat/58b00b1b49932b2881e00757

# Blender videos used under CC By 4.0 license
# https://creativecommons.org/licenses/by/4.0/
# Trimmed, transcoded, resized, cropped and overlayed with timecode.
# https://studio.blender.org/films/

if [ -f "${SOURCEDIR}/ed_hd.avi" ]; then
${BASE}/encode-asset.sh "${SOURCEDIR}/ed_hd.avi" "${BASE}/../tests/fixtures/assets/ednotsafe-320x180-15fps-1.53s.mp4" scale=320x180 15 2:48.458 2:50.041
${BASE}/encode-asset.sh "${SOURCEDIR}/ed_hd.avi" "${BASE}/../tests/fixtures/assets/edquestions-320x180-15fps-2.4s.mp4" scale=320x180 15 7:00.791 7:03.249
${BASE}/encode-asset.sh "${SOURCEDIR}/ed_hd.avi" "${BASE}/../tests/fixtures/assets/edjustforyou-320x180-15fps-5.2s.mp4" scale=320x180 15 8:16.416 8:21.666
fi

if [ -f "${SOURCEDIR}/cosmos_laundromat_2k.mp4" ]; then
${BASE}/encode-asset.sh "${SOURCEDIR}/cosmos_laundromat_2k.mp4" "${BASE}/../tests/fixtures/assets/cosmoswolf-320x180-15fps-4.1s.mp4" 'crop=in_h*16/9,scale=320x180 15 3:22.917 3:27'
${BASE}/encode-asset.sh "${SOURCEDIR}/cosmos_laundromat_2k.mp4" "${BASE}/../tests/fixtures/assets/cosmosregret-320x134par-15fps-5.3s.mp4" scale=320x180:force_original_aspect_ratio=decrease 15 4:29.417 4:34.708
fi

if [ -f "${SOURCEDIR}/bbb_sunflower_1080p_30fps_normal.mp4" ]; then
${BASE}/encode-asset.sh "${SOURCEDIR}/bbb_sunflower_1080p_30fps_normal.mp4" "${BASE}/../tests/fixtures/assets/bbbjumprope-320x180-15fps-5.5s.mp4" scale=320x180 15 4:34.767 4:40.367
fi
2 changes: 1 addition & 1 deletion tools/hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Copyright (C) 2023 Andrew Wason
# SPDX-License-Identifier: GPL-3.0-or-later

ffmpeg -loglevel error -i ${1:?video file required} -c copy -f hash -hash md5 -
ffmpeg -loglevel error -i ${1:?video file required} -f hash -hash md5 -

0 comments on commit 5e724e5

Please sign in to comment.