How to edit metadata using ffmpeg-python?

159 views Asked by At
import ffmpeg
input= "input.mkv"
output = "output.mkv"
title = "Clinton Abraham"

try:
    datas = 'title=' + title
    mains = ffmpeg.input(input)
    nemos = mains.output(output, map="0", metadata=datas, c="copy")
    nemos.run(quiet=True)
    print("METADATA MODIFIED ✅")
except ffmpeg.Error as e:
    print(e.stderr.decode('utf-8'))

Now how to edit -metadata:s:v, -metadata:s:a , -metadata:s:s

1

There are 1 answers

1
Clinton Abraham On BEST ANSWER
import time
import ffmpeg

inputs = "Sample video.mkv"

output = str(round(time.time())) + ".mkv"

datas = {"metadata":"title=Clinton Abraham"}
datas.update({"metadata:s:a":"description="})
datas.update({"metadata:":"comment=TELEGRAM > @DC4_WARRIOR"})

try:
    main = ffmpeg.input(inputs)
    nemo = main.output(output, map="0", **datas, c="copy")
    nemo.run(quiet=True)
    print("PROCESSED SUCCESSFULLY ⚡")
except ffmpeg.Error as e:
    print(e.stderr.decode('utf-8'))