1

I am using FFMPEG to create an mp4 from variable audio and image inputs.

Each audio is paired with one image that should loop for the duration of the audio.

My command is thus:

ffmpeg -i "myAudioFile.mp3" -loop 1  -i /var/www/html/storage/assets/myImagefile.png -vcodec libx264 -shortest -preset fast -acodec aac -strict -2 "myVideoFile.mp4"

It seems to work, except in the resulting .mp4 I have audio but no video (image).

Thank you!

Summer Developer
  • 2,056
  • 7
  • 31
  • 68

1 Answers1

4

FFmpeg is converting the RGB format of the PNG to YUV 4:4:4, but most players only accept YUV 4:2:0, so you've to expressly convert to that

... -vcodec libx264 -pix_fmt yuv420p ...
Gyan
  • 85,394
  • 9
  • 169
  • 201