1

I have used a function in python to convert video formats using Imageio and it is working, but the audio in the output video is removed during conversion, is there any way to put the audio back in the output video?

    import Imageio
    import os
    def Convertor(inputpath,targetformat):
        try:
            outputpath=os.path.splitext(inputpath)[0]+'_converted'+targetformat
            print(f'Converting {inputpath} to {outputpath}')
            reader=imageio.get_reader(inputpath)
            fps=reader.get_meta_data()['fps']
            writer=imageio.get_writer(outputpath, fps=fps)

            for frames in reader:
                writer.append_data(frames)
                print(f'Frame {frames}')
        print("work done")
        writer.close()
Akascape
  • 219
  • 2
  • 11
  • Not at the moment, no. ImageIO currently only supports reading and writing of video containers, as its primary focus is on reading and writing images. – FirefoxMetzger Feb 09 '22 at 19:11

0 Answers0