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

Build Flatpak Package #3773

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

varungujarathi9
Copy link
Contributor

closes #3512
Build Flatpak package of Owncast build

Copy link

cypress bot commented Jun 7, 2024

Passing run #17056 ↗︎

0 87 0 0 Flakiness 0

Details:

Merge b244e41 into ac9dfa2...
Project: Owncast Web Frontend Commit: 6e8b45f13f ℹ️
Status: Passed Duration: 04:15 💡
Started: Jun 7, 2024 5:18 AM Ended: Jun 7, 2024 5:23 AM

Review all test suite changes for PR #3773 ↗︎

Earthfile Outdated Show resolved Hide resolved
@gabek
Copy link
Member

gabek commented Jun 9, 2024

I'm surprised this was working for you. I had to make a few changes to get it to work. Could we compare to see why it was working for you but not for me? See my recent commit to see the changes I had to make.

Also --allow-privileged needs to be used with the earthly command for these changes to work.

@varungujarathi9
Copy link
Contributor Author

Hmm that's strange, but the current changes are working for me. We can go forward with these.

@gabek
Copy link
Member

gabek commented Jun 13, 2024

Now that we have some actual Flatpaks I'll do some testing of actually using them.

]
}
],
"finish-args": ["--socket=x11", "--share=network"]
Copy link
Member

Choose a reason for hiding this comment

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

When installing this it required X11 permissions, even though this is server software and not going to necessarily be installed on a desktop machine. Is X11 permissions required?

image

@gabek
Copy link
Member

gabek commented Jun 13, 2024

  • Version number isn't set, it thinks it's just a development build

image

  • Transcoding isn't working. My guess is a flatpak has no access to ffmpeg?

image

  • Seems to be a problem even running the application with the io read/write error.
  • I'm not sure where the data directory is located.

image

@mahmed2000
Copy link
Contributor

mahmed2000 commented Jun 14, 2024

X11 permissions aren't required and that arg can be omitted, but the runtime adds x11 libs to the build anyway along with wayland and others. https://docs.flatpak.org/en/latest/available-runtimes.html#freedesktop, https://docs.flatpak.org/en/latest/sandbox-permissions.html#standard-permissions

It has ffmpeg and access to it, however I'd guess it wouldn't be compiled with codec support. There's a dedicated runtime extension org.freedesktop.Platform.ffmpeg-full for all codecs which would include x264.

The IO error is ffmpeg's input stdio pipe closing, probably because it can't handle x264 due to ^ and crashes.

For the data folder I'd check

  • ~/.var/app/
  • ~/.local/share/flatpak/
  • /var/lib/flatpak/
    Probably best to add a dedicated directory instead ~/.owncast/data?
Flatpak
This page provides information about available Flatpak runtimes. It is primarily intended as information for application developers and distributors. There are currently three main runtimes availab...
Flatpak
One of Flatpak’s main goals is to increase the security of desktop systems by isolating applications from one another. This is achieved using sandboxing and means that, by default, applications tha...

@varungujarathi9
Copy link
Contributor Author

Hey @mahmed2000
I made the changes to support ffmpeg runtime extension by doing the following

"add-extensions": [
  {
    "org.freedesktop.Platform.ffmpeg-full": [
      {
        "version": "23.08",
        "directory": "lib/ffmpeg",
        "add-ld-path": "."
      }
    ]
  }
]

But it doesn't seem to work.

I also tried changing the runtime to org.freedesktop.Platform.ffmpeg-full.

How do I correctly add the ffmpeg support?

@mahmed2000
Copy link
Contributor

I'm not entirely sure, I don't particularly use flatpak.

You could try just running the ffmpeg command in the flatpak to check the installed codecs. flatpak run --command=ffmpeg <flatpak.name.here>. The banner output should show the codecs supported, specifically --enable-libx264. You could also inspect the flatpak for the libx264.so library file.

I'm guessing either that ffmpeg still doesn't have libx264 support, in which case it needs to be done through a module source instead, see OBS studio's flatpak for an example.

Or it can't find the libx264 library which isn't included, in which case that needs to be added as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flatpak Packaging
3 participants