QtQuick使用MediaPlayer抓取摄像头影响报错Error: "Your GStreamer installation is missing a plug-in."...

环境:ubuntu18.04 Qt5.9.5

描述:项目需要使用qtquick作为显示界面用于播放从网络摄像头抓取的影像,海康网络摄像头,摄像头源协议使用的是rtsp,影像数据格式为x-h264,但在调试时报错。

 Item{
        MediaPlayer{
            id: player
            source: "rtsp://admin:gene123456@192.168.10.64:554/h264/ch1/main/av_stream"
            autoPlay: true
        }
        VideoOutput{
            anchors.centerIn: parent
            source: player
        }
    }

报错

Starting /home/liang/study/13/03/build-Camera-unknown-Debug/Camera...
Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, alignment=(string)au, codec_data=(buffer)014d002affe10018674d002a963540f0044fcb37010101400001c2000057e40101000468ee3c80, level=(string)4.2, profile=(string)main, width=(int)1920, height=(int)1080, framerate=(fraction)25/1, interlace-mode=(string)progressive, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true'."
Error: "Your GStreamer installation is missing a plug-in."
/home/liang/study/13/03/build-Camera-unknown-Debug/Camera exited with code 0

可以看出缺乏适配x-h264格式的解码器,报错缺少GStreamer插件,我在网上查找了很多资料不过很多都是基于ubuntu 14或者ubuntu 16平台下的,但解决方法不尽相同。一下便是我的解决方法

sudo add-apt-repository ppa:mc3man/gstffmpeg-keep

sudo apt-get update

sudo apt-get install gstreamer1.0-libav

sudo apt-get install gstreamer1.0-plugins-bad

sudo apt-get install gstreamer1.0-plugins-good

sudo apt-get install gstreamer1.0-plugins-base

sudo apt-get install gstreamer1.0-plugins-ugly

sudo apt-get install gstreamer1.0-qt5

sudo apt-get install gstreamer1.0-rtsp

 

转载于:https://www.cnblogs.com/ohsolong/p/10651923.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值