fix truehd\eac3\dts

This commit is contained in:
nap.liu 2022-12-16 21:14:55 +08:00
parent 199d1e7574
commit 4ed4fb7057
4 changed files with 67 additions and 13 deletions

Binary file not shown.

BIN
gstreamer-patch.tar.gz Executable file

Binary file not shown.

52
gstreamer-wrapper.sh Normal file
View File

@ -0,0 +1,52 @@
#!/bin/bash
#########################
# VARS
#########################
pid=$$
stderrfile="/tmp/gstreamer.stderr"
logfile="/tmp/gstreamer.log"
#########################
# UTILS
#########################
function log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$1] $2" >> $logfile
}
function newline() {
echo "" >> $logfile
}
function info() {
log "INFO" "$1"
}
function handle_error() {
log "ERROR" "Error on line $(caller)"
endprocess
}
function endprocess() {
info "========================================[end gst-launch $pid]"
newline
# rm -f "$stderrfile"
exit 1
}
#########################
# ENTRYPOINT
#########################
trap endprocess SIGTERM
trap handle_error ERR
newline
info "========================================[start gst-launch $pid]"
info "DEFAULT_ARGS: $*"
export LD_LIBRARY_PATH=/var/packages/VideoStation/target/lib/patch/lib/
export GST_PLUGIN_PATH=/var/packages/VideoStation/target/lib/patch/plugins/
/var/packages/VideoStation/target/bin/gst-launch-1.0.orig "$@" 2>> $stderrfile

View File

@ -10,21 +10,24 @@ version="2.0"
action="patch"
branch="master"
dependencies=("VideoStation" "ffmpeg")
wrappers=("ffmpeg")
wrappers=("ffmpeg" "gstreamer")
vs_path=/var/packages/VideoStation/target
vs_lib_path="$vs_path/lib/gstreamer"
vs_lib_path="$vs_path/lib"
libsynovte_path="$vs_path/lib/libsynovte.so"
# CodecPack path
cp_path=/var/packages/CodecPack/target
cp_bin_path="$cp_path/bin"
cp_lib_path="$cp_path/lib/gstreamer"
cp_lib_path="$cp_path/lib"
patch_package="gstreamer-patch.tar.gz"
cp_to_patch=(
"ffmpeg41:ffmpeg"
"ffmpeg27:ffmpeg"
"ffmpeg33:ffmpeg"
"gst-launch-1.0:gst-launch-1.0"
)
###############################
@ -129,22 +132,21 @@ function patch() {
info "Enabling eac3, dts and truehd"
sed -i -e 's/eac3/3cae/' -e 's/dts/std/' -e 's/truehd/dheurt/' "$libsynovte_path"
info "Downloading gstreamer patch"
wget -q -O - "$repo_base_url/raw/branch/$branch/$patch_package" > "/tmp/$patch_package"
info "Downloading gstreamer dts patch"
wget -q -O - "$repo_base_url/raw/branch/$branch/dts-patch.tar.gz" > /tmp/dts-patch.tar.gz
# patch CodecPack & VideoStation gstreamer plugin
info "Patching gstreamer plugin"
tar -xzvf /tmp/dts-patch.tar.gz -C $vs_lib_path;
tar -xzvf /tmp/dts-patch.tar.gz -C $cp_lib_path;
info "Patching dts patch done"
# patch VideoStation gstreamer plugin
info "Patching gstreamer"
tar -xzvf "/tmp/$patch_package" -C $vs_lib_path;
# tar -xzvf "/tmp/$patch_package" -C $cp_lib_path;
info "Patching gstreamer done"
# force refresh gstreamer plugin cache
rm -rf /var/packages/VideoStation/etc/gstreamer-1.0/registry.aarch64.bin
rm -rf /var/packages/CodecPack/etc/gstreamer-1.0/registry.aarch64.bin
# rm -rf /var/packages/CodecPack/etc/gstreamer-1.0/registry.aarch64.bin
info "Refresh gstreamer plugin cache done"
rm /tmp/dts-patch.tar.gz
rm "/tmp/$patch_package"
restart_packages