-1

I have used the AWS service MediaConvert to convert videos into another format before, and sometimes the first half-minute of the video will be just grey, but it will get better as the video goes on. A example frame provided below. If the object in the video moves a lot, it gets more color back.

Today I came acrossed using opencv to convert mp4 into avi, and the same thing happends again. Does anyone know why this is happening and how to prevent it?

enter image description here

CJ Lin
  • 35
  • 4

1 Answers1

0

Do you mind posting the output settings you are using?

For Video Quality settings, I would say make sure your settings contain the following:

Scene change detection is enabled
Adaptive Quantization is set to Auto
Set Profile to High for AVC, Main/High for HEVC or Main for MPEG-2 video codecs
Set reference frames to 3
Set b-frames to 2.

If you are seeing grey frames at the beginning of encodes, also may be worth running the following ffprobe [1] command on your input source to make sure your first frame is a key frame (IDR) [2].

ffprobe -i testme.mp4 -select_streams v:0 -show_frames | grep -E '(FRAME|key_frame=|pict_type=)'

Output will look something like this:

[FRAME]
key_frame=1
pict_type=I
[/FRAME]
[FRAME]
key_frame=0
pict_type=B
[/FRAME]
[FRAME]
key_frame=0
pict_type=B
[/FRAME]
[FRAME]
key_frame=0
pict_type=B
[/FRAME]
[FRAME]
....

== Resources ==
[1] FFPROBE Download: https://ffmpeg.org/download.html
[2] What is an IDR Frame: https://streaminglearningcenter.com/articles/everything-you-ever-wanted-to-know-about-idr-frames-but-were-afraid-to-ask.html

jjohn
  • 233
  • 1
  • 3