Git Product home page Git Product logo

sdroege / gst-plugin-rs Goto Github PK

View Code? Open in Web Editor NEW
116.0 11.0 39.0 14.03 MB

Rust crate for writing GStreamer plugins and various plugins - This repository moved to https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs

Home Page: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs

License: Apache License 2.0

Rust 96.05% Makefile 0.01% C 1.10% Python 0.47% Meson 0.37% Shell 0.03% PowerShell 0.02% HTML 0.21% Svelte 0.22% TypeScript 0.01% JavaScript 1.52% GLSL 0.01%
gstreamer rust multimedia codecs parsers demuxers plugins

gst-plugin-rs's People

Contributors

alatiera avatar alfro avatar bilelmoussaoui avatar dpeite avatar fengalin avatar ford-prefect avatar gdesmott avatar heftig avatar jbeich avatar jyelloz avatar mathieuduponchelle avatar max-khm avatar nirbheek avatar philn avatar rafaelcaricio avatar rajneeshksoni avatar rubenrua avatar sajeerahamed15 avatar samuvlad avatar sanchayanmaity avatar sdroege avatar seungha-yang avatar thaytan avatar thiblahute avatar tkanakamalla avatar tp-m avatar vivia avatar xclaesse avatar ystreet avatar zhao-gang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gst-plugin-rs's Issues

rtspsrc vs fallbacksrc

Hi,

We loved the idea of the fallbacksrc and very needed. But our pipeline working with rtspsrc but not wrking with fallbacksrc.

function create_rtsp_sources() { echo "Rtsp sources creating" for ((n = 0; n < $num_of_src; n++)); do src_name="SRC_${n}" src_name="${!src_name}" rtsp_sources+="rtspsrc async-handling=true location=$src_name name=source_$n message-forward=true ! \ decodebin3 ! \ queue name=custom_preprocess_q_$n leaky=no max-size-buffers=32 max-size-bytes=0 max-size-time=0 ! \ $decode_scale_elements ! videoconvert n-threads=8 ! \ video/x-raw,pixel-aspect-ratio=1/1 ! \ fun.sink_$n sid.src_$n ! \ queue name=comp_q_$n leaky=downstream max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! \ comp.sink_$n " #echo "$n -- $rtsp_sources \n\n" done }

isnt the fallbacksrc is the same output of the rtspsrc ?
How we can replace the rtspsrc with fallbacksrc for above pipeline ?

Port over to gstreamer-rs

Currently we have lots of handcrafted bindings for various GStreamer types or call FFI functions directly. This should be moved to using the proper bindings from gstreamer-rs.

Best approach here would probably be to first do (one after another) source.rs, sink.rs, demuxer.rs and then get rid of everything in the other files.

Types like FlowReturn would be wrapped in our custom FlowError (omitting the Ok case for Result<_,_>). Whatever makes sense should become a wrapper around the gstreamer-rs types with additional functionality.

In the context of this, also see sdroege/gstreamer-rs#3 which can be done before or after (in which case we would have a custom newtype for that here for the time being).

Add wrapper for GstBaseTransform

See https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseTransform.html
Might make sense to do this first: sdroege/gstreamer-rs#7

First step would be to come up with an API design (mostly the main trait) in the style of Source, Sink and Demuxer. That is:

  • all functions return a value and don't call into other elements. So return value would be some kind of enum
  • the general idea of the C base class would be kept (i.e. you have some kind of transform function, transform_caps, etc)
  • implementors of the trait do not have to worry about threading

As part of this should also be a simple transform element. Maybe just a minimal "volume" element, or mono to stereo converter (the latter would at least make use of caps transformations).

Add wrapper for GstVideoEncoder

See https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-GstVideoEncoder.html

It probably makes sense to first wrap more parts libgstvideo in gstreamer-rs so that things like GstVideoCodecFrame and GstVideoInfo/Frame can possibly be directly used without writing manual bindings. sdroege/gstreamer-rs#5

As part of this should also be a simple decoder element. Maybe just a minimal element that takes e.g. a BMP image and encodes it (or rather adds the header).

Suggested 'mirror' gitlab.freedesktop.org/gstream doesn't respond

The proposed repo is offline: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs

Also causing build issue:
Updating git repository https://gitlab.freedesktop.org/gstreamer/gstreamer-rs warning: spurious network error (3 tries remaining): unexpected http status code: 504; class=Http (34) warning: spurious network error (2 tries remaining): unexpected http status code: 504; class=Http (34) warning: spurious network error (1 tries remaining): unexpected http status code: 504; class=Http (34) error: failed to get gstreameras a dependency of packagegst-plugin-tutorial v0.9.11 (/home/bwilma/BuildAgent/work/100b0d6fce2ffa2f/playground/gs_prestudy/webrtc/builddir/gst-plugins-rs-cross/tutorial)`

Implement a VobSub decoder

Around https://docs.rs/vobsub/0.2.3/vobsub/, probably best as GstVideoDecoder subclass once we have it... or GstElement.

Needs some changes to expose the &[u8] based API that is currently internally, and accepts elementary stream packets.

The repository also has some SRT code, might be worth adding something around that too.

CC @emk who brought this to my attention on reddit

Build issue - user error?

  1. building on Mac M1Max
  2. Newbie (<3 days old) Rust user
  3. Trying to build the gst-plugin-rs project
  4. Installed gstreamer "official" packages - devel + non-level
  5. gstreamer works fine (e.g. gst-launch-1.0 videotestsrc ! autovideosink)
  6. "cargo build" fails with this errors. I am probably missing a step or two - any pointers would be helpful 🙏

error occurred: Command "cc" "-O1" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include/gstreamer-1.0" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include/glib-2.0" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/lib/glib-2.0/include" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include/gstreamer-1.0" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include" "-I" "/Users/matt/Projects/cerbero-1.20/build/dist/darwin_universal/include/orc-0.4" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include/gstreamer-1.0" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/include/glib-2.0" "-I" "/non_existent_on_purpose/please_use_framework_pkg-config/or_pass_--define-prefix_to_your_pkg-config/lib/glib-2.0/include" "-Wall" "-Wextra" "-DRTPJitterBuffer=TsRTPJitterBuffer" "-DRTPJitterBufferClass=TsRTPJitterBufferClass" "-DRTPJitterBufferPrivate=TsRTPJitterBufferClass" "-o" "/Users/cgadgil/dev/src/scalers-ai/common/tmp/gst-plugin-rs/target/debug/build/gst-plugin-threadshare-6bbad1f4e13769c6/out/src/jitterbuffer/rtpjitterbuffer.o" "-c" "src/jitterbuffer/rtpjitterbuffer.c" with args "cc" did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish...

Get rid of C code in demuxer

There's currently some C code for the demuxer. This should be replaced by corresponding, unsafe Rust code. Just like for Source and Sink.

It might make sense to refactor/redesign the demuxer trait at the same time. See #16

Thread panicks when filter is used inside C code

I want to use rsaudioecho filter in C code (is it even possible?), but it panicks at gst_init() if GST_PLUGIN_PATH is specified

(macOS Sierra 10.12.6, Xcode 8.3.3 (8E3004b), clang-802.0.42, rustc 1.23.0-nightly, cargo 0.24.0-nightly, GStreamer 1.12.3)

int main(int argc, char *argv[]) {
    setenv("RUST_BACKTRACE", "1", 1);
    setenv("GST_PLUGIN_PATH","/Users/username/sources/gstreamer/gst-plugin-rs",1);

    /* Initialize GStreamer */
    gst_init (&argc, &argv);

    return 0;
}

output:

thread '<unnamed>' panicked at 'assertion failed: ::types::instance_of::<Self>(ptr as *const _)', /Users/username/.cargo/git/checkouts/gstreamer-rs-8719441e7bb90fbc/2f7ee30/gstreamer/src/auto/plugin.rs:14:0
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:69
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:397
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:577
   5: std::panicking::begin_panic
             at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:538
   6: <gstreamer::auto::plugin::Plugin as glib::translate::FromGlibPtrBorrow<*mut gstreamer_sys::GstPlugin>>::from_glib_borrow
             at /Users/username/sources/gstreamer/gst-plugin-rs/gst-plugin-audiofx/<panic macros>:3
   7: glib::translate::from_glib_borrow
             at /Users/username/.cargo/git/checkouts/glib-928cf7b282977403/a51dc67/src/translate.rs:825
   8: gstrsaudiofx::plugin_desc::plugin_init_trampoline
             at /Users/username/sources/gstreamer/gst-plugin-rs/gst-plugin-audiofx/<plugin_define macros>:24
   9: gst_plugin_register_func
  10: _priv_gst_plugin_load_file_for_registry
  11: exchange_packets
  12: _gst_plugin_loader_client_run
  13: main
fatal runtime error: failed to initiate panic, error 5
Program ended with exit code: 9

BTW, rsaudioecho works well with gst-launch-1.0 and gst-inspect-1.0

build issue

I tried to build this cargo.toml file

[package]
...

[dependencies]
glib = "0.4"
gstreamer = "0.10"
gstreamer-base = "0.10"
gst-plugin = "0.1"
gstreamer-video = "0.10"

[lib]
name = "gstrstutorial"
crate-type = ["cdylib"]
path = "src/lib.rs"

I'm getting this error when I try cargo build

Compiling gstreamer-video-sys v0.4.0
error: failed to run custom build command for `gstreamer-video-sys v0.4.0`
process didn't exit successfully: `/home/.../Desktop/GStreamer/plugin tests/target/debug/build/gstreamer-video-sys-0a43cf028baefe7d/build-script-build` (exit code: 1)
--- stderr
`"pkg-config" "--libs" "--cflags" "gstreamer-video-1.0 >= 1.8"` did not exit successfully: exit code: 1
--- stderr
Package gstreamer-video-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-video-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-video-1.0' found

retrieve-sender-address property in ts-udpsrc

Hi,

I am using udpsrc, I tried to replace it with ts-udpsrc, but "retrieve-sender-address" property is not there yet. I am using the property to retrieve address by adding a probe in udpsrc src pad.

struct _GstNetAddressMeta *meta = gst_buffer_get_net_address_meta(buffer);                                                                                                                    
assert(meta);                                                                                                                                                                                 
                                                                                                                                                                                              
GInetSocketAddress *sockAddr = (GInetSocketAddress *) meta->addr;                                                                                                                             
assert(sockAddr);

Is there any other way to achieve this in ts-udpsrc ?

Add wrapper for GstVideoDecoder

See https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-GstVideoDecoder.html

It probably makes sense to first wrap more parts libgstvideo in gstreamer-rs so that things like GstVideoCodecFrame and GstVideoInfo/Frame can possibly be directly used without writing manual bindings. sdroege/gstreamer-rs#5

As part of this should also be a simple decoder element. Maybe just a minimal element that takes e.g. a BMP image and decodes it (or rather parses the header and throws away the header).

webrtcsink will not connect to signaller

I have tried with both the library provided signaller as well as a custom "echo server" and running webrtcsink with gst-launch will simply never connect to the websocket. It doesn't change anything whether I provide a signaller::uri or not. Needless to say because of this, the usage instructions from the documentation do not work either, as it will not connect to the rust signaller (can be confirmed by no debugging message showing up whatsoever), so the webpage will not show the test stream. Am I doing something wrong or is this a known bug ?

Thanks!

Youtube HLS support

Would it be possible to implement streaming to Youtube over HLS ? Which is needed if you'd like to stream in H265 (HEVC)

See documentation here

Move panic handling for vfuncs into trait

The default implementation would just abort(), element and others could catch, report an error message and poison the object.

This probably would have to be on the ObjectType trait

Gstreamer does not have features: v1_14

Hi,

I’m trying to use “whipsink”, I followed the instruction mentioned here Fernando Jiménez Moreno / gst-plugins-rs · GitLab to build. When running this command cargo cbuild --manifest-path video/cdg/Cargo.tom, it produces the error

Error: CliError { error: Some(failed to select a version for `gstreamer`.
    ... required by package `gst-plugin-claxon v0.6.0 (/home/a/Desktop/x/gst-plugins-rs/audio/claxon)`
versions that meet the requirements `*` are: 0.23.0

the package `gst-plugin-claxon` depends on `gstreamer`, with features: `v1_14` but `gstreamer` does not have these features.

I have no idea how can I fix this error, I’ve searched on Google but there is no post relate to the feature of v1_14. Any help would be appreciated.

Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.