简体   繁体   中英

Azure media service:Generate thumbnail with video encode

I am using azure media service to generate encode,trim video. Now i want to generate video thumbnail with custom encoding preset. Here what i used to encode video and generate thumbnail:

{
"Version": "1.0",
  "Sources": [
    {
      "StartTime": "00:00:00",
      "Duration": "00:01:00"
    }
  ],
  "Codecs": [
    {
      "Type": "CopyVideo"
    },
    {
      "Type": "CopyAudio"
    },
    {
      "PngLayers": [
        {
          "Type": "PngLayer",
          "Width": 150,
          "Height": 150
        }
      ],
      "Start": "{Best}",
      "Type": "PngImage"
    }
  ],
  "Outputs": [
    {
      "FileName": "e3cb10a2-1580-49f7-ad29-99c44f5bc936_{Width}x{Height}_{VideoBitrate}.mp4",
      "Format": {
        "Type": "MP4Format"
      }
    },
    {
      "FileName": "{Basename}_{Index}{Extension}",
      "Format": {
        "Type": "PngFormat"
      }
    }
  ]
}

while i am trying to encode video and generate thumbnail, getting this error:

The preset results in multiple outputs with same name. Either use unique file names or use macros to disambiguate!

Above code is work perfect if i remove thumbnail configuration and doing just video encoding.

Can any one suggest is it possible to generate thumbnail with copyaudio and copyvideo codecs?

It's mandatory for Thumbnail generation to use the macro {Index} in the filename output. That shall solve the issue. Regards,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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