I am working on a video editing project which edits the original video and creates a new file I got stuck becuse there is no sound in the new file which the software creates. So I want to copy the sound from the original file and paste it into the new file (I have video in the new file, but the video file doesn't have any sound - I want to get sound from the original file and use this sound in my new file)
Any ideas?
Here is my video editing script:
import io, re, requests
from PIL import Image, ImageOps, ImageEnhance, ImageChops
import cv2
import numpy as np
cap = cv2.VideoCapture('original.mp4')
fps = cap.get(cv2.CAP_PROP_FPS)
frame_width = int(cap.get(3))
frame_height = int(cap.get(4))
size = (frame_width, frame_height)
result = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc(*'MJPG'), fps,size)
while cap.isOpened():
ret,frame = cap.read()
#editing part
result.write(edited_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()