Azure / azure-media-migration

Azure Media Migration Tool
https://github.com/Azure/azure-media-migration
MIT License
10 stars 13 forks source link

ISM files that have duplicate audio stream tags create duplicate stream in output #250

Closed schuettecarsten closed 1 month ago

schuettecarsten commented 1 month ago

We have several ISM files that look like this:

?xml version="1.0" encoding="UTF-8" standalone="no"?>
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
   <head>
      <meta content="mp4" name="formats"/>
   </head>
   <body>
      <switch>
         <video src="160917_1280x720_1000.mp4"/>
         <video src="160917_1280x720_2000.mp4"/>
         <video src="160917_1280x720_3000.mp4"/>
         <audio src="160917_1280x720_1000.mp4" systemBitrate="128000" title="AAC_eng_ch2_128kbps"/>
      </switch>
   </body>
</smil>

The generated mpd/m3u8 files will contain the three video streams correctly and it looks like the audio signal is processed correctly. But it will also contain a fourth video stream which is the same than the first stream.

<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/google/shaka-packager version v2.6.1-634af65-release-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT6743.52001953125S">
  <Period id="0">
    <AdaptationSet id="0" contentType="video" width="1280" height="720" frameRate="25/1" subsegmentAlignment="true" par="16:9">
      <Representation id="0" bandwidth="2086456" codecs="avc1.4d401f" mimeType="video/mp4" sar="1:1">
        <BaseURL>160917_manifest_1.mp4</BaseURL>
        <SegmentBase indexRange="872-14391" timescale="25">
          <Initialization range="0-871"/>
        </SegmentBase>
      </Representation>
      <Representation id="1" bandwidth="3126380" codecs="avc1.4d401f" mimeType="video/mp4" sar="1:1">
        <BaseURL>160917_manifest_2.mp4</BaseURL>
        <SegmentBase indexRange="872-14391" timescale="25">
          <Initialization range="0-871"/>
        </SegmentBase>
      </Representation>
      <Representation id="2" bandwidth="1147506" codecs="avc1.4d401f" mimeType="video/mp4" sar="1:1">
        <BaseURL>160917_manifest_0.mp4</BaseURL>
        <SegmentBase indexRange="872-14391" timescale="25">
          <Initialization range="0-871"/>
        </SegmentBase>
      </Representation>
      <Representation id="3" bandwidth="1147506" codecs="avc1.4d401f" mimeType="video/mp4" sar="1:1">
        <BaseURL>160917_manifest_3.mp4</BaseURL>
        <SegmentBase indexRange="872-14391" timescale="25">
          <Initialization range="0-871"/>
        </SegmentBase>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

I am not sure if the source files are "invalid" (they were created by a AMS premium encoder workflow several years ago) or if the migration tool needs some code to fix such issues. For example, if the audio src value is the same as an existing video src value, it can be filtered out?

schuettecarsten commented 1 month ago

@duggaraju Let me know if you need sample assets.

duggaraju commented 1 month ago

@schuettecarsten yes that would be helpful

schuettecarsten commented 1 month ago

@schuettecarsten yes that would be helpful

@duggaraju no problem, but I cannot post a SAS link here, so I ask you to drop me an email.

pohhsu commented 1 month ago

@schuettecarsten will follow up with you on gmail

schuettecarsten commented 1 month ago

@pohhsu @duggaraju I've send you an email with some sample assets.