无法在videogular中播放使用亚马逊弹性代码转换器创建的mpegdash视频

时间:2018-11-07 01:34:07

标签: java mpeg-dash amazon-elastic-transcoder videogular

我使用Amazon Elastic Transcoder对一些视频进行了转码,并且我还将videogular与wowza一起用于一些实时视频。当我将wowza与mpegdash一起使用时,播放器工作正常。但是,当我尝试在Cloudfront中使用我的转码文件时,没有任何效果。同样,我使用了视频页面中的示例,我得到了相同的错误。我以为我在转码后的文件上做错了什么。 这是我转码文件的示例 https://d19cwas8lp55sz.cloudfront.net/archivos/1048/mpegDash/playlist.mpd 我从videogular使用了这个示例

Videogular Dash Plugin Example

我刚刚更改了源文件,但遇到了同样的问题,无法播放文件。在将ssl添加到我的Cloudfront发行版并添加$ sce.trustAsResourceUrl()之后,我遇到了一些cors问题,这些问题得以解决,但是我仍然遇到相同的问题

Cannot play media. No decoders for requested formats: application/dash+xml

HTTP “Content-Type” of “application/dash+xml” is not supported. Load of media resource https://xxxxxxxxx/archivos/1053/mpegDash/playlist.mpd failed.

我用curl检查了我的Cloudfront发行版的标头,目前看来还可以

我像这样使用卷发

curl -H "origin: http://ramonaclient2.localdomain/" -v "https://xxxxxxxxxxx/archivos/1046/mpegDash/mpegDash0600k/2f79632dd95a45519d1ec09bc230aad3b824384d09edebd0e214aa07b9c0fc8b" 

我在标题上执行此操作

access-control-allow-origin: *
access-control-allow-methods: GET, HEAD

这是我在Java应用程序中为弹性转码器创建作业的方式

CreateJobOutput mpegDashAudio = new CreateJobOutput()
                .withKey("mpegDashAudio/" + outputKey)
                .withPresetId(MPEG_DASH_128K_AUDIO_PRESET_ID)
                .withSegmentDuration(SEGMENT_DURATION);
        CreateJobOutput mpegDash0600k = new CreateJobOutput()
                .withKey("mpegDash0600k/" + outputKey)
                .withPresetId(MPEG_DASH_600K_PRESET_ID)
                .withSegmentDuration(SEGMENT_DURATION);
        CreateJobOutput mpegDash1200k = new CreateJobOutput()
                .withKey("mpegDash1200k/" + outputKey)
                .withPresetId(MPEG_DASH_1200K_PRESET_ID)
                .withSegmentDuration(SEGMENT_DURATION);
        CreateJobOutput mpegDash2400k = new CreateJobOutput()
                .withKey("mpegDash2400k/" + outputKey)
                .withPresetId(MPEG_DASH_2400K_PRESET_ID)
                .withSegmentDuration(SEGMENT_DURATION);
        CreateJobOutput mpegDash4800k = new CreateJobOutput()
                .withKey("mpegDash4800k/" + outputKey)
                .withPresetId(MPEG_DASH_4800K_PRESET_ID)
                .withSegmentDuration(SEGMENT_DURATION).withThumbnailPattern("thumbs/img-{resolution}-{count}");

1 个答案:

答案 0 :(得分:0)

更多的是云端问题

我只需要添加

<AllowedHeader>range</AllowedHeader>