3GP文件返回错误&QUOT

3GP文件返回错误&QUOT

本文介绍了Azure的媒体服务 - 3GP文件返回错误"文件类型或codeC不支持"。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图上传,转换/ EN code和prepare在Azure的媒体服务一个名为.3gp视频文件,我们得到了不支持的误差文件类型或codeC。 基于此信息,3GP应该支持导入。如何正确导入3GP并将其转换成MP4?

下面就是我们的内部日志说:

 作业停止由于取消或错误。
作业ID:注:JID:UUID:6dc360df-de54-eb45-ae0d-bdc3d2c810fe
项目名称:编码和包装的dedf426e0b5b41199e8a111f27744890
作业状态:错误
错误详情:
任务ID:注意:TID:UUID:12424cbb-0013-4685-8e6b-b224d99db186
    错误code:UserInput
    错误信息:不支持的文件类型或codeC。

我们的code:

  ///<总结>
///此方法执行所需的所有有问题的媒体处理。此方法将等待处理完成。
///< /总结>
///< PARAM NAME =文件名>在扩展名为LT唯一的文件名; /参数>
///<退货和GT; IsSuccess< /回报>
公共BOOL ProcessMedia(字符串文件名)
{
    变种mediaCloud = GetCloudMediaContext();    字符串ASSETNAME = GetAssetNameFromFileName(文件名);    变种资产= mediaCloud.Assets.Where(一个= GT; a.Name == ASSETNAME).SingleOrDefault();
    IJob工作= mediaCloud.Jobs.Create(编码和包装的+ asset.Name);
    变种EN codeR = GetMediaProcessor(_mediaProcessorNameMap [MediaProcessors.WindowsAzureMediaEn codeR]);    / *发射了编码工作链
     * 1)原始编码 - > MP4(直接下载流)
     * 2)的MP4 - > IIS Smooth Streaming的(微软的Silverlight)
     * 3)IIS - > HLS(苹果和IOS)* /    // MP4
    VAR mp4Task = job.Tasks.AddNew(的String.Format(,asset.NameMP4 {0}编码),EN codeR,H264宽带720P,TaskOptions.None);
    mp4Task.InputAssets.Add(资产);
    VAR mp4Asset = mp4Task.OutputAssets.AddNew(的String.Format(MP4_ASSET_NAME_FORMAT,asset.Name),AssetCreationOptions.None);    //生成缩略图MP4
    的foreach(ThumbnailTypes thumbnailType在E​​num.GetValues​​(typeof运算(ThumbnailTypes)))
    {
        VAR thumbnailTask​​ = job.Tasks.AddNew(的String.Format(缩略图生成{0},asset.Name),EN codeR,
            的String.Format(TASK_THUMBNAIL_GENERATION_FORMAT,thumbnailType,ImageProcessor.ThumbnailSizes [thumbnailType] .Height)
            TaskOptions.None);
        thumbnailTask​​.InputAssets.Add(mp4Asset);
        VAR thumnailAsset = thumbnailTask​​.OutputAssets.AddNew(的String.Format(THUMBNAIL_ASSET_NAME_FORMAT,thumbnailType,asset.Name),AssetCreationOptions.None);
    }    // IIS
    VAR encodingTask = job.Tasks.AddNew(的String.Format(,asset.Name{0} IIS编码),EN codeR,H264平滑流720P,TaskOptions.None);
    encodingTask.InputAssets.Add(mp4Asset);
    VAR ssOutput = encodingTask.OutputAssets.AddNew(的String.Format(IIS_ASSET_NAME_FORMAT,asset.Name),AssetCreationOptions.None);    // HLS
    VAR打包= GetMediaProcessor(_mediaProcessorNameMap [MediaProcessors.WindowsAzureMediaPackager]);
    VAR conversionTask = job.Tasks.AddNew(的String.Format(HLS包装{0},asset.Name),打包,TASK_MSMOOTH_TO_HLS,TaskOptions.None);
    conversionTask.InputAssets.Add(ssOutput);
    conversionTask.OutputAssets.AddNew(的String.Format(HLS_ASSET_NAME_FORMAT,asset.Name),AssetCreationOptions.None);    如果(job.Tasks.Count()== 0)//是不需要处理
        返回true;    job.StateChanged + =新的EventHandler< JobStateChangedEventArgs>(StateChanged);    job.Submit();    //检查作业执行,并等待作业完成。
    任务progressJobTask = job.GetExecutionProgressTask(CancellationToken.None);
    progressJobTask.Wait();    返回job.State == JobState.Finished;
}


解决方案

您应该看看<一个href=\"http://azure.microsoft.com/en-us/documentation/articles/media-services-azure-media-en$c$cr-formats/\"相对=nofollow>天青媒体恩codeR格式和codeCS 的,而不是微软前pression恩codeR支持的文件格式。

以上文档指出 .3GPP .3GPP2 也能支持的文件格式。而视频codeCS是非常有限的: H.264 MPEG-1 MPEG-2 MPEG-4 VC-1 Windows Media视频 DV

根据 3GPP 这里 。如此看来,该文件格式本身支持多种视频和音频codeCS。只有少数人支持在Azure媒体恩$ C $铬。请使用一些第三方工具(如)仔细检查音频和视频codeCS 你的 3GP 文件,并确保它们在湛蓝的媒体连接codeR支持列表中。并注意文件扩展名没有定义文件中使用EN code媒体codeC。

When attempting to upload, convert/encode and prepare a .3gp video file in Azure Media Services, we get the error File type or codec not supported. Based on this information, 3gp should be supported for import. How do I properly import 3gp and convert it to MP4?

Here's what our internal logs say:

The job stopped due to cancellation or an error.
Job ID: nb:jid:UUID:6dc360df-de54-eb45-ae0d-bdc3d2c810fe
Job Name: Encoding and Packaging for dedf426e0b5b41199e8a111f27744890
Job State: Error
Error Details:
Task Id: nb:tid:UUID:12424cbb-0013-4685-8e6b-b224d99db186
    Error Code: UserInput
    Error Message: File type or codec not supported.

Our code:

/// <summary>
/// This method performs all processing necessary to the media in question. This method will wait while processing is completed.
/// </summary>
/// <param name="fileName">Unique file name with extension</param>
/// <returns>IsSuccess</returns>
public bool ProcessMedia(string fileName)
{
    var mediaCloud = GetCloudMediaContext();

    string assetName = GetAssetNameFromFileName(fileName);

    var asset = mediaCloud.Assets.Where(a => a.Name == assetName).SingleOrDefault();
    IJob job = mediaCloud.Jobs.Create("Encoding and Packaging for " + asset.Name);
    var encoder = GetMediaProcessor(_mediaProcessorNameMap[MediaProcessors.WindowsAzureMediaEncoder]);

    /* Firing off a chain of encoding jobs
     * 1) Original Encoding -> MP4 (Direct download stream)
     * 2) MP4 -> IIS Smooth Streaming (Microsoft Silverlight)
     * 3) IIS -> HLS (Apple and IOS) */

    //MP4
    var mp4Task = job.Tasks.AddNew(String.Format("MP4 Encoding for {0}", asset.Name), encoder, "H264 Broadband 720p", TaskOptions.None);
    mp4Task.InputAssets.Add(asset);
    var mp4Asset = mp4Task.OutputAssets.AddNew(String.Format(MP4_ASSET_NAME_FORMAT, asset.Name), AssetCreationOptions.None);

    //Generate thumbnails from MP4
    foreach (ThumbnailTypes thumbnailType in Enum.GetValues(typeof(ThumbnailTypes)))
    {
        var thumbnailTask = job.Tasks.AddNew(String.Format("Thumbnail Generation for {0}", asset.Name), encoder,
            String.Format(TASK_THUMBNAIL_GENERATION_FORMAT, thumbnailType, ImageProcessor.ThumbnailSizes[thumbnailType].Height),
            TaskOptions.None);
        thumbnailTask.InputAssets.Add(mp4Asset);
        var thumnailAsset = thumbnailTask.OutputAssets.AddNew(String.Format(THUMBNAIL_ASSET_NAME_FORMAT, thumbnailType, asset.Name), AssetCreationOptions.None);
    }

    //IIS
    var encodingTask = job.Tasks.AddNew(String.Format("IIS Encoding for {0}", asset.Name), encoder, "H264 Smooth Streaming 720p", TaskOptions.None);
    encodingTask.InputAssets.Add(mp4Asset);
    var ssOutput = encodingTask.OutputAssets.AddNew(String.Format(IIS_ASSET_NAME_FORMAT, asset.Name), AssetCreationOptions.None);

    //HLS
    var packager = GetMediaProcessor(_mediaProcessorNameMap[MediaProcessors.WindowsAzureMediaPackager]);
    var conversionTask = job.Tasks.AddNew(String.Format("HLS Packaging for {0}", asset.Name), packager, TASK_MSMOOTH_TO_HLS, TaskOptions.None);
    conversionTask.InputAssets.Add(ssOutput);
    conversionTask.OutputAssets.AddNew(String.Format(HLS_ASSET_NAME_FORMAT, asset.Name), AssetCreationOptions.None);

    if (job.Tasks.Count() == 0) //no processing was required
        return true;

    job.StateChanged += new EventHandler<JobStateChangedEventArgs>(StateChanged);

    job.Submit();

    // Check job execution and wait for job to finish.
    Task progressJobTask = job.GetExecutionProgressTask(CancellationToken.None);
    progressJobTask.Wait();

    return job.State == JobState.Finished;
}
解决方案

You shall look at Azure Media Encoder formats and codecs, but not the Microsoft Expression Encoder supported file formats.

The above documentation states that .3GPP and .3GPP2 are supported as file formats. And the Video codecs are very limited: H.264, MPEG-1, MPEG-2, MPEG-4, VC-1, Windows Media Video, DV.

Based on 3GPP data here. It seems that the file format itself supports multiple video and audio codecs. Only few of them are supported on Azure Media Encoder. Please use some 3rd party tool (like VLC) to double check the Audio and Video codecs of your 3GP file and make sure they are in the list of supported by Azure Media Encoder. And note that file extension does not define the codec used to encode the media within that file.

这篇关于Azure的媒体服务 - 3GP文件返回错误&QUOT;文件类型或codeC不支持&QUOT;。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 22:28