1

I am trying to combine a picture and an audio file without any quality loss. I am currently using the following command:

ffmpeg -r 1 -loop 1 -i ./pic.JPG -i ./audio.wav -acodec copy -r 1 -shortest howitgoes.avi

This works well for keeping the audio bit rate the same but the picture (which is 4000x6000) is noticeably compressed.

Does anyone know of a better ffmpeg command or any way of combining a picture with an audio file without loss of quality?

1 Answer 1

1

Use:

ffmpeg -framerate 1 -loop 1 -i pic.JPG -i audio.wav -c copy -shortest howitgoes.avi

This will stream copy the JPG instead of re-encoding it. Think of it like a copy and paste. No re-encoding, no lossy encoder involved, no generation loss, and your requirement of no quality loss is achieved.

Most players won't like 1 fps, so if that is the case change -framerate 1 to -framerate 10, or add the -r 10 output option.

1
  • This answer solves the problem I stated by copying the inputs directly together. I think it is worth mentioning that part of the issue I had was that I was comparing the video image in VLC media player with the default photo viewer and they are rendering the image differently. When I run the video in quicktime it is the same as the default photo viewer.
    – dinamix
    Commented Jun 10, 2020 at 0:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .