简体   繁体   English

有时无法使用 Cloudfront 流式传输 HLS MediaConvert 视频

[英]Sometime unable to stream HLS MediaConvert videos using Cloudfront

I converted my video into HLS format through AWS Media Convert.我通过 AWS Media Convert 将我的视频转换为 HLS 格式。 Now I am facing some issues and it is totally random.现在我面临一些问题,这完全是随机的。

Sometimes when I try to stream those HLS encrypted videos it gives a 404 not found error.有时,当我尝试流式传输那些 HLS 加密视频时,会出现 404 not found 错误。 However when I connect VPN and then try to access it then I am able to stream those videos.但是,当我连接 VPN 然后尝试访问它时,我就可以流式传输这些视频了。

Sometimes I am unable to stream those videos on mobile data but it works perfectly over Wifi.有时我无法通过移动数据传输这些视频,但它可以通过 Wifi 完美运行。

Sometimes I am unable to stream videos but my friend who lives in a different city is able to stream it and sometimes my friend is not able to stream but I can.有时我无法流式传输视频,但我住在不同城市的朋友能够流式传输视频,有时我的朋友无法流式传输但我可以。

I am facing these issues on mobile as well as on browser and these are totally random.我在移动设备和浏览器上都面临这些问题,这些问题完全是随机的。

Let me know if you need further details from my side to fix the issue.如果您需要我方面的更多详细信息来解决问题,请告诉我。

I am testing on browser and android app.我正在测试浏览器和 android 应用程序。 For the browser, I used the plyr.js library.对于浏览器,我使用了 plyr.js 库。

Anyone has any idea what could be the issue.任何人都知道可能是什么问题。 I really don't know what part of the code should I share here, let me know if anyone needs to see my code.我真的不知道我应该在这里分享代码的哪一部分,如果有人需要查看我的代码,请告诉我。

================ ================

Q. Can you please confirm if your transcode job on AWS Elemental MediaTailor runs successfully or do you see any errors ?问:您能否确认您在 AWS Elemental MediaTailor 上的转码作业是否成功运行,或者您是否看到任何错误?

A. Yes it is completed successfully A. 是的,它已成功完成

Q. Is the 404 seen for the same output file ?问: 404 是否出现在同一个输出文件中?

A. Yes.答:是的。

Q. Do you use any CDN to deliver your output files or do you stream from S3 directly ?问:您使用任何 CDN 来交付您的输出文件还是直接从 S3 流式传输? If you use a CDN, can you ensure that there's no GeoBlocking on your configuration which may prevent you from accessing the content from a specific region.如果您使用 CDN,您能否确保您的配置中没有 GeoBlocking,这可能会阻止您访问来自特定区域的内容。

A. I use Cloudfront.答:我使用 Cloudfront。 And I don't this there is and geo restriction because it sometimes works and sometime don't.我不知道有地理限制,因为它有时有效,有时无效。

Q. If you stream from S3 directly, are your objects and buckets marked public to allow your files to be accessed by other users ?问:如果您直接从 S3 流式传输,您的对象和存储桶是否标记为公开以允许其他用户访问您的文件?

A. Can not steam directly from S3 as bucket policy allow access through only CloudFront. A. 不能直接从 S3 蒸汽,因为存储桶策略只允许通过 CloudFront 访问。

HTTP status code 404 is usually sent out when a resource is missing.当资源丢失时,通常会发出 HTTP 状态代码 404。
This can happen in multiple scenarios.这可能发生在多种情况下。 For example, the transcode job has not completed yet ie, the object doesn't exist or the URL you're trying to request for is wrong.例如,转码作业尚未完成,即对象不存在或您尝试请求的 URL 错误。 From your description it looks like the issue is intermittent which may mean that you're trying to access the file before it has transcoded successfully.从您的描述来看,问题似乎是间歇性的,这可能意味着您在成功转码之前尝试访问该文件。 However it is still unclear whether you get 404 response for the same file or different files.但是,您是否会收到相同文件或不同文件的 404 响应仍不清楚。 Can you please describe your issue in more detail.您能否更详细地描述您的问题。 Ideally I would need the following information :理想情况下,我需要以下信息:

  1. Can you please confirm if your transcode job on AWS Elemental MediaTailor runs successfully or do you see any errors ?您能否确认您在 AWS Elemental MediaTailor 上的转码作业是否成功运行,或者您是否看到任何错误?
  2. Is the 404 seen for the same output file ? 404 是否出现在同一个输出文件中?
  3. Do you use any CDN to deliver your output files or do you stream from S3 directly ?您是否使用任何 CDN 来交付您的输出文件,还是直接从 S3 流式传输? If you use a CDN, can you ensure that there's no GeoBlocking on your configuration which may prevent you from accessing the content from a specific region.如果您使用 CDN,您能否确保您的配置中没有 GeoBlocking,这可能会阻止您访问来自特定区域的内容。
  4. If you stream from S3 directly, are your objects and buckets marked public to allow your files to be accessed by other users ?如果您直接从 S3 流式传输,您的对象和存储桶是否标记为公开以允许其他用户访问您的文件?

We have instructions on how to setup cloudwatch events to monitor your transcode jobs in our guide[1] but please keep in mind you maybe charged for setting up these events.我们的指南 [1] 中提供了有关如何设置 cloudwatch 事件以监控您的转码作业的说明,但请记住,您可能会因设置这些事件而收费。

====Documentation===== ====文档====

[1] https://docs.aws.amazon.com/mediaconvert/latest/ug/cloudwatch_events.html [1] https://docs.aws.amazon.com/mediaconvert/latest/ug/cloudwatch_events.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM