0

I have many hundreds of videos in two versions. One version is low quality video with a desired audio. The other version has high quality video but undesired audio. I would like to combine the HQ video of one with the desired audio of another by writing an openCV python script to automate this whole thing. How do I do this.

Danny
  • 9
  • 2

2 Answers2

1

You'd probably be better off doing this with ffmpeg. I can't test the command myself now, but this should work:

ffmpeg -i video_hiqal.mp4 -i video_lowqal.mp4 -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 output.mp4

Basically, ffmpeg will receive both video streams in input and, thanks to the map option, it'll use video from the first stream and audio from the second stream.

filaton
  • 2,021
  • 12
  • 21
1

I guess you might want to consider the idea of ripping the audio off the clearer sounding video and attaching it to the one which has better visual quality and in that case, these links to will help you get the direct methods:

Combining an audio file with video file in python

Python extract wav from video file

Dev_Man
  • 780
  • 1
  • 9
  • 24