You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that _read_from_streamfunction assumes pts to be globally consistent across the streams when that might not necessarily be the case.
Specifically the pyav docs state that pts is The presentation timestamp in time_base units for this frame. What that would mean is that if we have a reference frame, let's say video, then when reading the corresponding audio, audio pts would have to be transformed somewhat like this
Thank you, @bjuncek, for moving this issue to the official repository.
Another option could be to use an absolute time scale (second) as a unified unit.
Since each stream has their own time base, by multiplying PTS and its time base, (PTS for a stream)*(TIME_BASE corresponding to the stream), we can unify the semantic meaning of time stamp into the absolute time, seconds.
Would it be more intuitive, so that it may lead to easy debugging as well?
Thanks for working on this!
This sounds like a sensible thing to do, and we should probably convert to a global reference (for example, seconds or a converted pts wrt video).
I'd be glad to accept a PR fixing this. But it would be great as well to have proper tests for this, so that we make sure we don't break this in the future.
Uh oh!
There was an error while loading. Please reload this page.
It seems that
_read_from_stream
function assumespts
to be globally consistent across the streams when that might not necessarily be the case.Specifically the pyav docs state that
pts
is The presentation timestamp in time_base units for this frame. What that would mean is that if we have a reference frame, let's say video, then when reading the corresponding audio, audio pts would have to be transformed somewhat like thisOne option that I'd propose is to have:
then, subsequently, we'd need to change the
_align_audio_frames
as well to match this.Any thoughts?
If there is agreement, and try to send out PR tomorrow evening BST.
cc @fmassa @iyah4888
Docs on pyav streams:
https://docs.mikeboers.com/pyav/develop/api/stream.html
The text was updated successfully, but these errors were encountered: