I have a code that takes in a video then constructs a list of frames from that video. then does something with each frame then put the frames back together into cv2 video writer. However, when the video is constructed again, it loses all its audio.
I have a code that takes in a video then constructs a list of frames from that video. then does something with each frame then put the frames back together into cv2 video writer. However, when the video is constructed again, it loses all its audio.
Stephen Meschke is right ! Use FFMPEG to extract and import audio. Type in cmd:
ffmpeg -i yourvideo.avi -f mp3 -ab 192000 -vn sound.mp3
ffmpeg -i yourvideo.avi -i sound.mp3 -c copy -map 0:v:0 -map 1:a:0 output.avi