Clock Gap Reset makes audio stream non-dated in mosaic
I have three streams added to a mosaic. I start the inputs before the mosaic and then start the mosaic. It throws out the packets in the buffer with a "late buffer for mux input" which is expected. It also throws clock gap errors on all inputs.
[0xb7a018b8] [Media: camera2] main input warning: clock gap, unexpected stream discontinuity
[0xb7a018b8] [Media: camera2] main input warning: feeding synchro with a new reference point trying to recover from clock gap
The issue is that while the clock gap does not cause any errors on the videos it consistently causes the audio only stream to lose their time stamp, which causes the audio to be out of sync. The very rare times where the clock gap on the audio happens before the mosaic is started the non-dated packet errors do not occur.
[0x9b85e98] [Media: record_session] stream_out_duplicate stream out debug: - added for output 0
[0x9b61090] [Media: record_session] main filter debug: looking for sub filter module: 1 candidate
[0x9b61090] [Media: record_session] main filter error: couldn't set priority of non-existent thread
[0xb7a018b8] [Media: camera2] main input warning: clock gap, unexpected stream discontinuity
[0xb7a018b8] [Media: camera2] main input warning: feeding synchro with a new reference point trying to recover from clock gap
[0x9b61090] [Media: record_session] mosaic filter debug: mosaic-offset: id 1, x=18, y=16
[0x9b61090] [Media: record_session] mosaic filter debug: mosaic-offset: id 2, x=640, y=16
[0x9b61090] [Media: record_session] mosaic filter debug: mosaic-offset: id 3, x=214, y=4
[0x9b61090] [Media: record_session] mosaic filter debug: mosaic-offset: id 4, x=214, y=4
[0x9b61090] [Media: record_session] main filter debug: using sub filter module "mosaic"
[0x9b61090] [Media: record_session] main filter debug: TIMER module_need() : 1.579 ms - Total 1.579 ms / 1 intvls (Avg 1.579 ms)
[0x99a0480] [Media: record_session] main subpicture debug: Filter 'mosaic' (0x9b61090) appended to chain
[0x9b85cb0] [Media: record_session] stream_out_transcode stream out debug: drift is too high, resetting master sync
[0xb7a7c7b0] [Media: audio] main input warning: clock gap, unexpected stream discontinuity
[0xb7a7c7b0] [Media: audio] main input warning: feeding synchro with a new reference point trying to recover from clock gap
warning: first frame is no keyframe
[0x9d4bbd8] [Media: camera2] main filter debug: looking for video filter2 module: 20 candidates
[0x9d4bbd8] [Media: camera2] swscale filter debug: 704x480 chroma: I420 -> 624x468 chroma: I420 with scaling using Bicubic (good quality)
[0x9d4bbd8] [Media: camera2] main filter debug: using video filter2 module "swscale"
[0x9d4bbd8] [Media: camera2] main filter debug: TIMER module_need() : 2.241 ms - Total 2.241 ms / 1 intvls (Avg 2.241 ms)
[0x990bc30] [Media: camera1] main input debug: Buffering 47%
[0x9c6ab68] [Media: record_session] main blend debug: looking for video blending module: 1 candidate
[0x9c6ab68] [Media: record_session] blend blend debug: chroma: I420 -> I420
[0x9c6ab68] [Media: record_session] main blend debug: using video blending module "blend"
[0x9c6ab68] [Media: record_session] main blend debug: TIMER module_need() : 0.722 ms - Total 0.722 ms / 1 intvls (Avg 0.722 ms)
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x999e408] [Media: record_session] main mux warning: late buffer for mux input (32403)
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x999e408] [Media: record_session] main mux warning: late buffer for mux input (32585)
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x990bc30] [Media: camera1] main input debug: Stream buffering done (8808 ms in 8820 ms)
[0x990bc30] [Media: camera1] main input debug: Decoder buffering done in 0 ms
[0x9cd2c28] [Media: camera1] main filter debug: looking for video filter2 module: 20 candidates
[0x9cd2c28] [Media: camera1] swscale filter debug: 704x480 chroma: I420 -> 624x468 chroma: I420 with scaling using Bicubic (good quality)
[0x9cd2c28] [Media: camera1] main filter debug: using video filter2 module "swscale"
[0x9cd2c28] [Media: camera1] main filter debug: TIMER module_need() : 1.995 ms - Total 1.995 ms / 1 intvls (Avg 1.995 ms)
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output!
}}}
The non-dated errors stop once the audio stream rebuffers, there is no rhyme nor reason when this will occur.
[0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output! [0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output! [0x99819c8] [Media: audio] main stream output warning: trying to send non-dated packet to stream output! [0x9984ff8] [Media: audio] live555 demux debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP() [0xb7a7c7b0] [Media: audio] main input error: ES_OUT_RESET_PCR called [0xb7a7c7b0] [Media: audio] main input debug: Buffering 0% [0xb7a7c7b0] [Media: audio] main input debug: Buffering 30% [0xb7a7c7b0] [Media: audio] main input debug: Buffering 30% [0xb7a7c7b0] [Media: audio] main input debug: Buffering 33%