Using ffmpeg to copy metadata from one file to another
I want to use ffmpeg to copy all meta data not associated with core aspects of a video (frame rate, resolution) from one video to another. Is there a simple way to do this with a single command?
ffmpeg metadata
add a comment |
I want to use ffmpeg to copy all meta data not associated with core aspects of a video (frame rate, resolution) from one video to another. Is there a simple way to do this with a single command?
ffmpeg metadata
add a comment |
I want to use ffmpeg to copy all meta data not associated with core aspects of a video (frame rate, resolution) from one video to another. Is there a simple way to do this with a single command?
ffmpeg metadata
I want to use ffmpeg to copy all meta data not associated with core aspects of a video (frame rate, resolution) from one video to another. Is there a simple way to do this with a single command?
ffmpeg metadata
ffmpeg metadata
asked Nov 5 '15 at 2:53
DavidDavid
180126
180126
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Use -map_metadata
.
In this example the global and stream metadata will be copied from in0.mkv
. The video and audio streams will be stream copied from in1.mkv
:
ffmpeg -i in0.mkv -i in1.mkv -map 1 -c copy
# copies all global metadata from in0.mkv to out.mkv
-map_metadata 0
# copies video stream metadata from in0.mkv to out.mkv
-map_metadata:s:v 0:s:v
# copies audio stream metadata from in0.mkv to out.mkv
-map_metadata:s:a 0:s:a
out.mkv
This will result in something like:
Output #0, matroska, to 'out.mkv':
Metadata:
title : Global Title
AUTHOR : Global Author
Stream #0:0: Video: h264
Metadata:
title : Stream 0 Title
Stream #0:1: Audio: vorbis
Metadata:
title : Stream 1 Title
By default global metadata is copied from the first input file, so -map_metadata 0
could probably be omitted.
add a comment |
If all you need is the basics (creation date, etc), then
touch -r FILE1 FILE2
Will work as a charm coping metadata from FILE1 to FILE2
If you read the question, the objective is the video meta data, not the file meta data.
– fixer1234
Oct 27 '16 at 20:39
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f996223%2fusing-ffmpeg-to-copy-metadata-from-one-file-to-another%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use -map_metadata
.
In this example the global and stream metadata will be copied from in0.mkv
. The video and audio streams will be stream copied from in1.mkv
:
ffmpeg -i in0.mkv -i in1.mkv -map 1 -c copy
# copies all global metadata from in0.mkv to out.mkv
-map_metadata 0
# copies video stream metadata from in0.mkv to out.mkv
-map_metadata:s:v 0:s:v
# copies audio stream metadata from in0.mkv to out.mkv
-map_metadata:s:a 0:s:a
out.mkv
This will result in something like:
Output #0, matroska, to 'out.mkv':
Metadata:
title : Global Title
AUTHOR : Global Author
Stream #0:0: Video: h264
Metadata:
title : Stream 0 Title
Stream #0:1: Audio: vorbis
Metadata:
title : Stream 1 Title
By default global metadata is copied from the first input file, so -map_metadata 0
could probably be omitted.
add a comment |
Use -map_metadata
.
In this example the global and stream metadata will be copied from in0.mkv
. The video and audio streams will be stream copied from in1.mkv
:
ffmpeg -i in0.mkv -i in1.mkv -map 1 -c copy
# copies all global metadata from in0.mkv to out.mkv
-map_metadata 0
# copies video stream metadata from in0.mkv to out.mkv
-map_metadata:s:v 0:s:v
# copies audio stream metadata from in0.mkv to out.mkv
-map_metadata:s:a 0:s:a
out.mkv
This will result in something like:
Output #0, matroska, to 'out.mkv':
Metadata:
title : Global Title
AUTHOR : Global Author
Stream #0:0: Video: h264
Metadata:
title : Stream 0 Title
Stream #0:1: Audio: vorbis
Metadata:
title : Stream 1 Title
By default global metadata is copied from the first input file, so -map_metadata 0
could probably be omitted.
add a comment |
Use -map_metadata
.
In this example the global and stream metadata will be copied from in0.mkv
. The video and audio streams will be stream copied from in1.mkv
:
ffmpeg -i in0.mkv -i in1.mkv -map 1 -c copy
# copies all global metadata from in0.mkv to out.mkv
-map_metadata 0
# copies video stream metadata from in0.mkv to out.mkv
-map_metadata:s:v 0:s:v
# copies audio stream metadata from in0.mkv to out.mkv
-map_metadata:s:a 0:s:a
out.mkv
This will result in something like:
Output #0, matroska, to 'out.mkv':
Metadata:
title : Global Title
AUTHOR : Global Author
Stream #0:0: Video: h264
Metadata:
title : Stream 0 Title
Stream #0:1: Audio: vorbis
Metadata:
title : Stream 1 Title
By default global metadata is copied from the first input file, so -map_metadata 0
could probably be omitted.
Use -map_metadata
.
In this example the global and stream metadata will be copied from in0.mkv
. The video and audio streams will be stream copied from in1.mkv
:
ffmpeg -i in0.mkv -i in1.mkv -map 1 -c copy
# copies all global metadata from in0.mkv to out.mkv
-map_metadata 0
# copies video stream metadata from in0.mkv to out.mkv
-map_metadata:s:v 0:s:v
# copies audio stream metadata from in0.mkv to out.mkv
-map_metadata:s:a 0:s:a
out.mkv
This will result in something like:
Output #0, matroska, to 'out.mkv':
Metadata:
title : Global Title
AUTHOR : Global Author
Stream #0:0: Video: h264
Metadata:
title : Stream 0 Title
Stream #0:1: Audio: vorbis
Metadata:
title : Stream 1 Title
By default global metadata is copied from the first input file, so -map_metadata 0
could probably be omitted.
answered Nov 5 '15 at 6:27
lloganllogan
25.4k54679
25.4k54679
add a comment |
add a comment |
If all you need is the basics (creation date, etc), then
touch -r FILE1 FILE2
Will work as a charm coping metadata from FILE1 to FILE2
If you read the question, the objective is the video meta data, not the file meta data.
– fixer1234
Oct 27 '16 at 20:39
add a comment |
If all you need is the basics (creation date, etc), then
touch -r FILE1 FILE2
Will work as a charm coping metadata from FILE1 to FILE2
If you read the question, the objective is the video meta data, not the file meta data.
– fixer1234
Oct 27 '16 at 20:39
add a comment |
If all you need is the basics (creation date, etc), then
touch -r FILE1 FILE2
Will work as a charm coping metadata from FILE1 to FILE2
If all you need is the basics (creation date, etc), then
touch -r FILE1 FILE2
Will work as a charm coping metadata from FILE1 to FILE2
answered Oct 27 '16 at 20:12
EmilianoEmiliano
1
1
If you read the question, the objective is the video meta data, not the file meta data.
– fixer1234
Oct 27 '16 at 20:39
add a comment |
If you read the question, the objective is the video meta data, not the file meta data.
– fixer1234
Oct 27 '16 at 20:39
If you read the question, the objective is the video meta data, not the file meta data.
– fixer1234
Oct 27 '16 at 20:39
If you read the question, the objective is the video meta data, not the file meta data.
– fixer1234
Oct 27 '16 at 20:39
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f996223%2fusing-ffmpeg-to-copy-metadata-from-one-file-to-another%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown