RK3568—-qml接受rtp流并展示

linux本地发送和接收推流

gst-launch-1.0 -v filesrc location=./111.mp4 ! qtdemux ! avdec_h264 ! x264enc ! rtph264pay ! udpsink host=224.224.224.224 port=8000

gst-launch-1.0 udpsrc port=8000 ! application/x-rtp, media=video, clock-rate=90000, encoding-name=H264 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! glimagesink name=vsink sync=false

rk3568接受推流

主机虚拟机发送推流
gst-launch-1.0 filesrc location=/home/firefly/Desktop/test.mp4 ! qtdemux ! rtph264pay config-interval=-1 ! udpsink host=224.224.224.224 port=5000

在3568终端上输入,使用这个语句可以显示小视频
gst-launch-1.0 videotestsrc ! autovideosink

可以接受推流

gst-launch-1.0 -ve udpsrc uri=udp://224.224.224.224:5000 ! application/x-rtp,media=video,encoding-name=H264 ! rtph264depay ! h264parse ! mppvideodec ! videoconvert ! autovideosink sync=false

qml代码,因为还没有装gsteatmer1.0-qt5这个包,所以视频是显示在qml窗口之外的

import QtQuick 2.15
import QtQuick.Window 2.15
import QtMultimedia 5.13

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    Rectangle{
            anchors.fill: parent
            color: "gray"

            MediaPlayer{
                    id:mediaPlayer;
                    source:"gst-pipeline:udpsrc uri=udp://224.224.224.224:5000 ! application/x-rtp,media=video,encoding-name=H264 ! rtph264depay ! h264parse ! mppvideodec ! videoconvert ! autovideosink"
                    // source: "gst-pipeline:udpsrc port=5004 ! application/x-rtp,media=video,clock-rate=9000,encoding-name=MPEG4-GENERIC ! rtpjitterbuffer latency=500 ! rtpmp2tdepay ! tsdemux ! decodebin ! autovideosink";
                    autoPlay: true

         onError: {
                        console.log(errorString);
                    }
                }
            VideoOutput{
                anchors.fill:parent;
                source: mediaPlayer;
                //flushMode: VideoOutput.LastFrame;
            }
        }
}

做下优化

udpsrc uri=udp://224.224.224.224:5000 buffer-size=1048576 ! application/x-rtp,media=video,encoding-name=H264 ! rtph264depay ! queue ! h264parse ! mppvideodec ! videoscal ! video/x-raw,framerate=30/1 ! videoconvert ! autovideosink 

自己是做了9路拉流

file

如果觉得本文对您有所帮助,可以支持下博主,—分也是缘。
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇

超多性价比流量卡,扫码查看

这将关闭于 20