rinofcan
rinofcan

Reputation: 343

Merge 2 video use ffmpeg but i want

I have two videos of different lengths Video one: 12 minutes Video two: 6 minutes I want to take audio of video one I want to take image of video two And put them together Output video length = 6 minutes. Use ffmpeg one command please help me - thanks ( watch image )____

enter image description here

Upvotes: 1

Views: 484

Answers (1)

Gyan
Gyan

Reputation: 93369

Use

ffmpeg -i 12m.mp4 -i 6m.mp4 -vf setpts=(PTS-STARTPTS)/1.1 -af atempo=1.1 -map 1:v -map 0:a -shortest new.mp4

The setpts filter alters the video frame timestamps to 1/1.1 of their present value. FFmpeg will drop frames in the cadence needed to preserve source framerate.

The atempo filter speeds up the audio to 1.1 times the original speed.

-map 1:v -map 0:a tells ffmpeg to include the video stream from the 2nd input (6m.mp4) and the audio from the first input.

-shortest tells ffmpeg to conclude conversion when the shorter (of the audio and video) stream ends.

Upvotes: 1

Related Questions