AWS MediaConvert made transcoded file corrupt

0

Hello! I've been trying to transcode an .wmv file to .mp4 using MediaConvert, and this is what happens:

  1. The original file has 50min and 23 sec

After transcoding it with MediaConvert:

  1. The transcoded file has 25min and 10 sec
  2. The audio is playing at normal speed
  3. The video is sped up in roughly 2x
  • This is the ffprobe metadata output for the original file
Input #0, asf, from 'test_file.wmv':
  Metadata:
    WMFSDKNeeded    : 0.0.0.0000
    DeviceConformanceTemplate: AP@L1
    WM/WMADRCPeakReference: 32767
    WM/WMADRCPeakTarget: 32767
    WM/WMADRCAverageReference: 9902
    WM/WMADRCAverageTarget: 9902
    WMFSDKVersion   : 12.0.7601.17514
    IsVBR           : 0
  Duration: 00:50:23.97, start: 0.000000, bitrate: 497 kb/s
  Stream #0:0(eng): Audio: wmapro (b[1][0][0] / 0x0162), 44100 Hz, stereo, fltp, 96 kb/s
  Stream #0:1(eng): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 512x348 [SAR 250:249 DAR 32000:21663], 1045 kb/s, SAR 1:1 DAR 128:87, 30 tbr, 1k tbn
  • This is my output configuration object for transcoding the file
const OUTPUT_VIDEO: MediaConvert.Output = {
  ContainerSettings: {
    Container: "MP4",
    Mp4Settings: {},
  },
  VideoDescription: {
    CodecSettings: {
      Codec: "H_264",
      H264Settings: {
        MaxBitrate: 500000,
        RateControlMode: "QVBR",
        SceneChangeDetect: "TRANSITION_DETECTION",
        FramerateControl: "INITIALIZE_FROM_SOURCE",
      },
    },
  },
  AudioDescriptions: [
    {
      AudioSourceName: "Audio Selector 1",
      CodecSettings: {
        Codec: "AAC",
        AacSettings: {
          Bitrate: 96000,
          CodingMode: "CODING_MODE_2_0",
          SampleRate: 48000,
        },
      },
    },
  ],
  Extension: "mp4",
};



asked 3 months ago145 views
1 Answer
1

Hi there,

The most probable causes for this observed change in the playback speed could be the following:

  • Due to frame-rate conversions happening because of your job settings.
  • Timecode inconsistencies between input and output resulting in speed variation.
  • Audio/Video synchronisation issues in the input can cause such a difference in transcode.
  • Input file integrity. Corrupted input files can lead to unexpected behavior during transcoding.

–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

To check for frame rates and playback speed-related metadata specifically, you can use the following commands with FFprobe:

  • Check and compare Frame Rate data in the input and output files:
ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of default=noprint_wrappers=1 FILE_NAME

This command extracts the frame rate information from the video stream

  • Check and compare Playback Speed Metadata in the input and output files:
ffprobe -v error -select_streams v:0 -show_entries frame=pict_type -of default=noprint_wrappers=1 FILE_NAME

This command provides information about the picture types, and by analysing the output, you may get an idea if there are any unusual patterns affecting playback speed.

  • Further, you can also check for time base information to ensure that the timing of frames is consistent between the input and output files:
ffprobe -v error -select_streams v:0 -show_entries stream=time_base -of default=noprint_wrappers=1 FILE_NAME

By examining these details, you can identify any discrepancies in frame rates or playback speed metadata between the input and output files, helping you pinpoint the issue causing the speed-up problem.

Please also try running your job without enabling SceneChangeDetect: "TRANSITION_DETECTION" as this feature can cause GOP level changes which could be a possible reason for the shift in frames.

Lastly, try running the job with a few different .wmv files to make sure that this is not an issue with this particular file. If this turns out to be the case, you can use FFPROBE to analyse these different .wmv files to understand what exactly is the issue with this particular file.

In case all the above recommendations fail to provide you a resolution, I would highly recommend reaching out to our AWS Premium Support team for deep dive technical assistance - https://aws.amazon.com/premiumsupport/faqs/

AWS
SUPPORT ENGINEER
answered 3 months ago
  • Thanks for your help. I tried running the ffprobe commands and this is what I noticed:

    • For the third ffprobe command (ffprobe -v error -select_streams v:0 -show_entries stream=time_base -of default=noprint_wrappers=1 FILE_NAME ) I noticed the following:
    • Input file: time_base=1/1000
    • Transcoded file: time_base=1/3000

    After this, I tried removing SceneChangeDetect: "TRANSITION_DETECTION" from MediaConvert instruction and I've got this from new transcoded file: time_base=1/30000

    I think it's also important to mention that, I also tried transcoding the file using ElasticTranscoder, and it worked successfully there but not with MediaConvert

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions