Ad

Can't Save Metadata When Convert Video Files Using Python Ffmpeg

- 1 answer

I tried to us ffmpy library to convert .MOV files into .MP4. Converting works well, but I can't save metadata like title and artist.

ff = ffmpy.FFmpeg(
    inputs={'input.mov': None},
    outputs={'output.mp4': None},
    global_options=[
        '-metadata name=james',
        '-metadata artist=Beauty and Beast'
    ]
)

ff.run()
Ad

Answer

You have to change output file options.

ff = ffmpy.FFmpeg(
    inputs={'input.mov': None},
    outputs={'output.mp4': [
        '-metadata', 'artist=james',
        '-metadata', 'title=Beauty and Beast'
    ]},
)

ff.run()
Ad
source: stackoverflow.com
Ad