gstreamer-rs issueshttps://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues2023-12-18T08:00:20Zhttps://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/493Memory leak when using Play?2023-12-18T08:00:20ZZerowalkerMemory leak when using Play?I noticed when using the Play example, each "Play::new" will cause a memory leak.
Not sure why but my guess is that all resources aren't properly released upon drop.I noticed when using the Play example, each "Play::new" will cause a memory leak.
Not sure why but my guess is that all resources aren't properly released upon drop.https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/489GstPlay is not dropped although all references are dropped in user code.2023-12-18T08:00:20ZKévin CommailleGstPlay is not dropped although all references are dropped in user code.### Describe your issue
We use GstPlay along with the GstGtk4PaintableSink for our video player in [Fractal](https://gitlab.gnome.org/GNOME/fractal). Sometimes when the video player is dropped, the GstPlay it used still exists.
#### Ex...### Describe your issue
We use GstPlay along with the GstGtk4PaintableSink for our video player in [Fractal](https://gitlab.gnome.org/GNOME/fractal). Sometimes when the video player is dropped, the GstPlay it used still exists.
#### Expected Behavior
All instances of GstPlay are always dropped when the user code drops them.
#### Observed Behavior
Some instances of GstPlay seem to persist even if all references are dropped in user code.
#### Setup
- **Operating System:** Fedora Silverblue 38
- **Device:** Computer
- **gstreamer-rs Version:** 0.21.1
- **GStreamer Version:** 1.22.6
- **Command line:** bash
### Steps to reproduce the bug
It can be reproduced unreliably by running this project, and constructing/destroying the videos several times: https://gitlab.gnome.org/kcommaille/gst_play_ref.
Since it seems to happen when the app is busy, it helps to load a bigger video or present more videos.
It can be observed in too ways:
- The calls to constructed and dispose are logged, so you can compare the number of calls for both.
- Launch the app with this environment variable set: `GOBJECT_DEBUG=instance-count`; then open the GTK Inspector and watch the count of GstPlay in Global / Statistics. It does not always drop to 0 when the players are destroyed.
### How reproducible is the bug?
Intermittent. Like I said it seems to happen when the app is busy. When several video players are shown at once, I could sometimes see that all of them are dropped, some of them, or none of them.
### Solutions you have tried
I was wondering if that had anything to do with the media still playing when the player is dropped so I tried setting the URI to `None` or stopping the GstPlay on dispose.https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/130Cross-compilation (host x86_64 linux - target aarch64 linux)2023-09-07T13:57:45ZSebastian DrögeCross-compilation (host x86_64 linux - target aarch64 linux)*Created by: photex*
Howdy!
It appears that the associated sys crate for gstreamer relies on pkg-config. This seems to mean it'd be almost impossible to cross-compile using what's available via apt (since the dev packages cannot co-e...*Created by: photex*
Howdy!
It appears that the associated sys crate for gstreamer relies on pkg-config. This seems to mean it'd be almost impossible to cross-compile using what's available via apt (since the dev packages cannot co-exist).
I'm developing a system that has components running on both x86_64 systems and embedded aarch64 systems (nvidia jetson) and I'd love to use this without having to kludge something together.
Have you tried to build any of these crates using an alternate rust target? Any advice?
Cheers!
Chiphttps://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/480gstreamer1.0-libav - file detection inconsistencies?2023-08-16T06:19:50ZUwe Dippelgstreamer1.0-libav - file detection inconsistencies?I new in here, and didn't find any forum to ask. Google also couldn't help me, sorry.
This is my issue: Recently I discovered that certain files were missing in the list of files shown (and subsequently streamed) by rygel. I have updated...I new in here, and didn't find any forum to ask. Google also couldn't help me, sorry.
This is my issue: Recently I discovered that certain files were missing in the list of files shown (and subsequently streamed) by rygel. I have updated the discovery process a number of times, and could reproduce the failure for certain files of the same extension: mp4.
Here are two examples:
```
$ file Die_Konsequenz.mp4
Die_Konsequenz.mp4: ISO Media, MP4 v2 [ISO 14496-14]
$ file Die_Jagd.mp4
Die_Jagd.mp4: ISO Media, MP4 Base Media v1 [ISO 14496-12:2003]
```
Both seem to be of the same format, mp4, but the first one is never indexed, the second file always.
This is the output of the installed support:
```
$ gst-inspect-1.0 | grep v2
...
libav: avdec_msmpeg4v2: libav MPEG-4 part 2 Microsoft variant version 2 decoder
libav: avenc_msmpeg4v2: libav MPEG-4 part 2 Microsoft variant version 2 encoder
...
```
If anything else is helpful, for more detail, please ask!https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/436Error when building example "ld: framework not found Cocoa"2023-04-04T09:10:03ZChang Long Zhu JinError when building example "ld: framework not found Cocoa"Hello,
I am trying to build the "gtksink" example by copying and pasting the code, and using the Cargo.toml below:
```toml
[package]
name = "example-rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at http...Hello,
I am trying to build the "gtksink" example by copying and pasting the code, and using the Cargo.toml below:
```toml
[package]
name = "example-rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
gst_gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gtk = { git = "https://github.com/gtk-rs/gtk3-rs.git", optional = true}
gdk = { git = "https://github.com/gtk-rs/gtk3-rs", package = "gdk", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "gio", optional = true }
gst-gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-gl-egl = { package = "gstreamer-gl-egl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-gl-wayland = { package = "gstreamer-gl-wayland", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-gl-x11 = { package = "gstreamer-gl-x11", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-play = { package = "gstreamer-play", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-player = { package = "gstreamer-player", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
ges = { package = "gstreamer-editing-services", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-sdp = { package = "gstreamer-sdp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-rtsp = { package = "gstreamer-rtsp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-rtsp-server = { package = "gstreamer-rtsp-server", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-allocators = { package = "gstreamer-allocators", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
anyhow = "1.0"
derive_more = "0.99.5"
futures = "0.3"
byte-slice-cast = "1"
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"], optional = true }
pango = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
glutin = { version = "0.29", optional = true }
once_cell = "1.0"
image = { version = "0.24", optional = true }
memmap2 = { version = "0.5", optional = true }
memfd = { version = "0.6", optional = true }
uds = { version = "0.2", optional = true }
[target.'cfg(windows)'.dependencies]
windows = { version = "0.43", features=["Win32_Graphics_Direct3D11",
"Win32_Foundation", "Win32_Graphics_Direct3D", "Win32_Graphics_Dxgi",
"Win32_Graphics_Dxgi_Common", "Win32_Graphics_Direct2D",
"Win32_Graphics_Direct2D_Common", "Win32_Graphics_DirectWrite",
"Foundation_Numerics"], optional = true }
[target.'cfg(target_os = "macos")'.dependencies]
#cocoa = "0.24"
core-foundation = "0.9"
[build-dependencies]
gl_generator = { version = "0.14", optional = true }
[features]
default = []
gtksink = ["gtk", "gio"]
gtkvideooverlay = ["gtk", "gdk", "gio"]
gtkvideooverlay-x11 = ["gtkvideooverlay"]
gtkvideooverlay-quartz = ["gtkvideooverlay"]
rtsp-server = ["gst-rtsp-server", "gst-rtsp", "gst-sdp"]
rtsp-server-record = ["gst-rtsp-server", "gst-rtsp", "gio"]
pango-cairo = ["pango", "pangocairo", "cairo-rs"]
overlay-composition = ["pango", "pangocairo", "cairo-rs"]
gl = ["gst-gl", "gl_generator", "glutin"]
gst-gl-x11 = ["dep:gst-gl-x11"]
gst-gl-egl = ["dep:gst-gl-egl"]
gst-gl-wayland = ["dep:gst-gl-wayland"]
allocators = ["gst-allocators", "memmap2", "memfd", "uds"]
# main
[[bin]]
name = "main"
path = "src/main.rs"
# hello_world
[[bin]]
name = "hello_world_1"
path = "src/hello_world/1/main.rs"
[[bin]]
name = "hello_world_2"
path = "src/hello_world/2/main.rs"
[[bin]]
name = "hello_world_3"
path = "src/hello_world/3/main.rs"
[[bin]]
name = "gst_example_1"
path = "src/gst/example_1/main.rs"
[[bin]]
name = "gtksink"
path = "src/gst/gtksink/main.rs"
```
However, I am seeing this issue:
```
= note: ld: framework not found Cocoa
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
I believe this is an issue with my installation, but I have already uninstalled and reinstalled `XCode command line tool`, and same issue. Is there a flag I can set, or a way to proceed?
Thanks in advance!https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/445double free or corruption (out) error2023-04-04T09:09:50ZYaoda Liudouble free or corruption (out) errorHi, I got the error message when I running the examples code appsrc.rs
```
Producing frame 0
double free or corruption (out)
[1] 1476008 IOT instruction (core dumped) cargo run --bin appsrc
```
I have no idea how to fix this, do I ...Hi, I got the error message when I running the examples code appsrc.rs
```
Producing frame 0
double free or corruption (out)
[1] 1476008 IOT instruction (core dumped) cargo run --bin appsrc
```
I have no idea how to fix this, do I missing any information? thanks.
Here's my part of Cargo.toml (both `0.19.0` and `0.20.0` get the same error)
```
[dependencies]
gstreamer = "0.19.0"
gstreamer-base = "0.19.0"
gstreamer-app = "0.19.0"
gstreamer-gl = "0.19.0"
gstreamer-gl-egl = "0.19.0"
gstreamer-gl-wayland = "0.19.0"
gstreamer-gl-x11 = "0.19.0"
gstreamer-audio = "0.19.0"
gstreamer-video = "0.19.0"
anyhow = "1.0"
derive_more = "0.99.5"
futures = "0.3"
image = "0.24.5"
gl = "0.14.0"
glutin = { version = "0.29" }
termion = { version = "2" }
once_cell = "1.0"
[build-dependencies]
gl_generator = { version = "0.14" }
```https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/457Can't compile because of gstreamer-validate dependency2023-04-03T19:38:44ZEva PaceCan't compile because of gstreamer-validate dependencyHello, I'm trying to run `cargo build` in my Arch Linux and the crate `gstreamer-validate` fails to compile because it can't find a system dependency.
I tried to install multiple `gstreamer` related packages like:
- `gstreamer`
- `gst-p...Hello, I'm trying to run `cargo build` in my Arch Linux and the crate `gstreamer-validate` fails to compile because it can't find a system dependency.
I tried to install multiple `gstreamer` related packages like:
- `gstreamer`
- `gst-plugins-base`
- `gst-plugins-bad`
- `gst-plugins-ugly`
- `gst-plugins-good`
- `gst-libav`
- `gst-rtsp-server`
- `gst-editing-services`
But none fixed the issue unfortunately. Here are the logs:
```
$ cargo build
Skipping git submodule `https://github.com/gtk-rs/gir` due to update strategy in .gitmodules
Skipping git submodule `https://github.com/gtk-rs/gir-files` due to update strategy in .gitmodules
Skipping git submodule `https://github.com/gtk-rs/gir` due to update strategy in .gitmodules
Skipping git submodule `https://github.com/gtk-rs/gir-files` due to update strategy in .gitmodules
Compiling gstreamer-validate-sys v0.21.0 (/home/rei/gstreamer-rs/gstreamer-validate/sys)
Compiling tutorials v0.21.0 (/home/rei/gstreamer-rs/tutorials)
Compiling examples v0.21.0 (/home/rei/gstreamer-rs/examples)
The following warnings were emitted during compilation:
warning: `"pkg-config" "--libs" "--cflags" "gstreamer-validate-1.0" "gstreamer-validate-1.0 >= 1.22"` did not exit successfully: exit status: 1
error: failed to run custom build command for `gstreamer-validate-sys v0.21.0 (/home/rei/gstreamer-rs/gstreamer-validate/sys)`
Caused by:
process didn't exit successfully: `/home/rei/gstreamer-rs/target/debug/build/gstreamer-validate-sys-41f9ec2fb4c88b11/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=GSTREAMER_VALIDATE_1.0_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:warning=`"pkg-config" "--libs" "--cflags" "gstreamer-validate-1.0" "gstreamer-validate-1.0 >= 1.22"` did not exit successfully: exit status: 1
error: could not find system library 'gstreamer-validate-1.0' required by the 'gstreamer-validate-sys' crate
--- stderr
Package gstreamer-validate-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-validate-1.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gstreamer-validate-1.0', required by 'virtual:world', not found
Package 'gstreamer-validate-1.0', required by 'virtual:world', not found
warning: build failed, waiting for other jobs to finish...
```
Do you know which package should I install to fix the issue? Thanks in advance! :slight_smile:https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/423MacOs M1 Library not loaded: @rpath/libgobject-2.0.0.dylib2022-11-14T16:30:49ZMr.BlackMacOs M1 Library not loaded: @rpath/libgobject-2.0.0.dylibhi, i also had the same problem.
The `cargo build` succeeded.
However, `cargo run ` the following error occurred
- `Library not loaded: @rpath/libgobject-2.0.0.dylib`
```bash
Finished dev [unoptimized + debuginfo] target(s) in 18...hi, i also had the same problem.
The `cargo build` succeeded.
However, `cargo run ` the following error occurred
- `Library not loaded: @rpath/libgobject-2.0.0.dylib`
```bash
Finished dev [unoptimized + debuginfo] target(s) in 18.98s
Running `target/debug/rust_gstream_rtmp`
dyld[21579]: Library not loaded: @rpath/libgobject-2.0.0.dylib
Referenced from: <49FDC051-D944-3BFE-9772-A24BF847CA6C> /Users/ken/codes/rust_project/gstreamer_test_1/rust_gstream_rtmp/target/debug/rust_gstream_rtmp
Reason: tried: '/System/Volumes/Preboot/Cryptexes/OS@rpath/libgobject-2.0.0.dylib' (no such file), '/Users/ken/codes/rust_project/gstreamer_test_1/rust_gstream_rtmp/target/debug/deps/libgobject-2.0.0.dylib' (no such file), '/Users/ken/codes/rust_project/gstreamer_test_1/rust_gstream_rtmp/target/debug/libgobject-2.0.0.dylib' (no such file), '/Users/ken/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgobject-2.0.0.dylib' (no such file), '/Users/ken/.rustup/toolchains/stable-aarch64-apple-darwin/lib/libgobject-2.0.0.dylib' (no such file), '/Users/ken/lib/libgobject-2.0.0.dylib' (no such file), '/usr/local/lib/libgobject-2.0.0.dylib' (no such file), '/usr/lib/libgobject-2.0.0.dylib' (no such file, not in dyld cache)
[1] 21579 abort cargo run
```
I'm pretty sure I didn't install from `brew`. all installation packages are from official.
```
We recommend using the official GStreamer binaries over Homebrew, especially as GStreamer in Homebrew is [currently broken]
```
Environments : **M1 Mac**
`~/.zshrc`
```bash
export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin${PATH:+:$PATH}"
```
`GStreamer Version`
```bash
❯ gst-launch-1.0 --version
gst-launch-1.0 version 1.21.1
GStreamer 1.21.1
Unknown package origin
```
`Rust Version`
```bash
❯ rustup -V
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.65.0 (897e37553 2022-11-02)`
```
`cargo.toml`
```toml
[package]
name = "rust_gstream_rtmp"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
gstreamer = "0.19.2"
[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.24"
```
`main.rs`
```rust
use gstreamer::prelude::*;
mod tutorials_common;
fn tutorial_basic_1() {
// Initialize GStreamer
gstreamer::init().unwrap();
// Build the pipeline
let uri =
"https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm";
let pipeline = gstreamer::parse_launch(&format!("playbin uri={}", uri)).unwrap();
// Start playing
pipeline
.set_state(gstreamer::State::Playing)
.expect("Unable to set the pipeline to the `Playing` state");
// Wait until error or EOS
let bus = pipeline.bus().unwrap();
for msg in bus.iter_timed(gstreamer::ClockTime::NONE) {
use gstreamer::MessageView;
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
println!(
"Error from {:?}: {} ({:?})",
err.src().map(|s| s.path_string()),
err.error(),
err.debug()
);
break;
}
_ => (),
}
}
// Shutdown pipeline
pipeline
.set_state(gstreamer::State::Null)
.expect("Unable to set the pipeline to the `Null` state");
}
fn main() {
// tutorials_common::run is only required to set up the application environment on macOS
// (but not necessary in normal Cocoa applications where this is set up automatically)
tutorials_common::run(tutorial_basic_1);
}
```https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/415I have error `Segmentation fault (core dumped)` in alpine2022-10-15T21:00:46ZGolubev MatveiI have error `Segmentation fault (core dumped)` in alpineHello. I will build and run small rust project with gstreamer in alpine docker container
```rust
fn main() {
gst::init().unwrap();
let pipeline = gst::parse_launch("videotestsrc ! fakesink").unwrap();
pipeline.set_state(gst...Hello. I will build and run small rust project with gstreamer in alpine docker container
```rust
fn main() {
gst::init().unwrap();
let pipeline = gst::parse_launch("videotestsrc ! fakesink").unwrap();
pipeline.set_state(gst::State::Playing).unwrap();
let bus = pipeline.bus().unwrap();
for msg in bus.iter_timed(gst::ClockTime::NONE) {
use gst::MessageView;
match msg.view() {
MessageView::Eos(_) => break,
MessageView::Error(err) => {
eprintln!("ERR: {}", err.error());
break;
}
_ => (),
}
}
pipeline.set_state(gst::State::Null).unwrap();
}
```
but i have error at run
```rust
fn main() {
println!("0");
gst::init().unwrap();
println!("1");
...
```
```sh
cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/scratch-gstreamer`
0
Segmentation fault (core dumped)
```https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/264We should have an error type so we can avoid using glib or anyhow for error h...2022-09-15T11:44:00ZOtavio SalvadorWe should have an error type so we can avoid using glib or anyhow for error handlingTo be capable of dropping the anyhow dependency, I had to add `glib` dependency and wrap:
```rust
#[derive(Display, From, Error, Debug)]
pub(crate) enum Error {
#[display(fmt = "No animation parts to play")]
NoAnimation,
#[...To be capable of dropping the anyhow dependency, I had to add `glib` dependency and wrap:
```rust
#[derive(Display, From, Error, Debug)]
pub(crate) enum Error {
#[display(fmt = "No animation parts to play")]
NoAnimation,
#[display(transparent)]
Bool(glib::error::BoolError),
#[display(transparent)]
Glib(glib::error::Error),
#[display(transparent)]
StateChange(gst::StateChangeError),
}
```
However, I think we should be capable of do:
```rust
#[derive(Display, From, Error, Debug)]
pub(crate) enum Error {
#[display(fmt = "No animation parts to play")]
NoAnimation,
#[display(transparent)]
Gstreamer(gst::Error),
}
```https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/387Using glupload on windows with glutin and glow2022-09-15T11:43:56ZHenrique PerigoUsing glupload on windows with glutin and glowHello, I’m trying to build an app using `glutin` `glow` and `gstreamer` on Windows
I’m using as a reference the [glupload](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/blob/main/examples/src/glupload.rs) example, I’m able to ...Hello, I’m trying to build an app using `glutin` `glow` and `gstreamer` on Windows
I’m using as a reference the [glupload](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/blob/main/examples/src/glupload.rs) example, I’m able to compile the app but I’m running in this runtime error:
```jsx
0:00:23.651939000 11680 00000182A2FD4D80 WARN glcontext gstglcontext.c:1257:gst_gl_context_create_thread:<glcontextwgl0> Failed to create context
0:00:23.654347000 11680 00000182A2FD4D00 WARN glbasefilter gstglbasefilter.c:608:gst_gl_base_filter_find_gl_context_unlocked:<gluploadelement0> error: failed to share contexts through wglShareLists 0xaa
0:00:25.927844000 11680 00000182A2FD4DC0 WARN glcontext gstglcontext.c:1257:gst_gl_context_create_thread:<glcontextwgl1> Failed to create context
0:00:25.929047000 11680 00000182A2FD4D00 WARN glbasefilter gstglbasefilter.c:608:gst_gl_base_filter_find_gl_context_unlocked:<glcolorconvertelement0> error: failed to share contexts through wglShareLists 0xaa
0:00:31.059709000 11680 00000182A2FD4E00 WARN glcontext gstglcontext.c:1257:gst_gl_context_create_thread:<glcontextwgl2> Failed to create context
0:00:31.061391000 11680 00000182A2FD4D00 WARN glbasefilter gstglbasefilter.c:608:gst_gl_base_filter_find_gl_context_unlocked:<gluploadelement0> error: failed to share contexts through wglShareLists 0xaa
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.974: gst_caps_is_subset: assertion 'subset != NULL' failed
0:00:33.962252000 11680 00000182A2FD4D00 ERROR basetransform gstbasetransform.c:485:gst_base_transform_transform_caps:<gluploadelement0> transform_caps returned caps (NULL) which are not a real subset of the filter caps video/x-raw, format=(string){ AYUV64, ARGB64, GBRA_12LE, GBRA_12BE, Y412_LE, Y412_BE, A444_10LE, GBRA_10LE, A444_10BE, GBRA_10BE, A422_10LE, A422_10BE, A420_10LE, A420_10BE, RGB10A2_LE, BGR10A2_LE, Y410, GBRA, ABGR, VUYA, BGRA, AYUV, ARGB, RGBA, A420, Y444_16LE, Y444_16BE, v216, P016_LE, P016_BE, Y444_12LE, GBR_12LE, Y444_12BE, GBR_12BE, I422_12LE, I422_12BE, Y212_LE, Y212_BE, I420_12LE, I420_12BE, P012_LE, P012_BE, Y444_10LE, GBR_10LE, Y444_10BE, GBR_10BE, r210, I422_10LE, I422_10BE, NV16_10LE32, Y210, v210, UYVP, I420_10LE, I420_10BE, P010_10LE, NV12_10LE32, NV12_10LE40, P010_10BE, Y444, GBR, NV24, xBGR, BGRx, xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, Y41B, IYU1, YVU9, YUV9, RGB16, BGR16, RGB15, BGR15, RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], multiview-mode=(string){ mono, left, right }; video/x-bayer, format=(string){ bggr, rggb, grbg, gbrg }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], multiview-mode=(string){ mono, left, right }
** (pira-gst.exe:11680): WARNING **: 06:55:10.977: gluploadelement0: transform_caps returned caps which are not a real subset of the filter caps
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_intersect_full: assertion 'GST_IS_CAPS (caps2)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_mini_object_unref: assertion 'mini_object != NULL' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_mini_object_unref: assertion 'mini_object != NULL' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_intersect_full: assertion 'GST_IS_CAPS (caps2)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_is_empty: assertion 'GST_IS_CAPS (caps)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_intersect_full: assertion 'GST_IS_CAPS (caps1)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.978: gst_mini_object_unref: assertion 'mini_object != NULL' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.978: gst_mini_object_unref: assertion 'mini_object != NULL' failed
0:00:33.966942000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.968752000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.969730000 11680 00000182A2FD4D00 WARN GST_PADS gstpad.c:4303:gst_pad_peer_query:<videotestsrc0:src> could not send sticky events
0:00:33.971674000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progress0:00:33.973723000 11680 00000182A2FD4D00 WARN basesrc gstbasesrc.c:3127:gst_base_src_loop:<videotestsrc0> error: Internal data stream error.
0:00:33.974315000 11680 00000182A2FD4D00 WARN basesrc gstbasesrc.c:3127:gst_base_src_loop:<videotestsrc0> error: streaming stopped, reason not-negotiated (-4)
0:00:33.975122000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.975815000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.976519000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUive not accepted
```
Here's how I'm creating the gl context:
```
let gl_display = gst_gl::GLDisplay::new();
let mut shared_ctx_opt = None;
match unsafe { app.context.context().raw_handle() } {
piralib::glutin::platform::windows::RawHandle::Wgl(wgl_handle) => {
println!("WGL");
unsafe {
let raw_handle = wgl_handle as libc::uintptr_t;
shared_ctx_opt = gst_gl::GLContext::new_wrapped(
&gl_display,
raw_handle,
gst_gl::GLPlatform::WGL,
gst_gl::GLAPI::OPENGL3,
)
};
}
_ => (),
};
```
Here’s the code for reference if someone wants to see [https://github.com/Hperigo/pira-gst/blob/main/src/main.rs#L147](https://github.com/Hperigo/pira-gst/blob/main/src/main.rs#L147)https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/397gettingsrc->h != 0 error2022-09-15T11:43:29ZManoj Prasadgettingsrc->h != 0 errorI was trying to pipe udpsink data from above code into gst-launch and I’m gettingsrc->h != 0’ failed error.
Command executed in terminal as below. while gst-meet running in another terminal.
`gst-launch-1.0 -e -v udpsrc port=5000 ! vp9...I was trying to pipe udpsink data from above code into gst-launch and I’m gettingsrc->h != 0’ failed error.
Command executed in terminal as below. while gst-meet running in another terminal.
`gst-launch-1.0 -e -v udpsrc port=5000 ! vp9dec ! queue ! videoscale ! capsfilter caps='video/x-raw, width=1280, height=720' ! videoconvert ! autovideosink`
Error
`(gst-launch-1.0:48893): GStreamer-Video-CRITICAL **: 21:09:21.824: gst_video_center_rect: assertion 'src->h != 0' failed
(gst-launch-1.0:48893): GStreamer-Video-CRITICAL **: 21:09:21.824: gst_video_center_rect: assertion 'src->h != 0' failed
`
Any idea how to resolve this issue?https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/399Unexpected behaviour with Newtype and gst::pipeline2022-09-12T19:47:56Zeden-parallelUnexpected behaviour with Newtype and gst::pipelineHello.
I am having issues creating a newtype with a gst::pipeline and could really use some insight as to what is happening.
I have a video saving pipeline that I set to NULL in one callback that later is set back to PLAYING through an...Hello.
I am having issues creating a newtype with a gst::pipeline and could really use some insight as to what is happening.
I have a video saving pipeline that I set to NULL in one callback that later is set back to PLAYING through another callback. This works fine when setting the state directly using gst::pipeline. However, I would like to create a newtype for gst::pipeline that limits the functionality to prevent possible memory leaks. I create a struct that wraps the pipeline as below:
```
/// Wrapper around the pipeline to prevent an accidental memory leak
#[derive(Debug)]
#[repr(transparent)]
pub struct Pipeline(
/// The gstreamer pipeline.
gst::Pipeline,
);
```
and change the state of the pipeline like this:
```
impl Pipeline {
...
pub fn set_state(&self, state: gst::State) -> Result<gst::StateChangeSuccess> {
Ok(self.0.set_state(state)?)
}
```
I am getting errors when trying Stop and Start the pipeline dynamically. Specifically, these are only present when restarting the pipeline using my Pipeline newtype:
```
0:00:07.894205774 10264 0x5585c48de0 WARN GST_PADS gstpad.c:4351:gst_pad_peer_query:<sink_pipeline_interpipesrc:src> could not send sticky events
(minimal:10264): GStreamer-CRITICAL **: 23:20:11.461: gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed
0:00:07.903435749 10264 0x5584cb2d30 ERROR GST_BUS gstbus.c:1075:gst_bus_remove_watch:<bus4> no bus watch was present
```
Is this a ref count issue or some undefined behavior with the wrapper?
Here is my attempt at a minimal example, `omxvideoenc` gives some warnings but it seems to work well enough to get the point across:[minimal.zip](/uploads/1a51e733761bc12bf7489b7fa3253252/minimal.zip)https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/390Issue in finding audio format using typefind in gstreamer2022-08-30T06:00:24ZSURYAPRAKASH PRABHAKARANIssue in finding audio format using typefind in gstreamerI am writing a gstreamer based application to stream audio. In which, I am trying to find the format of the audio using typefind element in the gstreamer. But, it is not finding the format of the audio properly. For example., If I give ....I am writing a gstreamer based application to stream audio. In which, I am trying to find the format of the audio using typefind element in the gstreamer. But, it is not finding the format of the audio properly. For example., If I give .ac3 audio as input to the pipeline, it is finding the audio format as .dts. When I run the pipeline for mutiple times., say 10 times, it found the input audio format as .dts for 8 times and .ac3 for 2 times. Suggest me a solution for this issue.https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/381got panic failed to create element2022-05-17T13:02:27ZJason Shengot panic failed to create elementHi All
got this panic i have also try with videotestsrc
```rust
gst::init().unwrap();
// Create the elements
let source = gst::ElementFactory::make("uridecodebin", Some("source"))
.expect("Could not create sink element uride...Hi All
got this panic i have also try with videotestsrc
```rust
gst::init().unwrap();
// Create the elements
let source = gst::ElementFactory::make("uridecodebin", Some("source"))
.expect("Could not create sink element uridecodebin");
let convert = gst::ElementFactory::make("audioconvert", Some("convert"))
.expect("Could not create convert element");
```
thread 'main' panicked at 'Could not create sink element uridecodebin: BoolError { message: "Failed to create element from factory name", filename: "/Users/jason/.cargo/registry/src/github.com-1ecc6299db9ec823/gstreamer-0.18.8/src/auto/element_factory.rs", function: "gstreamer::auto::element_factory", line: 152 }'
i am on macos 12.3.1 m1
installed gstreamer with brew install
the version of gstreamer is 1.20.1 (installed it as per doc, but without the --with tags, which doesn't allow to install with t eh tags)
any help would be awesome
thanks advance
Jasonhttps://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/347zsh: illegal hardware instruction trying the first tutorial on OSX Big Sur2021-06-23T09:41:03ZMikzsh: illegal hardware instruction trying the first tutorial on OSX Big SurHi !
I am trying to learn gstreamer with the Rust binding. I get a strange error I do&n't explain when I try to build this:
```rust
use gstreamer::prelude::*;
use std::ops::Deref;
fn main() {
println!("début");
gstreamer::init...Hi !
I am trying to learn gstreamer with the Rust binding. I get a strange error I do&n't explain when I try to build this:
```rust
use gstreamer::prelude::*;
use std::ops::Deref;
fn main() {
println!("début");
gstreamer::init().unwrap();
println!("init ok");
let uri =
"https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm";
let pipeline = gstreamer::parse_launch(&format!("playbin uri={}", uri)).unwrap();
println!("pipeline {:?}", pipeline);
pipeline.set_state(gstreamer::State::Playing);
println!("state playing");
let bus = pipeline.get_bus().unwrap();
println!("bus {:?}", bus);
println!("{:?}", bus.timed_pop_filtered(
gstreamer::CLOCK_TIME_NONE,
&[gstreamer::MessageType::Error, gstreamer::MessageType::Eos],
));
if let Some(_msg) = bus.timed_pop_filtered(
gstreamer::CLOCK_TIME_NONE,
&[gstreamer::MessageType::Error, gstreamer::MessageType::Eos],
) { println!("OK"); }
pipeline.set_state(gstreamer::State::Null);
println!("Fin");
}
```
I don't know where the problem come from. But with the output I guess the problem is in `timed_pop_filtered`method:
```
% cargo run
Compiling gstreamer_test v0.1.0 (/Users/mik/Dev/Rust/gstreamer_test)
warning: unused import: `std::ops::Deref`
--> src/main.rs:2:5
|
2 | use std::ops::Deref;
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused `Result` that must be used
--> src/main.rs:12:5
|
12 | pipeline.set_state(gstreamer::State::Playing);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled
warning: unused `Result` that must be used
--> src/main.rs:24:5
|
24 | pipeline.set_state(gstreamer::State::Null);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
warning: 3 warnings emitted
Finished dev [unoptimized + debuginfo] target(s) in 0.62s
Running `target/debug/gstreamer_test`
début
init ok
pipeline Element { inner: ObjectRef { inner: 0x7fba6b00ca60, type: GstPlayBin } }
state playing
bus Bus { inner: ObjectRef { inner: 0x7fba68815e80, type: GstBus } }
zsh: illegal hardware instruction cargo run
```
Regardshttps://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/296Add bindings for GstOpenSLESSink2020-11-24T09:25:58ZSirius WuAdd bindings for GstOpenSLESSinkIn my android project I need to inherit from GstOpenSLESSink. I have some questions:
* How could I generate bindings for it? Which document should I read? Which files should I change?
* Should I add the bindings to gstreamer-audio, or j...In my android project I need to inherit from GstOpenSLESSink. I have some questions:
* How could I generate bindings for it? Which document should I read? Which files should I change?
* Should I add the bindings to gstreamer-audio, or just put it in my own project?https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/239Xubuntu.2020-02-22T18:04:48ZKazi Razon13139-KaziRazon1424@users.noreply.gitlab.freedesktop.orgXubuntu.https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/232Memory leak when using callbacks?2020-01-21T22:35:34ZNazar MokrynskyiMemory leak when using callbacks?This can be just my misunderstanding, but there is something weird going on that causes GStreamer to free its memory correctly (confirmed by tracing subsystem), but leave some of Rust objects in memory forever.
I have a struct that look...This can be just my misunderstanding, but there is something weird going on that causes GStreamer to free its memory correctly (confirmed by tracing subsystem), but leave some of Rust objects in memory forever.
I have a struct that looks like this:
```rust
pub struct Stream {
pipeline: Pipeline,
webrtcbin: Element,
}
impl Drop for Stream {
fn drop(&mut self) {
println!("Destroyed!");
}
}
```
With weak references I stop the pipeline, remove last reference and this struct is dropped. Good so far.
Now consider this struct:
```rust
struct Test(u32);
impl Drop for Test {
fn drop(&mut self) {
println!("Drop");
}
}
```
And its usage:
```rust
let test = Test(1);
stream.webrtcbin.connect_notify(Some("connection-state"), {
move |_webrtcbin, _spec| {
println!("{}", test.0);
}
});
```
Intuitively the only thing holding `test` is the callback and when pipeline is stopped and last reference to `Stream` struct is removed from Rust point of view (`Stream::drop` is called), `test` should also be dropped.
Confusingly, it is still kept in memory without any way to remove it. Even more confusing is the fact that `Arc` is not involved here.
What is the recommended approach in this case and shouldn't bindings handle this in some way?https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/223Basic-tutorial-7 crashes2019-11-17T09:53:45ZSirius WuBasic-tutorial-7 crashesI'm using Ubuntu 18.04. The following command crash.
```
cargo run --bin basic-tutorial-7
```
It crashed:
```
Obtained request pad src_0 for audio branch
Obtained request pad src_1 for video branch
Segmentation fault (core dumped)
```...I'm using Ubuntu 18.04. The following command crash.
```
cargo run --bin basic-tutorial-7
```
It crashed:
```
Obtained request pad src_0 for audio branch
Obtained request pad src_1 for video branch
Segmentation fault (core dumped)
```
I examine the binary with core dump:
```
gdb target/debug/basic-tutorial-7 ./tutorials/core
```
Although I got some backtrace, but I do not know how to continue from here, any suggestion?
```
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __memset_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:188
188 ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S: No such file or directory.
[Current thread is 1 (Thread 0x7f3d26b1e700 (LWP 32416))]
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /media/ccwu/e7458cf5-858e-4184-afc4-73301087e303/home/alvin/mapacode/git/gstreamer-rs/target/debug/basic-tutorial-7.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) l
183 in ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
(gdb) backtrace
#0 0x00007f3d4cc7c930 in __memset_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:188
#1 0x00007f3d4a53fd27 in () at /usr/lib/x86_64-linux-gnu/libgstpbutils-1.0.so.0
#2 0x00007f3d4ddd688b in () at /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#3 0x00007f3d4dddebb3 in gst_pad_push () at /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#4 0x00007f3d4b1acba9 in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so
#5 0x00007f3d4de0b269 in () at /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#6 0x00007f3d4d869b60 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007f3d4d869195 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007f3d4d1d16db in start_thread (arg=0x7f3d26b1e700) at pthread_create.c:463
#9 0x00007f3d4cce288f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
```