WowzaMediaSystems / wse-plugin-avmix

Wowza Streaming Engine™ module that combines separate audio and video sources into a single stream.
Other
17 stars 6 forks source link

Useoriginaltimecodes option #1

Closed pkviet closed 8 years ago

pkviet commented 8 years ago

Hi I am using the plugin successfully except that I had to put that setting to true instead of false as instructed on the module wowza webpage. The instructions are non sensical. If the streams are in sync the setting should be set to false according to the doc. Shouldnt it be the opposite ? Also, are we talking about timecodes or timestamps ? My streams are synched (ntp clock) but they don't have timecodes. Thanks

rogerlittin commented 8 years ago

Every stream that runs through Wowza Streaming Engine has timecodes for every packet or frame and we use these timecodes to ensure that the separate tracks remain in sync with each other.

Unless set differently, most encoders will use 0 or a random number as the starting timecode for it's stream so if you have streams from different sources, they could have timecodes that are wildly different to each other. If you don't know the offset between each one then it would be almost impossible to synchronize the separate streams or tracks from each one. Some encoders can be set to create timecodes based on a common offset to NTP so streams from these encoders should be able to be synchronized. This isn't a default setting so we assume that the streams aren't synchronized.

When this module creates a mixed stream, it offsets the timecodes for the first packets of each source track to 0 so the tracks on the output stream have a common timebase. This offset is based on the system time when the first packet for each track arrives so they probably won't be in perfect sync.

When the useOriginalTimecodes option is set to true, it's assumed that the source timecodes are already synchronized and you want the output stream to also be synchronized. Wth this setting, we don't offset the source timecodes and instead just pass them through from the source tracks to the output stream.

If this setting is used with tracks that aren't synchronized then the results will be unpredictable and it's likely that the output stream won't playback properly, if at all.

pkviet commented 8 years ago

Thanks very much Roger. That's what I surmised.

But I was pointing to the fact that the doc seems incorrect since it says: avMixUseOriginalTimecodes

If both sources have synchronized timecodes, set this value to_false_to force the original timecodes to be used. Can be set at per-stream level or globally for all streams._Note:_Unexpected results may occur if sources aren't synchronized. (default:false)

It should be the reverse, correct ? namely, true if one has synchronized timecodes; I had ntp synced streams and originally set the parameter to false according to what is written (though thinking it was odd).

best regards

Le 13/07/2016 à 11:13 PM, Roger Littin a écrit :

Every stream that runs through Wowza Streaming Engine has timecodes for every packet or frame and we use these timecodes to ensure that the separate tracks remain in sync with each other.

Unless set differently, most encoders will use 0 or a random number as the starting timecode for it's stream so if you have streams from different sources, they could have timecodes that are wildly different to each other. If you don't know the offset between each one then it would be almost impossible to synchronize the separate streams or tracks from each one. Some encoders can be set to create timecodes based on a common offset to NTP so streams from these encoders should be able to be synchronized. This isn't a default setting so we assume that the streams aren't synchronized.

When this module creates a mixed stream, it offsets the timecodes for the first packets of each source track to 0 so the tracks on the output stream have a common timebase. This offset is based on the system time when the first packet for each track arrives so they probably won't be in perfect sync.

When the useOriginalTimecodes option is set to true, it's assumed that the source timecodes are already synchronized and you want the output stream to also be synchronized. Wth this setting, we don't offset the source timecodes and instead just pass them through from the source tracks to the output stream.

If this setting is used with tracks that aren't synchronized then the results will be unpredictable and it's likely that the output stream won't playback properly, if at all.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WowzaMediaSystems/wse-plugin-avmix/issues/1#issuecomment-232488594, or mute the thread https://github.com/notifications/unsubscribe/AI2nTwLrFyL32kAkYCZ8Zom_OHqtqH-Nks5qVVT4gaJpZM4JLhQz.

rogerlittin commented 8 years ago

Ok, I understand now and have updated the documentation to the correct setting.

Thanks.