jackaudiosink only accepts audio/x-raw-float. You can see this from
gst-inspect-0.10 jackaudiosink
题
I am using gstreamer to extract audio from a video and resampling the audio to a different sampling rate. My pipeline worked for file to file conversation, but I couldn't setup the streaming case properly to link it to a jack interface:
File to file (works well):
gst-launch-0.10 filesrc location=/data/Opinion.flv ! flvdemux ! audio/mpeg ! decodebin ! audioconvert ! audio/x-raw-int, channels=1 ! audioresample ! audio/x-raw-int, rate=16000,depth=16 ! wavenc ! filesink location=./recordingOut2.wav
File to stream (doesn't work):
gst-launch-0.10 filesrc location=/data/Opinion.flv ! flvdemux ! audio/mpeg ! decodebin ! audioconvert ! audio/x-raw-int, channels=1 ! audioresample ! audio/x-raw-int, rate=16000,depth=16 ! jackaudiosink
WARNING: erroneous pipeline: could not link audioresample0 to jackaudiosink0
The following pipeline runs, but the output has the wrong sampling rate:
gst-launch-0.10 filesrc location=/data/Opinion.flv ! flvdemux ! audio/mpeg ! decodebin ! audioconvert ! audioresample ! jackaudiosink
Anything you see that I am doing wrong?
Can one resample audio and pipe to a stream output?
I have already searched around without finding any relevant solution. Any insight/pointer from you would be greatly appreciated!
解决方案
jackaudiosink only accepts audio/x-raw-float. You can see this from
gst-inspect-0.10 jackaudiosink
其他提示
As ensonic suggested, try changing your pipeline to be:
gst-launch-0.10 filesrc location=/data/Opinion.flv ! flvdemux ! audio/mpeg ! decodebin ! audioconvert ! audio/x-raw-float, channels=1 ! audioresample ! audio/x-raw-float, rate=16000,depth=16 ! jackaudiosink
Although you probably could remove the flvdemux ! audio/mpeg part of it as decodebin will plug in a demuxer for you also.