简体   繁体   English

Gstreamer:从视频(flv)中提取音频,重新采样率并通过管道传输到流接收器-无法重新采样到流

[英]Gstreamer: extract audio from video (flv), resample rate and pipe to streaming sink - can't resample to stream

I am using gstreamer to extract audio from a video and resampling the audio to a different sampling rate. 我正在使用gstreamer从视频中提取音频并将音频重新采样为不同的采样率。 My pipeline worked for file to file conversation, but I couldn't setup the streaming case properly to link it to a jack interface: 我的管道适用于文件到文件的对话,但是我无法正确设置流式传输案例以将其链接到jack接口:

File to file (works well): 文件到文件(效果很好):

gst-launch-0.10 filesrc location=/data/Opinion.flv ! gst-launch-0.10 filesrc location = / data / Opinion.flv! flvdemux ! flvdemux! audio/mpeg ! 音频/ mpeg! decodebin ! 解码器! audioconvert ! 音频转换! audio/x-raw-int, channels=1 ! 音频/ x-raw-int,通道= 1! audioresample ! audioresample! audio/x-raw-int, rate=16000,depth=16 ! 音频/ x-raw-int,速率= 16000,深度= 16! wavenc ! wavenc! filesink location=./recordingOut2.wav filesink location =。/ recordingOut2.wav

File to stream (doesn't work): 要流式传输的文件(无效):

gst-launch-0.10 filesrc location=/data/Opinion.flv ! gst-launch-0.10 filesrc location = / data / Opinion.flv! flvdemux ! flvdemux! audio/mpeg ! 音频/ mpeg! decodebin ! 解码器! audioconvert ! 音频转换! audio/x-raw-int, channels=1 ! 音频/ x-raw-int,通道= 1! audioresample ! audioresample! audio/x-raw-int, rate=16000,depth=16 ! 音频/ x-raw-int,速率= 16000,深度= 16! jackaudiosink 杰克

WARNING: erroneous pipeline: could not link audioresample0 to jackaudiosink0 警告:错误的管道:无法将audioresample0链接到jackaudiosink0

The following pipeline runs, but the output has the wrong sampling rate: 以下管道运行,但是输出的采样率错误:

gst-launch-0.10 filesrc location=/data/Opinion.flv ! gst-launch-0.10 filesrc location = / data / Opinion.flv! flvdemux ! flvdemux! audio/mpeg ! 音频/ mpeg! decodebin ! 解码器! audioconvert ! 音频转换! audioresample ! 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. jackaudiosink仅接受音频/ x-raw-float。 You can see this from 你可以从这里看到

gst-inspect-0.10 jackaudiosink

As ensonic suggested, try changing your pipeline to be: 正如ensonic建议的那样,尝试将管道更改为:

gst-launch-0.10 filesrc location=/data/Opinion.flv ! gst-launch-0.10 filesrc location = / data / Opinion.flv! flvdemux ! flvdemux! audio/mpeg ! 音频/ mpeg! decodebin ! 解码器! audioconvert ! 音频转换! audio/x-raw-float, channels=1 ! 音频/ x-raw-float,频道= 1! audioresample ! audioresample! audio/x-raw-float, rate=16000,depth=16 ! 音频/ x-raw-float,速率= 16000,深度= 16! jackaudiosink 杰克

Although you probably could remove the flvdemux ! 尽管您可能可以删除flvdemux! audio/mpeg part of it as decodebin will plug in a demuxer for you also. 音频/ mpeg的一部分,如decodebin也会为您插入一个解复用器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM