使用以下代码,使用FFMPEG将来自Python管道的原始视频转换为udp流:
command = [ 'ffmpeg',
'-y', # (optional) overwrite output file if it exists
'-r', '25', # frames per second
'-i', '-', # The imput comes from a pipe
'-an', # Tells FFMPEG not to expect any audio
'-r', '25',
'-c:v', 'copy',
'-f', 'mpegts',
'udp://ip:port'
]
devl = open(os.devnull, 'w')
file_name = '/tmp/file.txt'
err1 = open(file_name, 'w')
pipe = sp.Popen( command, stdin=sp.PIPE, stdout=devl, stderr=err1)
但是当音频流也进入相同的python管道时,我应该如何更改程序以将音频和视频流都转换为udp流。