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

Encodebin #178

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1de3222
build: Enable gst-plugins-ugly checks
SeaDve Aug 23, 2022
c325955
refactor: Use encodebin
SeaDve Aug 23, 2022
b0b9cd5
style: Add more debug logs
SeaDve Aug 23, 2022
88cd377
chore: Update todo
SeaDve Aug 23, 2022
1a6596d
Don't set avoid-reencoding encodebin property
SeaDve Aug 23, 2022
f29315a
Include all encodebin elements
SeaDve Aug 24, 2022
e4c357f
Rename DEFAULT_GIF_FRAMERATE -> GIF_FRAMERATE_OVERRIDE
SeaDve Aug 24, 2022
cf4070e
Log more message on recording bus
SeaDve Aug 24, 2022
295de4c
Don't bundle gstreamer-vaapi
SeaDve Aug 24, 2022
fd3279b
Enable GST_DEBUG to 3
SeaDve Aug 24, 2022
5effe4f
Don't notify duration if equal to last
SeaDve Aug 24, 2022
f61566b
refactor: Use iterator to avoid mut
SeaDve Aug 24, 2022
bee0602
Properly set properties on encoders
SeaDve Aug 24, 2022
59a967f
Improve naming
SeaDve Aug 24, 2022
7e2ab9b
Add baseline on MKV profile
SeaDve Aug 25, 2022
fad4a89
Separate into different files and improve ElementProperties API
SeaDve Aug 25, 2022
c1a542a
Init gst
SeaDve Aug 25, 2022
86f9d5f
Drop misleading docs
SeaDve Aug 25, 2022
8f084ef
Drop useless ProfileBuilder constructor
SeaDve Aug 25, 2022
fb2a004
Update todo
SeaDve Aug 25, 2022
da029a8
Don't panic when failed to set field from str
SeaDve Aug 25, 2022
6438585
Refactor ElementFactoryPropertiesMap
SeaDve Aug 25, 2022
ebfabdf
Refactor profiles
SeaDve Aug 26, 2022
4530e8f
Fix test
SeaDve Aug 26, 2022
4d32c6e
Add test
SeaDve Aug 26, 2022
0ca5861
Simplify ElementProperties default
SeaDve Aug 27, 2022
8b2f255
Simplify test
SeaDve Aug 27, 2022
3fc9586
Introduce Profiles Window
SeaDve Aug 29, 2022
04214b3
Add todo
SeaDve Aug 29, 2022
8e31acd
Fix checks
SeaDve Aug 29, 2022
848c1bb
Rename dup to deep_clone
SeaDve Aug 29, 2022
a0f1173
Fix setting element on start
SeaDve Aug 29, 2022
7c7db99
Refactor profile
SeaDve Aug 30, 2022
5c11d49
Drop useless braces
SeaDve Aug 31, 2022
fec75d2
Feat to change file extension
SeaDve Aug 31, 2022
06f02a3
Fix crash
SeaDve Aug 31, 2022
d53c28b
Use the last active profile as the active instead of the first one if…
SeaDve Aug 31, 2022
d0fd495
Add ability to specify caps values
SeaDve Aug 31, 2022
2d6b9ab
Missing pot file
SeaDve Aug 31, 2022
3946095
If profile is last active when it is removed, clear out last active
SeaDve Sep 1, 2022
fc26549
Improve profile tile UI
SeaDve Sep 1, 2022
3aa9c83
Add indicator whether a profile is builtin and/or unavailable
SeaDve Sep 1, 2022
90131e6
improve label
SeaDve Sep 1, 2022
62cbfe0
Fix check
SeaDve Sep 1, 2022
fa99e3f
Fix panic when copying empty Profile
SeaDve Sep 1, 2022
a79dd3a
Use GNOME 43 runtime
SeaDve Sep 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ gettext-rs = { version = "0.7.0", features = ["gettext-system"] }
gtk = { package = "gtk4", version = "0.4.5" }
gdk-wayland = { package = "gdk4-wayland", version = "0.4.5" }
gdk-x11 = { package = "gdk4-x11", version = "0.4.5" }
glib = { version = "0.15.12", features = ["v2_72"]}
adw = { package = "libadwaita", version = "0.2.0-alpha.2", features = ["v1_2"] }
gst = { package = "gstreamer", version = "0.18.2" }
gst_video = { package = "gstreamer-video", version = "0.18.2" }
gst_pbutils = { package = "gstreamer-pbutils", version = "0.18.2", features = [
"v1_20",
] }
gst-plugin-gif = "0.8.0"
futures-channel = "0.3.19"
futures-util = { version = "0.3", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ more efficient or perhaps faster encoding. It is not guaranteed to work on all
devices, so it may give errors such as `no element vaapivp8enc` depending on the
features and capability of your hardware.

First, you have to install `gstreamer-vaapi` on your system. If Kooha is installed
through Flatpak, it is as simple as running `flatpak install org.freedesktop.Platform.GStreamer.gstreamer-vaapi`.

To enable all the supported drivers and force Kooha to use VAAPI elements, set
`GST_VAAPI_ALL_DRIVERS` and `KOOHA_VAAPI` both to 1 respectively. These
environment variables are needed for hardware accelerated encoding.
Expand Down
49 changes: 6 additions & 43 deletions build-aux/io.github.seadve.Kooha.Devel.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "io.github.seadve.Kooha.Devel",
"runtime": "org.gnome.Platform",
"runtime-version": "42",
"runtime-version": "43",
"sdk": "org.gnome.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable",
Expand All @@ -18,7 +18,8 @@
"--talk-name=org.freedesktop.FileManager1",
"--env=RUST_BACKTRACE=1",
"--env=RUST_LOG=kooha=debug",
"--env=G_MESSAGES_DEBUG=none"
"--env=G_MESSAGES_DEBUG=none",
"--env=GST_DEBUG=3"
],
"build-options": {
"append-path": "/usr/lib/sdk/llvm14/bin:/usr/lib/sdk/rust-stable/bin",
Expand Down Expand Up @@ -52,53 +53,15 @@
"builddir": true,
"config-opts": [
"-Ddoc=disabled",
"-Dorc=disabled",
"-Dnls=disabled",
"-Dtests=disabled",
"-Dgobject-cast-checks=disabled",
"-Dglib-asserts=disabled",
"-Dglib-checks=disabled"
"-Dgpl=enabled"
],
"sources": [
{
"type": "archive",
"url": "https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.18.6.tar.xz",
"sha256": "4969c409cb6a88317d2108b8577108e18623b2333d7b587ae3f39459c70e3a7f"
}
]
},
{
"name": "gstreamer-vaapi",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"-Ddoc=disabled",
"-Dtests=disabled",
"-Dexamples=disabled",
"-Dwith_encoders=yes"
],
"sources": [
{
"type": "archive",
"url": "https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-1.18.6.tar.xz",
"sha256": "ab6270f1e5e4546fbe6f5ea246d86ca3d196282eb863d46e6cdcc96f867449e0"
}
]
},
{
"name": "libadwaita",
"buildsystem": "meson",
"config-opts": [
"-Dtests=false",
"-Dexamples=false",
"-Dvapi=false",
"-Dintrospection=disabled"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/libadwaita.git",
"tag": "1.2.beta"
"url": "https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.20.3.tar.xz",
"sha256": "8caa20789a09c304b49cf563d33cca9421b1875b84fcc187e4a385fa01d6aefd"
}
]
},
Expand Down
9 changes: 0 additions & 9 deletions data/io.github.seadve.Kooha.gschema.xml.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<schemalist>
<schema path="/io/github/seadve/Kooha/" id="@app-id@" gettext-domain="@gettext-package@">
<key type="s" name="video-format">
<choices>
<choice value="webm"/>
<choice value="mkv"/>
<choice value="mp4"/>
<choice value="gif"/>
</choices>
<default>"webm"</default>
</key>
<key type="s" name="capture-mode">
<choices>
<choice value="monitor-window"/>
Expand Down
2 changes: 2 additions & 0 deletions data/resources/resources.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<file compressed="true" preprocess="xml-stripblanks">icons/scalable/actions/selection-symbolic.svg</file>
<file compressed="true" preprocess="xml-stripblanks">icons/scalable/actions/source-pick-symbolic.svg</file>
<file compressed="true">style.css</file>
<file compressed="true" preprocess="xml-stripblanks">ui/profile-tile.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/profile-window.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">ui/shortcuts.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/window.ui</file>
</gresource>
Expand Down
26 changes: 26 additions & 0 deletions data/resources/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,29 @@ button.copy-done {
color: @window_fg_color;
}
}

profiletile .inner-box {
padding: 24px;
}

profiletile.selected .inner-box {
padding: 21px;
border-style: solid;
border-width: 3px;
border-color: @accent_color;
}

profiletile .attribute {
padding: 3px 6px;
border-radius: 99999px;
}

profiletile .attribute.builtin {
background-color: @accent_bg_color;
color: @accent_fg_color;
}

profiletile .attribute.unavailable {
background-color: @destructive_bg_color;
color: @destructive_fg_color;
}
157 changes: 157 additions & 0 deletions data/resources/ui/profile-tile.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="options_menu">
<item>
<attribute name="label" translatable="yes">Copy</attribute>
<attribute name="action">profile-tile.copy</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Delete</attribute>
<attribute name="action">profile-tile.delete</attribute>
</item>
</menu>
<template class="KoohaProfileTile" parent="GtkFlowBoxChild">
<child>
<object class="GtkOverlay">
<child type="overlay">
<object class="GtkMenuButton">
<property name="valign">start</property>
<property name="halign">end</property>
<property name="margin-end">12</property>
<property name="margin-top">12</property>
<property name="icon-name">view-more-symbolic</property>
<property name="menu-model">options_menu</property>
<style>
<class name="flat"/>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<style>
<class name="card"/>
<class name="inner-box"/>
</style>
<child>
<object class="GtkLabel" id="name_label">
<property name="xalign">0</property>
<property name="max-width-chars">15</property>
<property name="ellipsize">end</property>
</object>
</child>
<child>
<object class="GtkGrid">
<property name="column-spacing">12</property>
<property name="row-spacing">6</property>
<child>
<object class="GtkImage">
<property name="icon-name">package-x-generic-symbolic</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="muxer_label">
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="use-markup">True</property>
<style>
<class name="caption"/>
</style>
<layout>
<property name="column">1</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<property name="icon-name">video-x-generic-symbolic</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="video_encoder_label">
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="use-markup">True</property>
<style>
<class name="caption"/>
</style>
<layout>
<property name="column">1</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<property name="icon-name">audio-speakers-symbolic</property>
<layout>
<property name="column">0</property>
<property name="row">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="audio_encoder_label">
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="use-markup">True</property>
<style>
<class name="caption"/>
</style>
<layout>
<property name="column">1</property>
<property name="row">2</property>
</layout>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="builtin_attribute">
<property name="visible">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Built-In</property>
<property name="xalign">0</property>
<style>
<class name="caption"/>
<class name="attribute"/>
<class name="builtin"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="unavailable_attribute">
<property name="visible">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Unavailable</property>
<property name="xalign">0</property>
<style>
<class name="caption"/>
<class name="attribute"/>
<class name="unavailable"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
Loading