Resolve visual artifacts and aspect ratio distortion when combining media with different resolutions by using FFmpeg scaling and padding filters.