diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index caaaf01..450194e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -43,5 +43,20 @@ A clear and concise description of what the bug is. - Copy paste those lines in another new [gist](https://gist.github.com/) - Copy paste all the gists links in the issue +## `gstreamer.log` (containing the ffmpeg-wrapper execution logs) +- Go to the temporary directory: `cd /tmp` +- Type `ls -al | grep gst` to list all files containing "ffmpeg" and check you have one named `gstreamer.log` +- Type `tail -200 gstreamer.log` to print the last 200 lines to the console +- Copy paste those lines in a new [gist](https://gist.github.com/) +- Add the gist link to the issue + +## `gstlaunch-xxxx.stderr` (containing chunks transcoding operations) +- When you ran `ls -al | grep gst` you should have seen another file that looks like `gstreamer-xxxx.stderr` in case of error, the file may not be there, in that specific case, you can ignore these steps. +- Type `tail -100 gstlaunch-xxxx.stderr` (replacing the filename by the correct one) +- Copy paste those lines in a new [gist](https://gist.github.com/) +- Type `head -300 gstlaunch-xxxx.stderr` (replacing the filename by the correct one) +- Copy paste those lines in another new [gist](https://gist.github.com/) +- Copy paste all the gists links in the issue + **Additional context** Add any other context about the problem here. diff --git a/README.md b/README.md index 9f63284..bb9cdb6 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ Huge thanks to [Benjamin Poncet](https://github.com/BenjaminPoncet), [Vincent Fo - Video Station 2.4.6-1594 (and above) - SynoCommunity ffmpeg 4.x.x, ffmpeg 5.x.x or ffmpeg 6.x.x ([help](https://synocommunity.com/#easy-install)) -## Supported / Unsupported scenarios +## Supported scenarios - **[DTS or EAC3 or TrueHD] + [Any non HEVC standard video format]**: ✅ - **[no DTS, no EAC3, no TrueHD] + [HEVC]**: ✅ -- **[DTS or EAC3 or TrueHD] + [HEVC]**: ⚠️ Not working on architectures where Advanced Media Extensions uses GStreamer for audio decoding (Please don't submit any more issue related to this scenario, I'm working on it, see [#33](https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher/pull/33)) +- **[DTS or EAC3 or TrueHD] + [HEVC]**: ✅ (credits to @nap-liu) ## Instructions - Check that you meet the required [dependencies](https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher#dependencies) diff --git a/libs/dri/dummy_drv_video.so b/libs/dri/dummy_drv_video.so new file mode 100755 index 0000000..139e7bf Binary files /dev/null and b/libs/dri/dummy_drv_video.so differ diff --git a/libs/libavcodec-ffmpeg.so.56 b/libs/libavcodec-ffmpeg.so.56 new file mode 100644 index 0000000..e080ab4 Binary files /dev/null and b/libs/libavcodec-ffmpeg.so.56 differ diff --git a/libs/libavformat-ffmpeg.so.56 b/libs/libavformat-ffmpeg.so.56 new file mode 100644 index 0000000..ba1d974 Binary files /dev/null and b/libs/libavformat-ffmpeg.so.56 differ diff --git a/libs/libavutil-ffmpeg.so.54 b/libs/libavutil-ffmpeg.so.54 new file mode 100644 index 0000000..a94727d Binary files /dev/null and b/libs/libavutil-ffmpeg.so.54 differ diff --git a/libs/libbluray.so.1 b/libs/libbluray.so.1 new file mode 100644 index 0000000..0cef7da Binary files /dev/null and b/libs/libbluray.so.1 differ diff --git a/libs/libdca.so.0 b/libs/libdca.so.0 new file mode 100644 index 0000000..ef14cfb Binary files /dev/null and b/libs/libdca.so.0 differ diff --git a/libs/libgme.so.0 b/libs/libgme.so.0 new file mode 100644 index 0000000..7dfb2af Binary files /dev/null and b/libs/libgme.so.0 differ diff --git a/libs/libgnutls-deb0.so.28 b/libs/libgnutls-deb0.so.28 new file mode 100644 index 0000000..f399896 Binary files /dev/null and b/libs/libgnutls-deb0.so.28 differ diff --git a/libs/libgsm.so.1 b/libs/libgsm.so.1 new file mode 100644 index 0000000..4d476f9 Binary files /dev/null and b/libs/libgsm.so.1 differ diff --git a/libs/libhogweed.so.4 b/libs/libhogweed.so.4 new file mode 100644 index 0000000..87a839c Binary files /dev/null and b/libs/libhogweed.so.4 differ diff --git a/libs/libmodplug.so.1 b/libs/libmodplug.so.1 new file mode 100644 index 0000000..bf7e866 Binary files /dev/null and b/libs/libmodplug.so.1 differ diff --git a/libs/libnettle.so.6 b/libs/libnettle.so.6 new file mode 100644 index 0000000..76e79e9 Binary files /dev/null and b/libs/libnettle.so.6 differ diff --git a/libs/libnuma.so.1 b/libs/libnuma.so.1 new file mode 100644 index 0000000..bb0d87e Binary files /dev/null and b/libs/libnuma.so.1 differ diff --git a/libs/libopenjpeg.so.5 b/libs/libopenjpeg.so.5 new file mode 100644 index 0000000..b5a4025 Binary files /dev/null and b/libs/libopenjpeg.so.5 differ diff --git a/libs/libopenjpeg_JPWL.so.5 b/libs/libopenjpeg_JPWL.so.5 new file mode 100644 index 0000000..26d0c68 Binary files /dev/null and b/libs/libopenjpeg_JPWL.so.5 differ diff --git a/libs/libopus.so.0 b/libs/libopus.so.0 new file mode 100644 index 0000000..be3c09d Binary files /dev/null and b/libs/libopus.so.0 differ diff --git a/libs/liborc-0.4.so.0 b/libs/liborc-0.4.so.0 new file mode 100644 index 0000000..336f32d Binary files /dev/null and b/libs/liborc-0.4.so.0 differ diff --git a/libs/libp11-kit.so.0 b/libs/libp11-kit.so.0 new file mode 100644 index 0000000..c24f12c Binary files /dev/null and b/libs/libp11-kit.so.0 differ diff --git a/libs/libpng12.so.0 b/libs/libpng12.so.0 new file mode 100644 index 0000000..5e83e99 Binary files /dev/null and b/libs/libpng12.so.0 differ diff --git a/libs/librtmp.so.1 b/libs/librtmp.so.1 new file mode 100644 index 0000000..7250ac0 Binary files /dev/null and b/libs/librtmp.so.1 differ diff --git a/libs/libschroedinger-1.0.so.0 b/libs/libschroedinger-1.0.so.0 new file mode 100644 index 0000000..343c996 Binary files /dev/null and b/libs/libschroedinger-1.0.so.0 differ diff --git a/libs/libshine.so.3 b/libs/libshine.so.3 new file mode 100644 index 0000000..31436e7 Binary files /dev/null and b/libs/libshine.so.3 differ diff --git a/libs/libsoxr.so.0 b/libs/libsoxr.so.0 new file mode 100644 index 0000000..940a4c8 Binary files /dev/null and b/libs/libsoxr.so.0 differ diff --git a/libs/libspeex.so.1 b/libs/libspeex.so.1 new file mode 100644 index 0000000..b093f01 Binary files /dev/null and b/libs/libspeex.so.1 differ diff --git a/libs/libssh-gcrypt.so.4 b/libs/libssh-gcrypt.so.4 new file mode 100644 index 0000000..a0c78ed Binary files /dev/null and b/libs/libssh-gcrypt.so.4 differ diff --git a/libs/libssh-gcrypt_threads.so.4 b/libs/libssh-gcrypt_threads.so.4 new file mode 100644 index 0000000..94f2377 Binary files /dev/null and b/libs/libssh-gcrypt_threads.so.4 differ diff --git a/libs/libswresample-ffmpeg.so.1 b/libs/libswresample-ffmpeg.so.1 new file mode 100644 index 0000000..3d942c5 Binary files /dev/null and b/libs/libswresample-ffmpeg.so.1 differ diff --git a/libs/libtasn1.so.6 b/libs/libtasn1.so.6 new file mode 100644 index 0000000..02d4c9f Binary files /dev/null and b/libs/libtasn1.so.6 differ diff --git a/libs/libtheora.so.0 b/libs/libtheora.so.0 new file mode 100644 index 0000000..baaf005 Binary files /dev/null and b/libs/libtheora.so.0 differ diff --git a/libs/libtheoradec.so.1 b/libs/libtheoradec.so.1 new file mode 100644 index 0000000..fa51d7e Binary files /dev/null and b/libs/libtheoradec.so.1 differ diff --git a/libs/libtheoraenc.so.1 b/libs/libtheoraenc.so.1 new file mode 100644 index 0000000..6c9f664 Binary files /dev/null and b/libs/libtheoraenc.so.1 differ diff --git a/libs/libtwolame.so.0 b/libs/libtwolame.so.0 new file mode 100644 index 0000000..eec7b94 Binary files /dev/null and b/libs/libtwolame.so.0 differ diff --git a/libs/libva.so.1 b/libs/libva.so.1 new file mode 100644 index 0000000..a0ad262 Binary files /dev/null and b/libs/libva.so.1 differ diff --git a/libs/libvpx.so.2 b/libs/libvpx.so.2 new file mode 100644 index 0000000..5874a3d Binary files /dev/null and b/libs/libvpx.so.2 differ diff --git a/libs/libvpx.so.2.0 b/libs/libvpx.so.2.0 new file mode 100644 index 0000000..5874a3d Binary files /dev/null and b/libs/libvpx.so.2.0 differ diff --git a/libs/libwavpack.so.1 b/libs/libwavpack.so.1 new file mode 100644 index 0000000..d14a4d0 Binary files /dev/null and b/libs/libwavpack.so.1 differ diff --git a/libs/libwebp.so.5 b/libs/libwebp.so.5 new file mode 100644 index 0000000..0ec4b57 Binary files /dev/null and b/libs/libwebp.so.5 differ diff --git a/libs/libx264.so.146 b/libs/libx264.so.146 new file mode 100644 index 0000000..da4750e Binary files /dev/null and b/libs/libx264.so.146 differ diff --git a/libs/libx265.so.59 b/libs/libx265.so.59 new file mode 100644 index 0000000..14a1937 Binary files /dev/null and b/libs/libx265.so.59 differ diff --git a/libs/libxvidcore.so.4 b/libs/libxvidcore.so.4 new file mode 100644 index 0000000..0712f82 Binary files /dev/null and b/libs/libxvidcore.so.4 differ diff --git a/libs/libzvbi-chains.so.0 b/libs/libzvbi-chains.so.0 new file mode 100644 index 0000000..ad3d369 Binary files /dev/null and b/libs/libzvbi-chains.so.0 differ diff --git a/libs/libzvbi.so.0 b/libs/libzvbi.so.0 new file mode 100644 index 0000000..c745af1 Binary files /dev/null and b/libs/libzvbi.so.0 differ diff --git a/libs/x264-10bit/libx264.so.146 b/libs/x264-10bit/libx264.so.146 new file mode 100755 index 0000000..6d7a53f Binary files /dev/null and b/libs/x264-10bit/libx264.so.146 differ diff --git a/libs/x265-10bit/libx265.so.59 b/libs/x265-10bit/libx265.so.59 new file mode 100755 index 0000000..b589b1b Binary files /dev/null and b/libs/x265-10bit/libx265.so.59 differ diff --git a/motd.txt b/motd.txt index 5152c43..f2d41ce 100644 --- a/motd.txt +++ b/motd.txt @@ -1,5 +1,3 @@ -The patcher was redesigned to include an unpatch procedure. - -I'm aware of an issue with HEVC and I'm working on it. +The patcher now supports every scenarios including gstreamer (credits to @nap-liu). As always, please let me know of any issue you could have. diff --git a/patcher.sh b/patcher.sh index ead1911..59d50fb 100755 --- a/patcher.sh +++ b/patcher.sh @@ -5,21 +5,83 @@ ############################### source "/etc/VERSION" +cpu_platform=$( "$vs_path/bin/$filename" + wget -q -O - "$repo_base_url/blob/$branch/wrappers/$filename.sh?raw=true" > "$vs_path/bin/$filename" chown root:VideoStation "$vs_path/bin/$filename" chmod 750 "$vs_path/bin/$filename" chmod u+s "$vs_path/bin/$filename" @@ -114,6 +182,34 @@ function patch() { done fi + if [[ "${gstreamer_platforms[*]}" =~ $cpu_platform ]]; then + info "Downloading gstreamer plugins..." + + for plugin in "${gstreamer_plugins[@]}"; do + info "Downloading $plugin to gstreamer directory..." + + wget -q -O - "$repo_base_url/raw/$branch/plugins/$plugin.so" \ + > "$vs_path/lib/gstreamer/gstreamer-1.0/$plugin.so" + done + + mkdir -p "$vs_path/lib/gstreamer/dri" + mkdir -p "$vs_path/lib/gstreamer/x264-10bit" + mkdir -p "$vs_path/lib/gstreamer/x265-10bit" + + for lib in "${gstreamer_libs[@]}"; do + info "Downloading $lib to gstreamer directory..." + + wget -q -O - "$repo_base_url/raw/$branch/libs/$lib" \ + > "$vs_path/lib/gstreamer/$lib" + done + + info "Saving current GSTOmx configuration..." + mv -n "$vs_path/etc/gstomx.conf" "$vs_path/etc/gstomx.conf.orig" + + info "Injecting GSTOmx configuration..." + cp -n "$cp_path/etc/gstomx.conf" "$vs_path/etc/gstomx.conf" + fi + info "Setting ffmpeg version to: ffmpeg$ffmpegversion" sed -i -e "s/@ffmpeg_version@/ffmpeg$ffmpegversion/" "$vs_path/bin/ffmpeg" @@ -148,6 +244,21 @@ function unpatch() { done fi + if [[ "${gstreamer_platforms[*]}" =~ $cpu_platform ]]; then + for plugin in "${gstreamer_plugins[@]}"; do + info "Removing gstreamer's $plugin plugin" + rm -f "$vs_path/lib/gstreamer/gstreamer-1.0/$plugin.so" + done + + for lib in "${gstreamer_libs[@]}"; do + info "Removing gstreamer's $lib library" + rm -f "$vs_path/lib/gstreamer/$lib" + done + + info "Restoring GSTOmx configuration..." + mv -T -f "$vs_path/etc/gstomx.conf.orig" "$vs_path/etc/gstomx.conf" + fi + restart_packages echo "" diff --git a/plugins/libgstdtsdec.so b/plugins/libgstdtsdec.so new file mode 100644 index 0000000..ef949a0 Binary files /dev/null and b/plugins/libgstdtsdec.so differ diff --git a/plugins/libgstlibav.so b/plugins/libgstlibav.so new file mode 100755 index 0000000..6367fc1 Binary files /dev/null and b/plugins/libgstlibav.so differ diff --git a/ffmpeg-wrapper.sh b/wrappers/ffmpeg.sh similarity index 90% rename from ffmpeg-wrapper.sh rename to wrappers/ffmpeg.sh index 6e775a7..8bdc3d1 100644 --- a/ffmpeg-wrapper.sh +++ b/wrappers/ffmpeg.sh @@ -50,6 +50,9 @@ newline info "========================================[start ffmpeg $pid]" info "DEFAULT_ARGS: $*" -/var/packages/@ffmpeg_version@/target/bin/ffmpeg "$@" 2> $stderrfile +/var/packages/@ffmpeg_version@/target/bin/ffmpeg "$@" <&0 2> $stderrfile & + +child=$! +wait $child endprocess diff --git a/wrappers/gst-inspect-1.0.sh b/wrappers/gst-inspect-1.0.sh new file mode 100644 index 0000000..dbd2721 --- /dev/null +++ b/wrappers/gst-inspect-1.0.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +######################### +# VARS +######################### + +pid=$$ +stderrfile="/tmp/gstinspect-$pid.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" "An error occurred, here is the $stderrfile content: " + newline + cat "$stderrfile" >> $logfile + newline + endprocess +} + +function endprocess() { + info "========================================[end gst $pid]" + newline + rm "$stderrfile" + exit 1 +} + +######################### +# ENTRYPOINT +######################### + +trap endprocess SIGTERM +trap handle_error ERR + +newline +info "========================================[start gst-inspect $pid]" +info "GST_ARGS: $*" + +/var/packages/VideoStation/target/bin/gst-inspect-1.0.orig "$@" 2> $stderrfile & + +child=$! +wait $child + +endprocess \ No newline at end of file diff --git a/wrappers/gst-launch-1.0.sh b/wrappers/gst-launch-1.0.sh new file mode 100644 index 0000000..dc45914 --- /dev/null +++ b/wrappers/gst-launch-1.0.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +######################### +# VARS +######################### + +pid=$$ +stderrfile="/tmp/gstlaunch-$pid.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" "An error occurred, here is the $stderrfile content: " + newline + cat "$stderrfile" >> $logfile + newline + endprocess +} + +function endprocess() { + info "========================================[end gst $pid]" + newline + rm "$stderrfile" + exit 1 +} + +######################### +# ENTRYPOINT +######################### + +trap endprocess SIGTERM +trap handle_error ERR + +newline +info "========================================[start gst-launch $pid]" +info "GST_ARGS: $*" + +/var/packages/VideoStation/target/bin/gst-launch-1.0.orig "$@" 2> $stderrfile & + +child=$! +wait $child + +endprocess \ No newline at end of file