mirror of
https://github.com/koush/scrypted.git
synced 2026-05-06 14:10:28 +01:00
python-codecs: fix startup analyze duration and probe size
This commit is contained in:
4
plugins/python-codecs/package-lock.json
generated
4
plugins/python-codecs/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/python-codecs",
|
||||
"version": "0.1.88",
|
||||
"version": "0.1.89",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/python-codecs",
|
||||
"version": "0.1.88",
|
||||
"version": "0.1.89",
|
||||
"devDependencies": {
|
||||
"@scrypted/sdk": "file:../../sdk"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/python-codecs",
|
||||
"version": "0.1.88",
|
||||
"version": "0.1.89",
|
||||
"description": "Python Codecs for Scrypted",
|
||||
"keywords": [
|
||||
"scrypted",
|
||||
|
||||
@@ -21,8 +21,8 @@ async def generateVideoFramesLibav(mediaObject: scrypted_sdk.MediaObject, option
|
||||
# none of this stuff seems to work. might be libav being slow with rtsp.
|
||||
# container.no_buffer = True
|
||||
# container.gen_pts = False
|
||||
# container.options['-analyzeduration'] = '0'
|
||||
# container.options['-probesize'] = '500000'
|
||||
container.options['analyzeduration'] = '0'
|
||||
container.options['probesize'] = '500000'
|
||||
stream = container.streams.video[0]
|
||||
# stream.codec_context.thread_count = 1
|
||||
# stream.codec_context.low_delay = True
|
||||
@@ -48,16 +48,23 @@ async def generateVideoFramesLibav(mediaObject: scrypted_sdk.MediaObject, option
|
||||
thread = threading.Thread(target=threadMain)
|
||||
thread.start()
|
||||
|
||||
print(time.time())
|
||||
try:
|
||||
vipsImage: vipsimage.VipsImage = None
|
||||
pilImage: pilimage.PILImage = None
|
||||
mo: scrypted_sdk.MediaObject = None
|
||||
|
||||
firstFrame = False
|
||||
while True:
|
||||
frame = await sampleQueue.get()
|
||||
if not frame:
|
||||
break
|
||||
|
||||
if not firstFrame:
|
||||
print('first frame')
|
||||
print(time.time())
|
||||
firstFrame = True
|
||||
|
||||
if vipsimage.pyvips:
|
||||
if gray and frame.format.name.startswith('yuv') and frame.planes and len(frame.planes):
|
||||
vips = vipsimage.new_from_memory(memoryview(frame.planes[0]), frame.width, frame.height, 1)
|
||||
|
||||
Reference in New Issue
Block a user