HTTP Live Streaming multiple quality output
Posted: 06 Dec 2012 21:47
Hello everyone,
I’m using VLC to stream/convert a video file to a bunch of formats. The sout option I use looks like this:
The MKV/x264 and the two Ogg Theora streams work well. The two HTTP Live Streaming outputs also work well individually, but I am unable to combine them into a multiple quality HLS stream. I use the following m3u8 file:
With video players able to switch between the two streams (like VLC), problems occur. For instance, VLC loads two live_sd segments, and then continues with live_hd segments. When the switchover occur, the video freezes.
I have looked at the individual video segments, and I noticed that they do not seem properly synchronized (e.g. live_sd_00000010.ts and live_hd_00000010.ts are not exactly the same part of the original video). This is also visible in the VLC console output: the two livehttp access modules report which segments they just wrote, and after some time their respective messages are not simultaneous.
Is there a way to get two properly synchronized HLS streams?
Thanks.
I’m using VLC to stream/convert a video file to a bunch of formats. The sout option I use looks like this:
Code: Select all
#duplicate{
dst="transcode{
vcodec=h264,venc=x264{ultrafast},acodec=s16l,threads=6
}:std{
access=file,mux=mkv,dst=…
}",
dst="transcode{
fps=24,vcodec=theo,vb=800,width=720,height=405,threads=2,acodec=vorb,ab=128,channels=2
}:duplicate{
dst=std{access=file,mux=ogg,dst=…},
dst=std{access=shout,mux=ogg,dst=source:…}
}",
dst="transcode{
fps=24,vcodec=theo,vb=600,width=320,height=180,threads=2,acodec=vorb,ab=128,channels=2
}:std{
access=shout,mux=ogg,dst=source:…
}",
dst="transcode{
fps=24,vcodec=h264,vb=1000,width=854,height=480,
venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96
}:std{
access=livehttp{seglen=10,delsegs=true,numsegs=5,index=…/live_hd.m3u8,index-url=…/live_hd_########.ts},
mux=ts{use-key-frames},dst=…/live_hd_########.ts}'
}",
dst="transcode{
fps=24,vcodec=h264,vb=600,width=640,height=360,
venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96
}:std{
access=livehttp{seglen=10,delsegs=true,numsegs=5,index=…/live_sd.m3u8,index-url=…/live_sd_########.ts},
mux=ts{use-key-frames},dst=…/live_sd_########.ts}'
}"
}
Code: Select all
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=900000,RESOLUTION=640x360
live_sd.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1500000,RESOLUTION=854x480
live_hd.m3u8
I have looked at the individual video segments, and I noticed that they do not seem properly synchronized (e.g. live_sd_00000010.ts and live_hd_00000010.ts are not exactly the same part of the original video). This is also visible in the VLC console output: the two livehttp access modules report which segments they just wrote, and after some time their respective messages are not simultaneous.
Is there a way to get two properly synchronized HLS streams?
Thanks.