wang-bin / QtAV

A cross-platform multimedia framework based on Qt and FFmpeg. 基于Qt和FFmpeg的跨平台高性能音视频播放框架. Recommand to use new sdk https://github.com/wang-bin/mdk-sdk
http://qtav.org
3.98k stars 1.5k forks source link

How to set "rtsp_transport" to "tcp" when I use libQmlAv. #821

Open sulei-id opened 7 years ago

sulei-id commented 7 years ago

Hi wang-bin:

I want to get the video of camera with rtsp protocol. For a stable media connection, I must set the rtsp_transport to tcp, how to do?

In addition, I have build a simple player using libQmlAv, but the effect of playing is not good, that there is a very long delay about 10sec. How can I solve it?

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

    MainForm {
        anchors.fill: parent
        VideoOutput2 {
            anchors.fill: parent
            source: player
        }
        AVPlayer { //or MediaPlayer
            id: player
            source: "rtsp://admin:123456@172.16.1.22/media/video1"
            videoCodecPriority: ["VAAPI"]
        }
        MouseArea {
            anchors.fill: parent
            onClicked: player.play()
        }
    }
}
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41752578-how-to-set-rtsp_transport-to-tcp-when-i-use-libqmlav?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github).
oKcerG commented 5 years ago

Add this in your AVPlayer : avFormatOptions: ({ rtsp_transport: "tcp" })