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
Sorry that I ask my question here, but I hoped that I get some thought from you.
I have write a playout solution, based on python and ffmpeg. It works, but not 100% clean, that is way I would like to rewrite it based on PyAV.
I have play a bit around with your module, but some things I can't figure out:
1) When I want to concat multiple clips, would you recommend to buffer them? So when the script change from one clip to the next, that there is no delay.
2) The most easy way to concat can be done like this:
But now I have the problem, that my dts and pts are not monotonically. So how can I generate a clean increasing dts and pts packet stream? And also: What would be, when the values are increasing over multiple day, or weeks, do I have to rest the values one time?
3) How can I encode in real time? I saw in this tutorial that he works with a timer and an older player example from you uses also a clock. Could you give me here a hint, for my use case?
As I say I would appreciate your thought on that very much!
The Problem with this is, that as soon as a clips comes, where the sample rate is different to the one before, it is not working anymore. With an audio resampler I was also not successful.
What do you think about this?
About the question: resetting the pts value, I figure out when the pts value is an int64 value, then I don't have to reset anything, I have enough to count for many years :)...
Question 1) I can also check off.
Then stays only question 3): how can I encode, or decode in real time for rtmp streaming use cases.
Concerning your code for handling different frame rates, I see you are changing the pts, but you are not changing the time_base so your timestamps are probably garbage.
The problem with the concat demuxer is, that you can not change dynamical the content of the list nor the list by it self. That is way I need a custom solution.
I belief my code have more mistakes, but thank you for pointing this out about the time_base value. Another problem will be to, when there comes clips with shorter or longer audio lines than the video, this would end up in non sync a/v.
But beside this is there an -re input option in PyAV?
Reacted by Zdzisław Krajewski, Igor Rendulic and rysson
Activity
jb-alvarado commentedon Nov 28, 2018
I have now done some more tests regarding the PTS problem and came to the following solution (at 50FPS clips):
The Problem with this is, that as soon as a clips comes, where the sample rate is different to the one before, it is not working anymore. With an audio resampler I was also not successful.
What do you think about this?
About the question: resetting the pts value, I figure out when the pts value is an int64 value, then I don't have to reset anything, I have enough to count for many years :)...
Question 1) I can also check off.
Then stays only question 3): how can I encode, or decode in real time for rtmp streaming use cases.
jlaine commentedon Jan 25, 2019
For clips with identical encodings, a more efficient way is to use FFmpeg's built-in
concatformat, see:https://trac.ffmpeg.org/wiki/Concatenate
av.open('mylist.txt', format='concat')Concerning your code for handling different frame rates, I see you are changing the
pts, but you are not changing thetime_baseso your timestamps are probably garbage.jb-alvarado commentedon Jan 26, 2019
The problem with the concat demuxer is, that you can not change dynamical the content of the list nor the list by it self. That is way I need a custom solution.
I belief my code have more mistakes, but thank you for pointing this out about the
time_basevalue. Another problem will be to, when there comes clips with shorter or longer audio lines than the video, this would end up in non sync a/v.But beside this is there an
-reinput option in PyAV?