QtAV icon indicating copy to clipboard operation
QtAV copied to clipboard

HLS Streaming problem!

Open thecompez opened this issue 6 years ago • 1 comments

QtAV, Qt 5.13.x and Windows, Linux and macOS

Hi, I'm trying to play video format hls with QtAV QML version. But player plays stream after long time with freezes and AV are not synced!!! An example link of hls to play :

https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8 https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8

How can I fix this problem?

thecompez avatar Oct 27 '19 18:10 thecompez

  1. first send a get req to .m3u8 link
  2. find out link of each quality
  3. set buffervalue to 200: setBufferValue(200)
  4. now set play("new link you received") to play without any freezing if your network speed is ok.

assume that hls link is http://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.m3u8 before using this link in player, send a get request to it. in answer you will see something like this: #EXTM3U #EXT-X-VERSION:1 ## Created with Unified Streaming Platform (version=1.10.28-22736)

# variants #EXT-X-STREAM-INF:BANDWIDTH=493000,CODECS="mp4a.40.2,avc1.66.30",RESOLUTION=224x100,FRAME-RATE=24 tears-of-steel-audio_eng=64008-video_eng=401000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=932000,CODECS="mp4a.40.2,avc1.66.30",RESOLUTION=448x200,FRAME-RATE=24 tears-of-steel-audio_eng=128002-video_eng=751000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1197000,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=784x350,FRAME-RATE=24 tears-of-steel-audio_eng=128002-video_eng=1001000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1727000,CODECS="mp4a.40.2,avc1.100.40",RESOLUTION=1680x750,FRAME-RATE=24,VIDEO-RANGE=SDR tears-of-steel-audio_eng=128002-video_eng=1501000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2468000,CODECS="mp4a.40.2,avc1.100.40",RESOLUTION=1680x750,FRAME-RATE=24,VIDEO-RANGE=SDR tears-of-steel-audio_eng=128002-video_eng=2200000.m3u8

# variants #EXT-X-STREAM-INF:BANDWIDTH=68000,CODECS="mp4a.40.2" tears-of-steel-audio_eng=64008.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=136000,CODECS="mp4a.40.2" tears-of-steel-audio_eng=128002.m3u8

now you can select each quality you want. next line after "#EXT-X-STREAM-I ..." is its link that should replace with last part of main link. for example, for 784p just use: play("http://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/tears-of-steel-audio_eng=128002-video_eng=1001000.m3u8")

if you add a setBufferValue(200) you can fix the freezing problem too.

alijafari97 avatar Nov 07 '20 09:11 alijafari97