Node.JS
Node.JS

Reputation: 1578

AWS MediaConvert fails when transcoding a video created from an iOS Safari WebRTC

I am trying to transcode a video using MediaConvert and I get the following error:

Error message Demuxer: [ReadPacketData File read failed - end of file hit at length [1105924]. Is file truncated?]

When I try to run ffmpeg command to get information about the file I see this:

non monotonically increasing dts to muxer in stream

I am wondering is there a configuration in MediaConvert that can correct the time stamps?

➜  Downloads ffmpeg -i 2254.webm -hide_banner -f null /dev/null

[h264 @ 0x7fce2c81d400] Increasing reorder buffer to 1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2254.webm':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    creation_time   : 2021-02-17T19:33:56.000000Z
  Duration: 00:00:01.60, start: 0.000000, bitrate: 5535 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1280x720, 5644 kb/s, 27.95 fps, 29.92 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2021-02-17T19:33:56.000000Z
      handler_name    : Core Media Video
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 187 kb/s (default)
    Metadata:
      creation_time   : 2021-02-17T19:33:56.000000Z
      handler_name    : Core Media Audio
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    encoder         : Lavf58.45.100
    Stream #0:0(und): Video: wrapped_avframe, yuvj420p(progressive), 720x1280, q=2-31, 200 kb/s, 29.92 fps, 29.92 tbn, 29.92 tbc (default)
    Metadata:
      encoder         : Lavc58.91.100 wrapped_avframe
      creation_time   : 2021-02-17T19:33:56.000000Z
      handler_name    : Core Media Video
    Side data:
      displaymatrix: rotation of -0.00 degrees
    Stream #0:1(und): Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s (default)
    Metadata:
      creation_time   : 2021-02-17T19:33:56.000000Z
      handler_name    : Core Media Audio
      encoder         : Lavc58.91.100 pcm_s16le
[null @ 0x7fce2e008200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 8 >= 8
[null @ 0x7fce2e008200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 31 >= 31
frame=   41 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.57 bitrate=N/A speed=19.9x    
video:21kB audio:128kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Upvotes: 1

Views: 2081

Answers (1)

jjohn
jjohn

Reputation: 253

At this time MediaConvert expects a fully complete, timestamped correct file. There is no way to change DTS or PTS values at demux in the service.

Are you able to just remux with ffmpeg and get the same results when passing that file to MediaConvert?

ffmpeg -i 2254.webm -c copy output.webm

Upvotes: 1

Related Questions