tinyzimmer / go-gst

Gstreamer bindings and utilities for golang
GNU Lesser General Public License v2.1
130 stars 37 forks source link

error: "Given string is too short for a pipeline" when trying gstreamer basic example 1 #45

Open db-tech opened 2 years ago

db-tech commented 2 years ago

When I tried to get the Basic tutorial 1: Hello World example to run, I get the following error message:

Given string is too short for a pipeline: playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm

The example can be found here: https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html?gi-language=c

I guess the reason is that the string is always expected to include an exclamation mark ?

    if len(strings.Split(launchv, "!")) < 2 {
        return nil, fmt.Errorf("Given string is too short for a pipeline: %s", launchv)
    }

The string given to the launch command is: "playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm"

brucekim commented 1 year ago

I agree with you that the line of code you mentioned is unnecessary part.

I think gst_parse_launch() has no restriction on its parameter, pipeline_description so it would be enough let go-gst do samething. If you raise PR then I can review/merge it.

https://gstreamer.freedesktop.org/documentation/gstreamer/gstparse.html?gi-language=c#gst_parse_launch