Improvement of how we determine the initial timestamp.
This commit is contained in:
@@ -154,8 +154,9 @@ def getInitialTSFromBuffer(content, delta=0.1):
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
logger.debug('Determining initial timestamp from content')
|
logger.debug('Determining initial timestamp from content')
|
||||||
|
length = len(content)
|
||||||
with Popen(['ffprobe','/dev/stdin','-loglevel', 'quiet', '-read_intervals', ('0%%+%f' % delta), '-show_entries', 'frame=frame_no,best_effort_timestamp_time', '-of','json'], stdout=PIPE, stdin=PIPE) as ffprobe:
|
with Popen(['ffprobe','/dev/stdin','-loglevel', 'quiet', '-read_intervals', ('0%%+%f' % delta), '-show_entries', 'frame=frame_no,best_effort_timestamp_time', '-of','json'], stdout=PIPE, stdin=PIPE) as ffprobe:
|
||||||
out, _ = ffprobe.communicate(input=content)
|
out, _ = ffprobe.communicate(input=content[0:min(length,200000)])
|
||||||
frames = json.load(BytesIO(out))
|
frames = json.load(BytesIO(out))
|
||||||
logger.debug('Frames: %s' % frames)
|
logger.debug('Frames: %s' % frames)
|
||||||
if 'frames' in frames:
|
if 'frames' in frames:
|
||||||
|
|||||||
Reference in New Issue
Block a user