Lua for stream syncing?
Posted: 30 Jun 2010 10:17
Hi all,
i am trying to solve stream syncing problem and would like to ask for some help or advice, please...
The setup
I am streaming 3 output streams with same content (same inputs), but with different resolution and bitrate in each output.
The problem
After a while, those 3 output streams will run out of sync between them, so when a bitrate switch is needed (actually switch to different output stream), on end device i see different scene.
The temporary solution
At the moment i have a "solution" for this, which is a perl script connecting to vlm telnet interface, getting the position from the "show" command in regular intervals and if the sync drift between those three outputs is bigger than 2%, it will "seek" two lower bitrate streams to the high bitrate stream position.
This works so far, but i'd like to have some better solution.
The question
Would it be possible to solve this with LUA scripting?
In best case, i'd like to be able to continuously adjust the video playback rate, until all three positions will match.
If that is not possible, i'd like to be able to use LUA, to get positions of all three streams and adjust as i do with perl (described above).
Many thanxs for advice or help
buzz
i am trying to solve stream syncing problem and would like to ask for some help or advice, please...
The setup
Code: Select all
new high_01 broadcast enabled loop
setup high_01 input "black_sheep_4_3.mpg_HIGH.ts"
setup high_01 input "Lost_in_Space_4_3.mpg_HIGH.ts"
setup high_01 output #std{access=udp,mux=ts,dst=239.255.11.1:10003}
#
new mid_01 broadcast enabled loop
setup mid_01 input "black_sheep_4_3.mpg_MID.ts"
setup mid_01 input "Lost_in_Space_4_3.mpg_MID.ts"
setup mid_01 output #std{access=udp,mux=ts,dst=239.255.11.1:10002}
#
new low_01 broadcast enabled loop
setup low_01 input "black_sheep_4_3.mpg_LOW.ts"
setup low_01 input "Lost_in_Space_4_3.mpg_LOW.ts"
setup low_01 output #std{access=udp,mux=ts,dst=239.255.11.1:10001}
#
control high_01 play
control mid_01 play
control low_01 play
###################
The problem
After a while, those 3 output streams will run out of sync between them, so when a bitrate switch is needed (actually switch to different output stream), on end device i see different scene.
The temporary solution
At the moment i have a "solution" for this, which is a perl script connecting to vlm telnet interface, getting the position from the "show" command in regular intervals and if the sync drift between those three outputs is bigger than 2%, it will "seek" two lower bitrate streams to the high bitrate stream position.
This works so far, but i'd like to have some better solution.
The question
Would it be possible to solve this with LUA scripting?
In best case, i'd like to be able to continuously adjust the video playback rate, until all three positions will match.
If that is not possible, i'd like to be able to use LUA, to get positions of all three streams and adjust as i do with perl (described above).
Many thanxs for advice or help
buzz