diff --git a/ffmpeg.c b/ffmpeg.c
index 5d882446475f00439c5f36bc64b321e8e2474dee..5e3f1d3afe3e5e16093708ae8d739b16cbf8c7d7 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2193,7 +2193,7 @@ static int av_transcode(AVFormatContext **output_files,
 
         mtag=NULL;
         while((mtag=av_metadata_get(in_file->metadata, "", mtag, AV_METADATA_IGNORE_SUFFIX)))
-            av_metadata_set(&out_file->metadata, mtag->key, mtag->value);
+            av_metadata_set2(&out_file->metadata, mtag->key, mtag->value, AV_METADATA_DONT_OVERWRITE);
         av_metadata_conv(out_file, out_file->oformat->metadata_conv,
                                     in_file->iformat->metadata_conv);
     }