ozmartian / vidcutter

A modern yet simple multi-platform video cutter and joiner.
GNU General Public License v3.0
1.78k stars 135 forks source link

Can't save media without audio #278

Open cyansprite opened 4 years ago

cyansprite commented 4 years ago

vidcutter/libs/videoservice.py

acodec = re.search(r'Stream.*Audio:\s(\w+)', result).group(1)

re.search returns a NoneType, this will make .group(1) throw an exception thus never saving the video.

You can get it to save the video by removing this line and returning something else if you build it manually, I recommend a more graceful approach in the future.

ericjrich commented 1 year ago

I had a Video with no sound. My bandaid was the code below. ffmpeg -f lavfi -i aevalsrc=0 -i input.mp4 -c:v copy -c:a aac -map 0 -map 1:v -shortest output.mp4