Merged move to fMP4 segments with associated fixes.
This commit is contained in:
+20
-4
@@ -11,24 +11,40 @@ function install_ffmpeg() {
|
||||
fi
|
||||
|
||||
FFMPEG_VER="8.0"
|
||||
FFMPEG_BUILD_VERSION="20251223233512"
|
||||
FFMPEG_BUILD_VERSION="20260223192056"
|
||||
FFMPEG_PATH="$(pwd)"
|
||||
PATH=$FFMPEG_PATH:$PATH
|
||||
|
||||
# Determine the platform-specific archive name
|
||||
ARCH="$(uname -m)"
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
if [[ "$ARCH" == "arm64" ]]; then
|
||||
FFMPEG_ARCHIVE="ffmpeg${FFMPEG_VER}-darwin-arm64.tar.gz"
|
||||
else
|
||||
FFMPEG_ARCHIVE="ffmpeg${FFMPEG_VER}-darwin-amd64.tar.gz"
|
||||
fi
|
||||
else
|
||||
if [[ "$ARCH" == "aarch64" ]]; then
|
||||
FFMPEG_ARCHIVE="ffmpeg${FFMPEG_VER}-linux-arm64-static.tar.gz"
|
||||
else
|
||||
FFMPEG_ARCHIVE="ffmpeg${FFMPEG_VER}-linux-amd64-static.tar.gz"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -x "$FFMPEG_PATH/ffmpeg" ]]; then
|
||||
|
||||
ffmpeg_version=$("$FFMPEG_PATH/ffmpeg" -version | awk -F 'ffmpeg version' '{print $2}' | awk 'NR==1{print $1}')
|
||||
|
||||
if [[ "$ffmpeg_version" == "$FFMPEG_VER-static" ]]; then
|
||||
if [[ "$ffmpeg_version" == "${FFMPEG_VER}.1" ]]; then
|
||||
return 0
|
||||
else
|
||||
mv "$FFMPEG_PATH/ffmpeg" "$FFMPEG_PATH/ffmpeg.bk" || rm -f "$FFMPEG_PATH/ffmpeg"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Downloading ffmpeg v${FFMPEG_VER} release ${FFMPEG_BUILD_VERSION}"
|
||||
echo "Downloading ffmpeg v${FFMPEG_VER} release ${FFMPEG_BUILD_VERSION} (${FFMPEG_ARCHIVE})"
|
||||
rm -rf ffmpeg.tar.gz
|
||||
curl -sL --fail "https://github.com/owncast/ffmpeg-builds/releases/download/${FFMPEG_BUILD_VERSION}/ffmpeg${FFMPEG_VER}-amd64-static.tar.gz" --output ffmpeg.tar.gz >/dev/null
|
||||
curl -sL --fail "https://github.com/owncast/ffmpeg-builds/releases/download/${FFMPEG_BUILD_VERSION}/${FFMPEG_ARCHIVE}" --output ffmpeg.tar.gz >/dev/null
|
||||
tar -xzf ffmpeg.tar.gz
|
||||
rm -f ffmpeg.tar.gz
|
||||
chmod +x ffmpeg
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
# Example: ./test/ocTestStream.sh ~/Downloads/*.mp4 rtmp://127.0.0.1/live/abc123
|
||||
|
||||
|
||||
ffmpeg_execs=( 'ffmpeg' 'ffmpeg.exe' )
|
||||
ffmpeg_paths=( './' '../' '' )
|
||||
ffmpeg_execs=( 'ffmpeg' )
|
||||
ffmpeg_paths=( '' './' )
|
||||
|
||||
for _ffmpeg_exec in "${ffmpeg_execs[@]}"; do
|
||||
for _ffmpeg_path in "${ffmpeg_paths[@]}"; do
|
||||
@@ -43,14 +43,14 @@ if [[ -z "$ffmpeg_exec" ]]; then
|
||||
else
|
||||
ffmpeg_version=$("$ffmpeg_exec" -version | awk -F 'ffmpeg version' '{print $2}' | awk 'NR==1{print $1}')
|
||||
echo "ffmpeg executable: $ffmpeg_exec ($ffmpeg_version)"
|
||||
echo "ffmpeg path: $(readlink -f "$(which "$ffmpeg_exec")")"
|
||||
echo "ffmpeg path: $(readlink -f "$(which "$ffmpeg_exec")")"
|
||||
fi
|
||||
|
||||
if [[ ${FILE_COUNT} -eq 0 ]]; then
|
||||
echo "Streaming internal test video loop to $DESTINATION_HOST"
|
||||
echo "...press ctrl+c to exit"
|
||||
|
||||
command "${ffmpeg_exec}" -hide_banner -loglevel panic -nostdin -re -f lavfi \
|
||||
command "${ffmpeg_exec}" -hide_banner -loglevel warning -nostdin -re -f lavfi \
|
||||
-i "testsrc=size=1280x720:rate=60[out0];sine=frequency=400:sample_rate=48000[out1]" \
|
||||
-vf "[in]drawtext=fontsize=96: box=1: boxcolor=black@0.75: boxborderw=5: fontcolor=white: x=(w-text_w)/2: y=((h-text_h)/2)+((h-text_h)/-2): text='Owncast Test Stream', drawtext=fontsize=96: box=1: boxcolor=black@0.75: boxborderw=5: fontcolor=white: x=(w-text_w)/2: y=((h-text_h)/2)+((h-text_h)/2): text='%{gmtime\:%H\\\\\:%M\\\\\:%S} UTC'[out]" \
|
||||
-nal-hrd cbr \
|
||||
@@ -91,7 +91,7 @@ else
|
||||
echo "ERROR: File not found: $file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
done
|
||||
|
||||
function finish {
|
||||
|
||||
Reference in New Issue
Block a user