I'm trying to make a video with an overlay video inside (PiP) but I can't get the sound source right, I need the sound from the underlay video but I keep getting the sound from the overlay video.
I don't have very much experience with or knowledge of ffmpeg, but after some searching around on the internet I found some ffmpeg commands and managed to put the following command together:
ffmpeg.exe -itsoffset 35 -i overlay-race-replay.mp4 -i underlay-race-live.mp4 -filter_complex "scale=700:-1 [overlay]; [overlay] overlay=main_w-overlay_w-30:30:enable='between(t,35,552)'" -profile:v high -level 4.1 -ar 44100 -ab 128k -s 1920x1080 -vcodec h264 -acodec libmp3lame output.mp4
It works great to create a video with an overlay video in it which shows up and starts at 35 seconds and ends and disappears somewhere before the underlay video ends which is just what I want.
Only the problem is the sound! In the output file you only hear the sound from the overlay video, and I want to keep the sound from the underlay video.
Does anyone know how to do this right? What I need is, overlay-race-replay.mp4 resized to a width of 700 with kept ratio, inside underlay-race-live.mp4, showing up after 35 seconds, placed in the top right corner with about 30 pixels margin and only the sound of underlay-race-live.mp4
I would be very grateful for a solution, I think I've injured my brain in the documentations of ffmpeg I really can't make anything of it, it's like algebra to me.