ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

Can't set multiple metadata values

Open Nightingale13 opened this issue 5 years ago • 4 comments

I believe I found an issue where the metadata key doesn't allow multiple values. You can find the supported metadata keys for movs HERE

This code works to store a single value of any of the linked metadata keys.

stream = ffmpeg.input(in_file)
stream = ffmpeg.output(
	stream,
	out_file,
	vcodec="h264",
	f="mov",
	pix_fmt="yuv420p",
	metadata="author=Nightingale"
)
stream = ffmpeg.overwrite_output(stream)
ffmpeg.run(stream)

But adding more than one metadata value doesn't work. In fact, the entire string is added as a single metadata value.

stream = ffmpeg.input(in_file)
stream = ffmpeg.output(
	stream,
	out_file,
	vcodec="h264",
	f="mov",
	pix_fmt="yuv420p",
	metadata="author=Nightingale show=MyShow"
)
stream = ffmpeg.overwrite_output(stream)
ffmpeg.run(stream)

Any ideas? metadata

Nightingale13 avatar Jun 13 '20 00:06 Nightingale13

Hi! I couldn't even add one metadata let alone multiple. This should definitely be a feature.

Here is the code that I tried.

process = (
    ffmpeg
        .input('pipe:', format='rawvideo', s='{}x{}'.format(width, height))
        .output("test_out.mkv", r='30/1', metadata='author=Nightingale')
        .overwrite_output()
        .run_async(pipe_stdin=True)
)
process.communicate(input=video_buffer)

I'd be glad if you had any suggestions.

RashiqAzhan avatar Mar 19 '21 12:03 RashiqAzhan

I'm having the same issue. I tried the solution described in this issue; however only the first metadata argument actually works.

For example, when I run this line:

ffmpeg.output(aud, vid, output_title, **{'metadata:g:0':'title=mytitle', 'metadata:g:1':'subtitle=mysubtitle'})

The first piece of metadata (title) is set, but the second (subtitle) is ignored completely. I've tried this with different types of metadata, and the result is the same: only the first one works.

R-Olivaw avatar Sep 10 '21 00:09 R-Olivaw

I'm having the same issue

streamingcommunity avatar Sep 23 '21 20:09 streamingcommunity

same issue

yyearth avatar Nov 16 '24 15:11 yyearth

Looks like #112 might be the solution.

kenwuuu avatar Feb 23 '25 19:02 kenwuuu