Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gstreamer package #5298

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open

Add gstreamer package #5298

wants to merge 99 commits into from

Conversation

th0ma7
Copy link
Contributor

@th0ma7 th0ma7 commented Jun 4, 2022

Description

Add gstreamer package

Fixes #3511

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

@th0ma7 th0ma7 self-assigned this Jun 4, 2022
hgy59 added a commit to hgy59/spksrc that referenced this pull request Jun 4, 2022
- add patchelf (for dotnet-runtime)
- update meson (for cross/gstreamer, SynoCommunity#5298)
@hgy59 hgy59 mentioned this pull request Jun 4, 2022
10 tasks
hgy59 added a commit that referenced this pull request Jun 4, 2022
* udpate docker image:
- add patchelf (for dotnet-runtime)
- update meson (for cross/gstreamer, #5298)

* update readme.md
- update developer environment prerequisites
Copy link
Contributor Author

@th0ma7 th0ma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnx! :)

@AlexPresso
Copy link

This would also fix #3511

@hgy59
Copy link
Contributor

hgy59 commented Jun 8, 2022

@th0ma7 please do not remove native/glib to prevent merge conflicts with #4337. native/glib is still required by cross/avahi in #4337 that I am working on.

After reading:

# Require access to glib-mkenums Python script
ENV += PATH=$(STAGING_INSTALL_PREFIX)/bin:$$PATH

I will add this to cross/avahi too. Thank you for telling that glib-mkenums is a (arch independent) python script.

hgy59 added a commit to hgy59/spksrc that referenced this pull request Jun 8, 2022
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
hgy59 added a commit to hgy59/spksrc that referenced this pull request Jun 8, 2022
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
@th0ma7
Copy link
Contributor Author

th0ma7 commented Jun 10, 2022

@hgy59 and fellow @SynoCommunity/developers I've been looking into ways of building gst-omx in order to achieve hardware acceleration on platforms that support it. If a solution turns out working I might even be able to enable --enable-omx on ffmpeg as well.

I finally found some hints from the VideoStation sources here https://sourceforge.net/projects/dsgpl/files/Packages/DSM%206.1%20Package%20Release/ where Synology create a template file pointing directly to the pre-built OMX library to build up the various tools:

$ head gst-omx-virtual-video-station/config/synology/gstomx.conf.template
[omxmpeg2videodec]
type-name=GstOMXMPEG2VideoDec
core-name=__LIB_PREFIX__/libOMX_Core.so
component-name=OMX.realtek.video.dec
rank=258
in-port-index=0
out-port-index=1
sink-template-caps=video/mpeg,mpegversion=(int)[1, 2],systemstream=(boolean)false
src-template-caps=video/x-raw,format = (string) { NV12 },width=(int)[ 16, 4096 ],height=(int)[ 16, 4096 ],framerate=(fraction)[ 0/1, 2147483647/1 ]

Where __LIB_PREFIX__ is:

sed "s,__LIB_PREFIX__,${LibPrefix},g" "${GST_OMX_CONF}.template" > "${GST_OMX_CONF}"

And LibPrefix is:

LibPrefix="/var/packages/$PackageName/target/lib/realtek"

And PackageName is VideoStation (probably now CodecPack since newer releases).

Long-story-short, I'm thinking of a way to download+extract the official Synology package matching the arch so I could then link to it. I might even import the library all together which may be even simpler. If this actually works, it may lead into enabling hardware decoding on many many platforms.

Two questions comes to mind:

  1. Where or how to set that up in spksrc? In a similar manner as we manager kernels/toolchain/toolkit? or using cross with install_resources and multi-file digests
  2. But first and most importantly, I just can't find how to extract Synology latest official spk such as https://archive.synology.com/download/Package/VideoStation/3.0.3-2084 or https://archive.synology.com/download/Package/CodecPack/2.0.0-1017

Your thoughts (and help on extracting spk) would be much appreciated :)

@th0ma7
Copy link
Contributor Author

th0ma7 commented Jun 10, 2022

For item no. 2 (e.g. extracting files from an Synology spk package) I think I have found all the ingredients... Its now a matter of making a short & sweet recipe out of it.

General howto, well made: https://www.cyberciti.biz/faq/pgp-tarball-file-signature-keys-verification/

Actual path where Synology store their keys on the nas:

root@th0ma7-nas:/usr/syno/etc/codesign# pwd
/usr/syno/etc/codesign
root@th0ma7-nas:/usr/syno/etc/codesign# ll
total 28
drwxr-xr-x  3 root root 4096 Aug 15  2021 .
drwxr-xr-x 64 root root 4096 Jun 10 10:34 ..
drwx------  2 root root 4096 Jun 10 14:45 .gnupg
-rw-r--r--  1 root root  175 Aug 15  2021 keyinfo-sys
-rw-r--r--  1 root root  224 Jun 10 14:45 keyinfo-user
-rw-r--r--  1 root root 3299 Aug 15  2021 keyring
-rw-r--r--  1 root root    1 Aug 15  2021 VERSION

Actual code that is/was used to validate the signed packages and extract them: https://pastebin.com/3vBYv662
And how to use codesign at page 25 of https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/6.0/enu/DSM_Developer_Guide_6_0.pdf

And finally Synology packages: https://archive.synology.com/download/Package

Optionally, this other pgp key might be useful: https://www.synology.com/en-global/support/security_pgp_key

@AlexPresso
Copy link

AlexPresso commented Jun 15, 2022

Three libraries fail to load when calling gst-launch-1.0:

root@Kloudy:/var/packages/gstreamer/target/bin$ ./gst-launch-1.0 -s 1200 fakevideosink

(gst-plugin-scanner:30702): GStreamer-WARNING **: 16:32:36.941: Failed to load plugin '/var/packages/gstreamer/target/lib/gstreamer-1.0/libgstcairo.so': libcairo-gobject.so.2: cannot open shared object file: No such file or directory

(gst-plugin-scanner:30702): GStreamer-WARNING **: 16:32:37.000: Failed to load plugin '/var/packages/gstreamer/target/lib/gstreamer-1.0/libgsttaglib.so': /spksrc/spk/gstreamer/work-aarch64-7.0/install/var/packages/gstreamer/target/lib/libz.so: cannot open shared object file: No such file or directory

(gst-plugin-scanner:30702): GStreamer-WARNING **: 16:32:37.081: Failed to load plugin '/var/packages/gstreamer/target/lib/gstreamer-1.0/libgstpng.so': /spksrc/spk/gstreamer/work-aarch64-7.0/install/var/packages/gstreamer/target/lib/libz.so: cannot open shared object file: No such file or directory

@publicarray
Copy link
Member

publicarray commented Jun 18, 2022

Regarding point 1. Would this work as just another cross/ package? That way you don't need to modify the framework and this seems specific to just one package. Yea I think it belongs in cross or spk

hgy59 added a commit to hgy59/spksrc that referenced this pull request Jul 23, 2022
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
@th0ma7
Copy link
Contributor Author

th0ma7 commented Feb 1, 2023

@AlexPresso I was finally able to resume work on this PR. It isn't yet in a state I like but hardware acceleration on aarch64 using OMX "might" just work but there is no way for me to tell.

Just saying, I hadn't forgotten this... still on my pile 🤷‍♂️

th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Feb 25, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Feb 25, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Feb 26, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Feb 26, 2023
hgy59 added a commit to hgy59/spksrc that referenced this pull request Mar 5, 2023
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
hgy59 added a commit to hgy59/spksrc that referenced this pull request Mar 7, 2023
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
@th0ma7 th0ma7 mentioned this pull request Mar 12, 2023
10 tasks
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Mar 14, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Mar 14, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Mar 15, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Mar 15, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Mar 15, 2023
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Mar 15, 2023
th0ma7 added a commit that referenced this pull request Mar 28, 2023
* openh264: Import from gstreamer PR #5298

* twolame: Import from gstreamer PR #5298

* ffmpeg: Enable openh264 & twolame - import from gstreamer PR #5298

* ffmpeg4: Rename ffmpeg package to ffmpeg4 (preparation to ffmpeg5)

* ffmpeg: Remove twolame from TODO list

* ffmpeg4: Enable service-setup.sh script only on x64

* ffmpeg4: Miscelanious fixes to get things to build

* github-action: Prepare for ffmpeg5 builds

* ffmpeg5: First tentative build

* Bump package version and changelog

* ffmpeg5: Re-enable svthevc patch

* ffmpeg5: Disable asm optimizations for x86_64 & i686

* ffmpeg6: First tentative basic package

* ffmpeg6: Update PLIST

* nasm: Update from version 2.15.5 to 2.16.1

* libaom: Re-order and allow ASM builds (from cmake-env.mk fix)

* x265: Fix aarch64 ASM build

* ffmpeg4: Re-order ASM code & enable neon optimization for aarch64

* ffmpeg5-6: Re-order ASM code & enable neon optimization for aarch64

* libvpx: Update from version 1.12 to 1.13 and switch to nasm

* libvpx: Disable neon on armv7/7l/8 when using gcc <= 4.9

* x264: Update to latest commit and enable ASM for aarch64

* libvpx: Set nasm to be specific to x86 arch only (x86asm)

* x264: Fix typo

* x264: Add more details about ARM ASM compiling

* libaom: Remove unused comments and trailing blank line

* opus: Fix for comcerto2k-7.1

* ffmpeg: Reorder ASM code and enable on aarch64

* x265: Fix build for comcerto2k-7.1

* ffmpeg6: Fix minor typos

* ffmpeg5-6: Build fix using good old replace ARCH by FFMPEG_ARCH

* ffmpeg4: Re-use ffmpeg5-6 asm makefile code

* tvheadend: Fix FFMPEG_DIR variable

* libva: Update from version 2.16 to version 2.17

* libdrm: Update from version 2.4.114 to 2.4.115

* intel-gmmlib: Update from version 22.3.1 to 22.3.4

* ffmpeg6: Enable SVT-HEVC plugin

* ffmpeg6: Forgot to also include svt-hevc patch for enablement

* dav1d: Update from version 1.0.0 to 1.1.0

* frei0r: Update from version 1.8.0 to 2.2.0

* ffmpeg4: Rename back to ffmpeg & enforce ffmpeg4 directory install

* ffmpeg5-6: Aling DISPLAY_NAME for all ffmpeg versions

* ffmpeg4: Ensure to use ffmpeg4 as cross dependency

* libass: Update from version 0.16.0 to 0.17.1

* SVT-AV1: Update from version 1.3.0 to 1.4.1

* ffmpeg4: Update changelog

* ffmpeg*: Add -lm for svt-av1 and remove redundant frei0r entry

* level-zero: Add version 1.9.4 as ICG dependency

* frei0r: Add cairo as dependency & disable CMAKE_USE_TOOLCHAIN_FILE

* ffmpeg6: Import jellyfin ffmpeg6 patches

* ffmpeg4-5-6: Enable symbolic links in /usr/local/bin

* ffmpeg4-5-6: Fix /usr/local/bin symlink

* service.mk: Add ability to generate json for VIDEODRIVER access

Having a preset conf/resource file makes it that no other
parameters can be set in the resulting file.  This removes the
need of the static file for accessing video-driver by generating
it directly within the normal jq call.

* ffmpeg4-5-6: Misc fixes including symlinks and proper rpath for v4

* github-action: Fix mgmnt of ffmpeg,ffmpeg5,ffmpeg6 dependent spk

* github-action: ffmpeg package is actually spk/ffmpeg4

* ffmpeg5: Update jellyfin patches

* ffmpeg6: Update jellyfin patches

* ffmpeg6: Remove invalid older jellyfin patch

* ffmpeg4: Update howto pertaining to jellyfin patches

* chromaprint+comskip+tvh: Fix ffmpeg dependency version

* tvheadend: Update changelog for updated openssl version

Co-authored-by: hgy59 <[email protected]>

* comskip+chromaprint+tvh: Update SPK_DEPENDS automatically

* svt-av1: Update digests & directory now based on git hash

---------

Co-authored-by: hgy59 <[email protected]>
@hgy59 hgy59 added the new-package PR/WIP for a new package label Apr 7, 2023
hgy59 added a commit to hgy59/spksrc that referenced this pull request May 20, 2023
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
hgy59 added a commit to hgy59/spksrc that referenced this pull request May 20, 2023
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
hgy59 added a commit to hgy59/spksrc that referenced this pull request May 21, 2023
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
hgy59 added a commit to hgy59/spksrc that referenced this pull request May 21, 2023
- native/glib is not required, since glib-mkenums is a python script and must not be built for the build system
- adapted from SynoCommunity#5298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Package Request] Gstreamer (Tried and failed)
4 participants