

It is fast, taking less than a second on SSD.įfmpeg -i input.mp4 -map_metadata 0 -metadata:s:v rotate="90" -codec copy output.mp4 The recommended way is to set rotation meta data. To watch the video in correct direction, you can rotate it with ffmpeg. Some cameras, lacking G sensors, cannot automatically rotate captured video.

-map 1:a:0: use #1 (second) file's #0 (first) audio track.-map 0:v:0: use #0 (first) file's #0 (first) video track.-c:v copy: copy video, without re-encoding.-c copy: copy both audio and video, without re-encoding.If the video already has audio but you want to replace it:įfmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4 If you have a video file without sound and an audio file, and you don't want to re-encode anything:įfmpeg -i video.mp4 -i audio.mp3 -c copy output.mp4įfmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac output.mp4 Installation sudo zypper install ffmpeg-4
