Skip to content

Commit

Permalink
add Ambisonic Decoder audio filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Feb 8, 2024
1 parent b262892 commit caa3df9
Show file tree
Hide file tree
Showing 5 changed files with 702 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/build-shotcut-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ ENABLE_GOPRO2GPX=1
ENABLE_OPENCV=1
OPENCV_HEAD=0
OPENCV_REVISION="4.7.0"
ENABLE_LIBSPATIALAUDIO=1
LIBSPATIALAUDIO_HEAD=1
LIBSPATIALAUDIO_REVISION=

# QT_INCLUDE_DIR="$(pkg-config --variable=prefix QtCore)/include"
QT_INCLUDE_DIR=${QTDIR:+${QTDIR}/include}
Expand Down Expand Up @@ -186,6 +189,9 @@ function to_key {
opencv_contrib)
echo 16
;;
libspatialaudio)
echo 17
;;
*)
echo UNKNOWN
;;
Expand Down Expand Up @@ -380,6 +386,9 @@ function set_globals {
if test "$ENABLE_OPENCV" = 1 ; then
SUBDIRS="opencv opencv_contrib $SUBDIRS"
fi
if test "$ENABLE_LIBSPATIALAUDIO" = 1 && test "$LIBSPATIALAUDIO_HEAD" = 1 -o "$LIBSPATIALAUDIO_REVISION" != ""; then
SUBDIRS="libspatialaudio $SUBDIRS"
fi
SUBDIRS="$SUBDIRS mlt shotcut"
fi

Expand Down Expand Up @@ -422,6 +431,7 @@ function set_globals {
REPOLOCS[14]="https://github.com/ddennedy/gopro2gpx.git"
REPOLOCS[15]="https://github.com/opencv/opencv.git"
REPOLOCS[16]="https://github.com/opencv/opencv_contrib.git"
REPOLOCS[17]="https://github.com/videolabs/libspatialaudio.git"

# REPOTYPE Array holds the repo types. (Yes, this might be redundant, but easy for me)
REPOTYPES[0]="git"
Expand All @@ -441,6 +451,7 @@ function set_globals {
REPOTYPES[14]="git"
REPOTYPES[15]="git"
REPOTYPES[16]="git"
REPOTYPES[17]="git"

# And, set up the revisions
REVISIONS[0]=""
Expand Down Expand Up @@ -499,6 +510,10 @@ function set_globals {
if test 0 = "$OPENCV_HEAD" -a "$OPENCV_REVISION" ; then
REVISIONS[16]="$OPENCV_REVISION"
fi
REVISIONS[17]=""
if test 0 = "$LIBSPATIALAUDIO_HEAD" -a "$LIBSPATIALAUDIO_REVISION" ; then
REVISIONS[17]="$LIBSPATIALAUDIO_REVISION_REVISION"
fi

# Figure out the number of cores in the system. Used both by make and startup script
CPUS=$(nproc)
Expand Down Expand Up @@ -677,6 +692,14 @@ function set_globals {
LDFLAGS_[15]="$LDFLAGS"
BUILD[15]="ninja -C build -j $MAKEJ"
INSTALL[15]="ninja -C build install"

#####
# libspatialaudio
CONFIG[17]="cmake -G Ninja -B build -D CMAKE_INSTALL_PREFIX=$FINAL_INSTALL_DIR $CMAKE_DEBUG_FLAG"
CFLAGS_[17]="$CFLAGS"
LDFLAGS_[17]="$LDFLAGS"
BUILD[17]="ninja -j $MAKEJ"
INSTALL[17]="ninja install"
}

function build_dav1d {
Expand Down
24 changes: 24 additions & 0 deletions scripts/build-shotcut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ OPENCV_REVISION="4.7.0"
ENABLE_LIBWEBP=1
LIBWEBP_HEAD=0
LIBWEBP_REVISION="v1.3.2"
ENABLE_LIBSPATIALAUDIO=1
LIBSPATIALAUDIO_HEAD=1
LIBSPATIALAUDIO_REVISION=

PYTHON_VERSION_DEFAULT=3.8
PYTHON_VERSION_DARWIN=3.10
Expand Down Expand Up @@ -199,6 +202,9 @@ function to_key {
movit)
echo 5
;;
libspatialaudio)
echo 6
;;
shotcut)
echo 7
;;
Expand Down Expand Up @@ -496,6 +502,9 @@ function set_globals {
if test "$ENABLE_LIBWEBP" = 1 && test "$LIBWEBP_HEAD" = 1 -o "$LIBWEBP_REVISION" != ""; then
SUBDIRS="libwebp $SUBDIRS"
fi
if test "$ENABLE_LIBSPATIALAUDIO" = 1 && test "$LIBSPATIALAUDIO_HEAD" = 1 -o "$LIBSPATIALAUDIO_REVISION" != ""; then
SUBDIRS="libspatialaudio $SUBDIRS"
fi
fi

if [ "$DEBUG_BUILD" = "1" ]; then
Expand Down Expand Up @@ -527,6 +536,7 @@ function set_globals {
REPOLOCS[3]="https://github.com/mirror/x264.git"
REPOLOCS[4]="https://chromium.googlesource.com/webm/libvpx.git"
REPOLOCS[5]="https://github.com/ddennedy/movit.git"
REPOLOCS[6]="https://github.com/videolabs/libspatialaudio.git"
REPOLOCS[7]="https://github.com/mltframework/shotcut.git"
REPOLOCS[8]="https://github.com/swh/ladspa.git"
REPOLOCS[10]="https://github.com/georgmartius/vid.stab.git"
Expand Down Expand Up @@ -554,6 +564,7 @@ function set_globals {
REPOTYPES[3]="git"
REPOTYPES[4]="git"
REPOTYPES[5]="git"
REPOTYPES[6]="git"
REPOTYPES[7]="git"
REPOTYPES[8]="git"
REPOTYPES[9]="git"
Expand Down Expand Up @@ -601,6 +612,10 @@ function set_globals {
if test 0 = "$MOVIT_HEAD" -a "$MOVIT_REVISION" ; then
REVISIONS[5]="$MOVIT_REVISION"
fi
REVISIONS[6]=""
if test 0 = "$LIBSPATIALAUDIO_HEAD" -a "$LIBSPATIALAUDIO_REVISION" ; then
REVISIONS[6]="$LIBSPATIALAUDIO_REVISION_REVISION"
fi
REVISIONS[7]=""
if test 0 = "$SHOTCUT_HEAD" -a "$SHOTCUT_REVISION" ; then
REVISIONS[7]="$SHOTCUT_REVISION"
Expand Down Expand Up @@ -851,6 +866,15 @@ function set_globals {
fi
INSTALL[5]="make install"

#####
# libspatialaudio
CONFIG[6]="cmake -G Ninja -B build -D CMAKE_INSTALL_PREFIX=$FINAL_INSTALL_DIR $CMAKE_DEBUG_FLAG"
[ "$TARGET_OS" = "Darwin" ] && CONFIG[6]="${CONFIG[6]} -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64'"
CFLAGS_[6]="$CFLAGS"
LDFLAGS_[6]="$LDFLAGS"
BUILD[6]="ninja -j $MAKEJ"
INSTALL[6]="ninja install"

#####
# shotcut
CONFIG[7]="cmake -G Ninja -D CMAKE_PREFIX_PATH=$QTDIR -D SHOTCUT_VERSION=$SHOTCUT_VERSION $CMAKE_DEBUG_FLAG"
Expand Down
49 changes: 49 additions & 0 deletions src/qml/filters/ambisonic_decoder/meta.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import QtQuick
import org.shotcut.qml

Metadata {
type: Metadata.Filter
isAudio: true
name: qsTr("Ambisonic Decoder")
mlt_service: "ambisonic-decoder"
keywords: qsTr('spatial surround', 'search keywords for the Ambisonic Decoder audio filter') + ' ambisonic decoder'
objectName: "ambisonic-decoder"
qml: "ui.qml"
vui: "vui.qml"

keyframes {
allowAnimateIn: true
allowAnimateOut: true
simpleProperties: ['yaw', "pitch", "roll", "zoom"]
parameters: [
Parameter {
name: qsTr('Yaw')
property: 'yaw'
isCurve: true
minimum: -360
maximum: 360
},
Parameter {
name: qsTr('Pitch', 'rotation around the side-to-side axis (roll, pitch, yaw)')
property: 'pitch'
isCurve: true
minimum: -180
maximum: 180
},
Parameter {
name: qsTr('Roll')
property: 'roll'
isCurve: true
minimum: -180
maximum: 180
},
Parameter {
name: qsTr('Zoom')
property: 'zoom'
isCurve: true
minimum: -100
maximum: 100
}
]
}
}
Loading

0 comments on commit caa3df9

Please sign in to comment.