ffmpeg – adding audio to video without knowing length of either
I am trying to replace the audio in the video, but I do not know the duration of the video. I only know the duration of the audio.
What ffmpeg command should I use so that audio gets repeated to full length of video if video is longer?
But if video is shorter than audio, then either video can be repeated or audio can be cut short, either is ok.
Is it possible to achieve that using a single command, without worrying about durations, not having to change commands depending on audio/video lengths?
Currently I know this command below, but in this case the longer video gets cut short. I don’t want that.
ffmpeg -i video.mp4 -i audio.mp3 -map 0:v -map 1:a -c:v copy -c:a copy -shortest output.mp4
Read more here: Source link