c++ - 无法使用带有 gst-launch-1.0 的 Qemu 在 armv7 上播放 wav 音频
问题描述
我正在尝试使用 Qt 和 C++ 播放 WAV 音频文件,它失败然后我尝试使用 gst-launch-1.0 播放它,它也失败了。这一切都使用了 armv7 工具链并在 QEMU 下运行。
使用代码在 C++ 中失败后
QAudioDecoder decoder;
QFileInfo fileInfo(WAV_FILE_NAME);
decoder.setSourceFilename(fileInfo.absoluteFilePath());
decoder.start();
if (decoder.state() == QAudioDecoder::DecodingState)
qDebug() << "Decoding";
它失败并出现错误
0:00:00.167441195 29283 0xf375dc00 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.176093619 29283 0xf375dc00 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.237290158 29283 0xf37fc660 WARN uridecodebin gsturidecodebin.c:921:unknown_type_cb:<uridecodebin0> warning: No decoder available for type 'audio/x-wav'.
0:00:00.238382698 29283 0xf37fc660 WARN decodebin gstdecodebin2.c:4640:gst_decode_bin_expose:<decodebin0> error: no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
0:00:00.239083745 29283 0xf37fc660 WARN uridecodebin gsturidecodebin.c:988:no_more_pads_full:<uridecodebin0> error: no suitable plugins found:
../../../gst-plugins-base-1.14.4/gst/playback/gstdecodebin2.c(4640): gst_decode_bin_expose (): /GstPlayBin:playbin1/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
0:00:00.240739264 29283 0xf37fc660 WARN typefind gsttypefindelement.c:1231:gst_type_find_element_loop:<typefind> error: Internal data stream error.
0:00:00.240853974 29283 0xf37fc660 WARN typefind gsttypefindelement.c:1231:gst_type_find_element_loop:<typefind> error: streaming stopped, reason not-linked (-1)
这就是为什么我尝试使用
./gst-launch-1.0 -v uridecodebin uri=file:///home/vbox/myaudio.wav
然后我也收到了这个错误
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
/GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = audio/x-wav
Missing element: WAV demuxer
WARNING: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0: No decoder available for type 'audio/x-wav'.
Additional debug info:
../../../gst-plugins-base-1.14.4/gst/playback/gsturidecodebin.c(921): unknown_type_cb (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
../../../gst-plugins-base-1.14.4/gst/playback/gsturidecodebin.c(988): no_more_pads_full (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
../../../gst-plugins-base-1.14.4/gst/playback/gstdecodebin2.c(4640): gst_decode_bin_expose (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
我不确定真正缺少什么。此外,这是 gst-inspect-1.0 的输出
$> ./gst-inspect-1.0 | grep wav
audiovisualizers: wavescope: Waveform oscilloscope
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: audio/x-wav: wav
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-wavpack-correction: wvc
这里可能缺少什么?
解决方案
“wavparse”插件应该可用。
推荐阅读
- sql-server - SQL Server 引入 FOREIGN KEY 约束可能导致循环或多个级联路径
- json - 导入带有操作的 JSON 文件
- javascript - 在 d3js styleTween 中使用 CSS calc 时出现意外的过渡
- python-3.x - 为文件夹中的文件运行 Python 脚本
- php - 如何打印到服务器控制台,而不是浏览器或浏览器控制台
- python-3.x - 我如何编写这段代码(简单的方法),python 问题?
- java - Swagger core v3在java中的实现
- r - 使用所有列将行转换为 R 中的字符
- php - 将特定项目放在 php foreach 的最后一个循环中
- laravel - 如何从查询结果中排除联接表数据