none
What task config should I use to enable video streams seeking in HTML5 video tag? RRS feed

  • Question

  • Hi all:

          I am trying to play videos that were converted by Azure Media Services in HTML5 video tag.

    <video src ="share access to video file (mp4 file)" preload ="auto" >
    </video>


    But those HTML5 videos can not be seek (jump anywhere) like other HTML5 videos do.

    (such as this one http://media.w3.org/2010/05/sintel/trailer.mp4

    on http://www.w3.org/2010/05/video/mediaevents.html ).

    Its goes back to its previous position after clicking the process bar.


    Am I using the wrong config ?

    What should I do to make seeking possible ?


    More details are list below:

    Processor used: "Windows Azure Media Encoder"

    Task configs used in the encoding job:

    <?xml version="1.0" encoding="utf-16"?>
    <Preset
      Version="4.0">
      <Job />
      <MediaFile
        DeinterlaceMode="AutoPixelAdaptive"
        ResizeQuality="Super"
        NormalizeAudio="True"
        AudioGainLevel="1"
        VideoResizeMode="Stretch">
        <Metadata
          MergeCollection="True">
          <Item
            Name="WM/EncodedBy"
            Value="Media Services default setting" />
        </Metadata>
        <OutputFormat>
          <MP4OutputFormat
            StreamCompatibility="Standard">
            <AudioProfile Condition="SourceContainsAudio">
              <AacAudioProfile
                Codec="AAC"
                Channels="2"
                BitsPerSample="16"
                SamplesPerSecond="44100">
                <Bitrate>
                  <ConstantBitrate
                    Bitrate="128"
                    IsTwoPass="False"
                    BufferWindow="00:00:00" />
                </Bitrate>
              </AacAudioProfile>
            </AudioProfile>
            <VideoProfile Condition="SourceContainsVideo">
              <MainH264VideoProfile
                BFrameCount="3"
                EntropyMode="Cabac"
                RDOptimizationMode="Quality"
                HadamardTransform="True"
                SubBlockMotionSearchMode="Quality"
                MultiReferenceMotionSearchMode="Quality"
                ReferenceBFrames="False"
                AdaptiveBFrames="True"
                SceneChangeDetector="True"
                FastIntraDecisions="False"
                FastInterDecisions="False"
                SubPixelMode="Quarter"
                SliceCount="0"
                KeyFrameDistance="00:00:05"
                InLoopFilter="True"
                MEPartitionLevel="EightByEight"
                ReferenceFrames="4"
                SearchRange="128"
                AutoFit="True"
                Force16Pixels="False"
                FrameRate="0"
                SeparateFilesPerStream="True"
                SmoothStreaming="False"
                NumberOfEncoderThreads="0">
                <Streams
                  AutoSize="False">
                  <StreamInfo
                    Size="320, 180">
                    <Bitrate>
                      <ConstantBitrate
                        Bitrate="538"
                        IsTwoPass="False"
                        BufferWindow="00:00:05" />
                    </Bitrate>
                  </StreamInfo>
                </Streams>
              </MainH264VideoProfile>
            </VideoProfile>
          </MP4OutputFormat>
        </OutputFormat>
      </MediaFile>
    </Preset>

    These HMTL5 videos can not be seek in Neither IE(IE9) nor Chrome,but can be seek in silverlight player control(only in IE).



    Best Regards

    Eddy Lin






    • Edited by Eddy-Lin Thursday, February 7, 2013 2:00 AM
    Wednesday, February 6, 2013 9:18 AM

Answers

  • Hi Eddy,

    Your seek operation is translated into a partial content request by the player. This is a request that contains a Range header specifying and starting-ending range of bytes to download. This way, you do not need to wait until the full video file is downloaded to perform a seek (this only applies to progressive download scenarios).

    To make this feature work, the back-end service hosting your videos must accept range requests. You can tell if a service supports partial content requests if it returns an Accept-Ranges header in the response.

    Windows Azure Blob Storage does support partial content requests starting from version 2011-08-18 (and newer). However, anonymous and un-versioned requests, (like the ones sent by the player) are treated with an earlier version by default. So, to enable this feature you can do one of the following things:

    1. Add the following header to all your requests: x-ms-version: 2011-08-18 (or higher version). However, I think this won't be possible in your scenario since the player is the one making the request directly to Blob Storage.
    2. Set your Blob Service Properties default version to 2011-08-18 (or higher). This way, all you anonymous and un-versioned requests will target this version. This operation must be performed in the Storage Account that is linked to your Media Services account.

    For option #2, you can use the following code:

    var storageAccount = CloudStorageAccount.Parse("AccountName=<accountName>;AccountKey=<accountKeyBase64>;DefaultEndpointsProtocol=http");
    var blobClient = storageAccount.CreateCloudBlobClient();

    // Get the current service properties
    var serviceProperties = blobClient.GetServiceProperties();

    // Set the default service version to 2011-08-18 (or a higher version like 2012-03-01)
    serviceProperties.DefaultServiceVersion = "2011-08-18";

    // Save the updated service properties
    blobClient.SetServiceProperties(serviceProperties);

    Hope this helps,

    Mariano Converti - http://blogs.southworks.net/mconverti

    Wednesday, February 6, 2013 6:20 PM

All replies

  • More than likely the issue is not with the way the video is encoded, but rather how it is delivered.  The Content-Type for MP4 files may not be getting set correctly.  See http://social.msdn.microsoft.com/Forums/en-US/MediaServices/thread/08c15193-668e-49f1-b667-75772b547529 for more info.

    Wednesday, February 6, 2013 4:08 PM
    Moderator
  • Hi Eddy,

    Your seek operation is translated into a partial content request by the player. This is a request that contains a Range header specifying and starting-ending range of bytes to download. This way, you do not need to wait until the full video file is downloaded to perform a seek (this only applies to progressive download scenarios).

    To make this feature work, the back-end service hosting your videos must accept range requests. You can tell if a service supports partial content requests if it returns an Accept-Ranges header in the response.

    Windows Azure Blob Storage does support partial content requests starting from version 2011-08-18 (and newer). However, anonymous and un-versioned requests, (like the ones sent by the player) are treated with an earlier version by default. So, to enable this feature you can do one of the following things:

    1. Add the following header to all your requests: x-ms-version: 2011-08-18 (or higher version). However, I think this won't be possible in your scenario since the player is the one making the request directly to Blob Storage.
    2. Set your Blob Service Properties default version to 2011-08-18 (or higher). This way, all you anonymous and un-versioned requests will target this version. This operation must be performed in the Storage Account that is linked to your Media Services account.

    For option #2, you can use the following code:

    var storageAccount = CloudStorageAccount.Parse("AccountName=<accountName>;AccountKey=<accountKeyBase64>;DefaultEndpointsProtocol=http");
    var blobClient = storageAccount.CreateCloudBlobClient();

    // Get the current service properties
    var serviceProperties = blobClient.GetServiceProperties();

    // Set the default service version to 2011-08-18 (or a higher version like 2012-03-01)
    serviceProperties.DefaultServiceVersion = "2011-08-18";

    // Save the updated service properties
    blobClient.SetServiceProperties(serviceProperties);

    Hope this helps,

    Mariano Converti - http://blogs.southworks.net/mconverti

    Wednesday, February 6, 2013 6:20 PM
  • I set default service version to 2011-08-18 and Problem solved ,

    thank you guys.

    • Edited by Eddy-Lin Thursday, February 7, 2013 1:59 AM
    Thursday, February 7, 2013 1:45 AM
  • Mariano, your a champion!

    One question what is the version 2012-03-01. API version go up to 2012-02-12 according to this http://msdn.microsoft.com/en-us/library/windowsazure/dd894041.aspx?

    Cheers,
    Taras

    Monday, March 4, 2013 1:11 AM
  • Ciao Mariano

    What makes me slightly uncomfortable with this process is the fact that it does not seem possible to restore the previous (default) configuration in case of need.

    The fact that MS themselves are still sticking to such an old version of these settings makes me wonder what are the side effects and potential incompatibilities of setting a newer standard. Without knowing clearly how to go back it mean I will only dare applying this change for very specific projects that will not suffer from regression and only at the start of the project.So, to summarize:

    1) Is it possible to know the default version?

    2) Is there documentation about the settings and about the changes at each version?

    Thanks a lot

    Thursday, December 17, 2015 11:34 AM