在python中组合音频文件和视频文件 [英] Combining an audio file with video file in python

查看:3555
本文介绍了在python中组合音频文件和视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



音频文件的格式为WAVE
VIdeo文件的格式是h264



音频和视频已经在同一时间成功录制和创建,我只需要合并它们。



你能指导我怎么做吗?

解决方案

我得到了我的问题,你也可以尝试,让我知道如果需要进一步的帮助

  cmd ='ffmpeg -y -i音频。 wav -r 30 -i Video.h264 -filter:a aresample = async = 1 -c:a flac -c:v copy av.mkv'
subprocess.call(cmd,shell = True)#Muxing Done
print('Muxing Done')


I am writing a program in Python on RaspberryPi(Raspbian), to combine / merge an audio file with video file.

Format of Audio file is WAVE Format of VIdeo file is h264

Audio and video already recorded and created at same time successfully, I just need to merge them now.

Can you please guide me on how do I do that?

解决方案

I got the answer of my Question, you can also try it and let me know if need further assistance

cmd = 'ffmpeg -y -i Audio.wav  -r 30 -i Video.h264  -filter:a aresample=async=1 -c:a flac -c:v copy av.mkv'
subprocess.call(cmd, shell=True)                                     # "Muxing Done
print('Muxing Done')

这篇关于在python中组合音频文件和视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆