GStreamer issues.

Johnson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 22 12:28:26 PDT 2017


On Tuesday, 22 August 2017 at 15:15:41 UTC, Mike Wey wrote:
> On 22-08-17 02:13, Johnson wrote:
>> I can't get the example to work(although slightly modified).
>> 
>> The installed version of GStreamer is 1.12.2
>> The file is: D:\temp\test.ogg
>> Loading
>> Setting to PLAYING.
>> Running.
>>> XError: Could not demultiplex stream. dbug: 
>>> gstoggdemux.c(4418): gst_ogg_demux_find_chains (): 
>>> /GstPipeline:audio-player/GstOggDemux:ogg-parser:
>> can't get first chain
>> 
>> Actually I was getting a much worse error before ;/ I can't 
>> remember it now.
>> 
>> 
>> The installed version of GStreamer is 1.12.2
>> The file is: D:\temp\test2.wav
>> Loading
>> Setting to PLAYING.
>> Running.
>>> XError: Internal data stream error. dbug: 
>>> gstwavparse.c(2249): gst_wavparse_loop (): 
>>> /GstPipeline:audio-player/GstWavParse:wav-parser:
>> streaming stopped, reason not-linked (-1)
>> 
>> Basically all I did was change the sink:
>> 
>>      sink = ElementFactory.make("autoaudiosink", 
>> "auto-output");
>> 
>> So it I could get past the error about alsa. I think the last 
>> name doesn't matter?
>> 
>> I downloaded the gstreamer binaries from their site, had some 
>> issues with a few of the dll's complaining about gxx errors, I 
>> removed them(h264, soundtouch, tag).
>> 
>> 
>> For the wav I changed
>>          //parser = ElementFactory.make("oggdemux", 
>> "ogg-parser");
>>          //decoder = ElementFactory.make("vorbisdec", 
>> "vorbis-decoder");
>>          parser = ElementFactory.make("wavparse", 
>> "wav-parser");
>>          decoder = ElementFactory.make("audioconvert", 
>> "wav-decoder");
>> 
>> 
>> which, is all i could find on line, I don't know if it's right 
>> at all.
>> 
>> 
>> Ultimately I want to be able to read somewhat arbitrary audio 
>> formats(most common at least), get the raw channel 
>> data(samples for each channel), play/pause/stop with good 
>> accuracy(no latency or low latency(<20ms), possibly do some 
>> pitch shifting and basic mixing(EQ, limiting, panning, etc), 
>> and eventually play some videos.
>> 
>> Is GstreamerD going to be useful for this or so I look in to 
>> using ffmpeg directly and do some of the stuff(e.g., eq) 
>> myself?
>> 
>> Thanks.
>
> The Gstreamer demo should use an `playbin` instead of 
> explicitly setting the pipeline, Like this: 
> https://github.com/gtkd-developers/GtkD/blob/master/demos/gstreamer/helloworld/gstreamer_helloworld.d
>
> This way gstreamer will detect the file type, i don't know if 
> it helps with the errors.

Thanks, that works!

Could you address some of my concerns:

1. I need to be able to get the raw data, is this easily possible 
with gstreamer?

2. It's quite a big package 600mb+ total and about 150 for the 
bin and 150 for the lib. Eventually I want to support android, 
this seems quite excessive for it. I'm not familiar with 
Gstreamer though and maybe most of that space is "junk". It seems 
people use it already on android so I'm not too worried, I 
imagine it can be customized?

3. Does Gstreamer/D provide any type of EQ, pitch shifting, 
stretching, etc?

4. Do you have any idea why the original code would work? I ask 
because maybe in the future I'll need to use it for other 
purposes and don't wanna hit a brick wall.

Note that I'm completely new to gstreamer and only learned of it 
through gtkD... so some of these might be basic questions. I'm 
just trying to find something simple to use but is robust so I 
don't waste time learning an api that isn't going to really do 
what I need. I was plan on using portaudio and ffmpeg, but 
ffmpegD doesn't really seem to work(old bindings I guess). I also 
had trouble with portaudio not playing any sound, but haven't 
spent much time with it to why.

Gstreamer, with your updated example, works though. Just not sure 
how far of a leap I'll have to make to get it working the way I 
need in my app.





More information about the Digitalmars-d-learn mailing list