gpt4 book ai didi

java - 转码只有在客户端超时后才完成?

转载 作者:太空宇宙 更新时间:2023-11-04 14:30:44 26 4
gpt4 key购买 nike

来自 AMI 的 Wowza Streaming Engine 4.0.4 可在此处获取

目前,我需要等待文件转码完成才能再次使用。

我正在查看日志,我看到了以下内容:

INFO session comment 1420436222 client connectionClosed [1420436222] pingtimeout
INFO server comment - onStreamDestroy: 1
INFO server comment - TranscodingSession.shutdown[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d91412373547415]
INFO transcoder decoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d91412373547415 -
INFO transcoder encoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d91412373547415 {name: "aac"}

然后转码就完成了。并且 .tmp 文件被删除。

我假设“pingtimeout”是由于不活动而发生的自然事件。我不想让客户端坐在那里,直到它自然超时,然后我才能使用转码文件。

有什么方法可以强制关闭来自客户端或服务器的连接,而无需等待“pingtimeout”,以便我可以更快地使用此转码文件?

客户端应该能够告诉服务器“我完成了”,然后服务器应该完成所有转码操作。我可以这样做吗?

我已经从客户端调用了 NetStream.close()NetStream.dispose(),但这似乎没有帮助。

编辑:

在客户端我调用NetStream.close()然后,我调用自定义方法来访问保存文件的服务器端 API。

这是成功尝试的日志:

INFO server comment - LiveStreamPacketizerSanJose.endChunkTS[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395]: Add chunk: id:4 a/v/k:251/151/10 duration:10026
INFO server comment - TranscodingSession.close[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395]
INFO stream recordstop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 -
INFO stream unpublish 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 -
INFO server comment - onStreamDestroy: 1
INFO stream destroy 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 -
INFO session disconnect 1958636839 -
INFO server comment - onDisconnect: 1958636839
INFO server comment - TranscodingSession.shutdown[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395]
INFO transcoder decoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 -
INFO transcoder encoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 {name: "aac"}
INFO stream unpublish 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395_aac -
INFO server comment - onStreamDestroy: 2
INFO stream destroy 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395_aac -
INFO session connect-pending 50.246.217.38 -
INFO server comment - onConnect: 553457279
INFO session connect 50.246.217.38 -
INFO server comment - onConnectAccept: 553457279
INFO server comment - onStreamCreate: 1
INFO stream create - -
INFO stream play 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 -
INFO stream seek 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 -
INFO server comment - Saving thumbnail
INFO server comment - AMFDataList:
[0] saveThumbnail
[1] 3.0
[2] null
[3] 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395
[4] {Array: size: 19053, data: [largeblock]}

INFO server comment - Thumbnail saved /usr/local/WowzaStreamingEngine/content/recorder/thumb_530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395.jpg
INFO stream stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395 -
INFO server comment - doSave hit
INFO server comment - AMFDataList:
[0] doSave
[1] 4.0
[2] null
[3] 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395

INFO server comment - Starting upload
INFO server comment - getting credentials
INFO server comment - attempting to upload 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395_aac.mp4 to xxxxxxxxxx
INFO server comment - mp4 upload complete xxxxxxxxxx 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395_aac.mp4
INFO server comment - getting credentials
INFO server comment - attempting to upload thumb_530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395.jpg to xxxxxxxxxx
INFO server comment - thumb upload complete xxxxxxxxxx thumb_530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395.jpg
INFO server comment - sending info to client rtmp://xxxxxxxxxx.cloudfront.net/cfx/st/530d8aa855df0c2d269a5a58/53a47a049c52c9d83a2d71d8/1412696439395_aac.mp4
INFO server comment - deleting 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412696439395
INFO server comment - deleting thumbnail
INFO server comment - deleting mp4 video
INFO server comment - deleting mp4 AAC video

第一行表示一个流。

第二行是转码器关闭,当我停止录制和发布时发生,然后转码器关闭。现在转码后的文件就可以使用了。除非转码器关闭,否则我无法访问转码后的文件。

之后的所有行都是自定义模块内容。

这是失败尝试的日志:

INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485]: Add chunk: type:video id:10 count:15 duration:1007
INFO server comment - TranscodingSession.close[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485]
INFO stream recordstop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO stream unpublish 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO session connect-pending 50.246.217.38 -
INFO server comment - onConnect: 968481495
INFO session connect 50.246.217.38 -
INFO server comment - onConnectAccept: 968481495
INFO server comment - onStreamCreate: 1
INFO stream create - -
INFO stream play 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO stream seek 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO server comment - Saving thumbnail
INFO server comment - AMFDataList:
[0] saveThumbnail
[1] 3.0
[2] null
[3] 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485
[4] {Array: size: 18915, data: [largeblock]}

INFO server comment - Thumbnail saved /usr/local/WowzaStreamingEngine/content/recorder/thumb_530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485.jpg
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485_aac]: Add chunk: type:video id:10 count:15 duration:1007
INFO stream stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO server comment - doSave hit
INFO server comment - AMFDataList:
[0] doSave
[1] 4.0
[2] null
[3] 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485

INFO server comment - Starting upload
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - Tmp file exists, waiting
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485]: Add chunk: type:video id:10 count:15 duration:1007
INFO server comment - TranscodingSession.close[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485]
INFO stream recordstop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO stream unpublish 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO server comment - Tmp file exists, waiting
INFO session comment 404091380 client connectionClosed [404091380] pingtimeout
INFO server comment - onStreamDestroy: 1
INFO stream destroy 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO server comment - TranscodingSession.shutdown[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485]
INFO transcoder decoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 -
INFO transcoder encoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485 {name: "aac"}
INFO session disconnect 404091380 -
INFO server comment - onDisconnect: 404091380
INFO stream unpublish 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485_aac -
INFO server comment - onStreamDestroy: 1
INFO stream destroy 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485_aac -
INFO server comment - Tmp file exists, waiting
INFO server comment - getting credentials
INFO server comment - attempting to upload 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485_aac.mp4 to xxxxxxxxxx
INFO server comment - mp4 upload complete xxxxxxxxxx 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485_aac.mp4
INFO server comment - getting credentials
INFO server comment - attempting to upload thumb_530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485.jpg to xxxxxxxxxx
INFO server comment - thumb upload complete xxxxxxxxxx thumb_530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485.jpg
INFO server comment - sending info to client rtmp://xxxxxxxxxx.cloudfront.net/cfx/st/530d8aa855df0c2d269a5a58/53a47a049c52c9d83a2d71d8/1412697135485_aac.mp4
INFO server comment - deleting 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412697135485
INFO server comment - deleting thumbnail
INFO server comment - deleting mp4 video
INFO server comment - deleting mp4 AAC video

对于这个,你可以看到转码 session 关闭了两次,然后只有当客户端超时时,转码 session 才会关闭

编辑:

我刚刚在禁用自定义模块的情况下尝试了此操作。同样的事情发生了:这是日志的复制/粘贴:

INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117_aac]: Add chunk: type:audio id:0 count:32 duration:2053
INFO server comment - TranscodingSession.close[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117]
INFO stream recordstop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 -
INFO stream unpublish 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 -
INFO server comment - MediaCasterStreamValidator.init[player/_definst_]: Started
INFO server comment - ServerListenerEC2Variables#ApplicationInstanceNotify.onApplicationInstanceCreate[player/_definst_]: Auto-set application RTSP addresses: internal[bind]:10.213.146.195 external[origin,connection]:54.188.88.9
INFO application app-start _definst_ player/_definst_
INFO session connect-pending 50.246.217.38 -
INFO session connect 50.246.217.38 -
INFO stream create - -
INFO stream play 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 -
INFO stream seek 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 -
WARN server comment - Missing function: saveThumbnail
INFO stream stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 -
INFO session comment 1588047012 client connectionClosed [1588047012] pingtimeout
INFO server comment - TranscodingSession.shutdown[recorder/_definst_/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117]
INFO transcoder decoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 -
INFO transcoder encoder-audio-stop 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 {name: "aac"}
INFO stream destroy 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117 -
INFO session disconnect 1588047012 -
INFO stream unpublish 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117_aac -
INFO stream destroy 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d81412700435117_aac -

您可以在转码 session 关闭之前看到 ping 超时。

最佳答案

我在 NetStream.publish("null")NetStream.close() 之后添加了 NetConnection.close() ,这修复了问题。

关于java - 转码只有在客户端超时后才完成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26187645/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com