How to discard a part of a MP4 with ffmpeg
Is there a way to slice out a 5 minute portion of an MP4 file with ffmpeg?
My attempt at running the following gives me the section I want to remove in hateley2.mp4
.
ffmpeg -ss 01:02:00.000 -i hateley.mp4 -t 00:05:00.000 -c copy hateley2.mp4
Is there a way I can turn hateley2.mp4
into hateley.mp4
without that 5 minute section from 1hr 2min that I wish to remove?
macos command-line video ffmpeg video-conversion
add a comment |
Is there a way to slice out a 5 minute portion of an MP4 file with ffmpeg?
My attempt at running the following gives me the section I want to remove in hateley2.mp4
.
ffmpeg -ss 01:02:00.000 -i hateley.mp4 -t 00:05:00.000 -c copy hateley2.mp4
Is there a way I can turn hateley2.mp4
into hateley.mp4
without that 5 minute section from 1hr 2min that I wish to remove?
macos command-line video ffmpeg video-conversion
What's your tolerance for keeping a part of the 5 minute portion at both ends or removing a bit extra?
– Gyan
Dec 19 '18 at 12:51
add a comment |
Is there a way to slice out a 5 minute portion of an MP4 file with ffmpeg?
My attempt at running the following gives me the section I want to remove in hateley2.mp4
.
ffmpeg -ss 01:02:00.000 -i hateley.mp4 -t 00:05:00.000 -c copy hateley2.mp4
Is there a way I can turn hateley2.mp4
into hateley.mp4
without that 5 minute section from 1hr 2min that I wish to remove?
macos command-line video ffmpeg video-conversion
Is there a way to slice out a 5 minute portion of an MP4 file with ffmpeg?
My attempt at running the following gives me the section I want to remove in hateley2.mp4
.
ffmpeg -ss 01:02:00.000 -i hateley.mp4 -t 00:05:00.000 -c copy hateley2.mp4
Is there a way I can turn hateley2.mp4
into hateley.mp4
without that 5 minute section from 1hr 2min that I wish to remove?
macos command-line video ffmpeg video-conversion
macos command-line video ffmpeg video-conversion
asked Dec 19 '18 at 11:03
crmpiccocrmpicco
1953415
1953415
What's your tolerance for keeping a part of the 5 minute portion at both ends or removing a bit extra?
– Gyan
Dec 19 '18 at 12:51
add a comment |
What's your tolerance for keeping a part of the 5 minute portion at both ends or removing a bit extra?
– Gyan
Dec 19 '18 at 12:51
What's your tolerance for keeping a part of the 5 minute portion at both ends or removing a bit extra?
– Gyan
Dec 19 '18 at 12:51
What's your tolerance for keeping a part of the 5 minute portion at both ends or removing a bit extra?
– Gyan
Dec 19 '18 at 12:51
add a comment |
1 Answer
1
active
oldest
votes
There probably is a 1-step ffmpeg
command to do this, but I always approach it like this:
- Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.
- Perform another extract operation, starting at 1:07:00 thru the end of the film (I think you just leave the duration off to get thru the end).
- Merge the 2 pieces together like the following:
Merge example:
echo 1.mp4 > merge.txt
echo 2.mp4 >> merge.txt
ffmpeg -f concat -safe 0 -i merge.txt -c copy merged.mp4
If you have more than one audio track in the file(s), you might need a more complicated merge like:
ffmpeg -f concat -i merge.txt -map 0:0 -map 0:1 -map 0:2 -c copy merged.mp4
@crmpicco, did this help?
– jimtut
Jan 3 at 16:56
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%2f1385882%2fhow-to-discard-a-part-of-a-mp4-with-ffmpeg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There probably is a 1-step ffmpeg
command to do this, but I always approach it like this:
- Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.
- Perform another extract operation, starting at 1:07:00 thru the end of the film (I think you just leave the duration off to get thru the end).
- Merge the 2 pieces together like the following:
Merge example:
echo 1.mp4 > merge.txt
echo 2.mp4 >> merge.txt
ffmpeg -f concat -safe 0 -i merge.txt -c copy merged.mp4
If you have more than one audio track in the file(s), you might need a more complicated merge like:
ffmpeg -f concat -i merge.txt -map 0:0 -map 0:1 -map 0:2 -c copy merged.mp4
@crmpicco, did this help?
– jimtut
Jan 3 at 16:56
add a comment |
There probably is a 1-step ffmpeg
command to do this, but I always approach it like this:
- Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.
- Perform another extract operation, starting at 1:07:00 thru the end of the film (I think you just leave the duration off to get thru the end).
- Merge the 2 pieces together like the following:
Merge example:
echo 1.mp4 > merge.txt
echo 2.mp4 >> merge.txt
ffmpeg -f concat -safe 0 -i merge.txt -c copy merged.mp4
If you have more than one audio track in the file(s), you might need a more complicated merge like:
ffmpeg -f concat -i merge.txt -map 0:0 -map 0:1 -map 0:2 -c copy merged.mp4
@crmpicco, did this help?
– jimtut
Jan 3 at 16:56
add a comment |
There probably is a 1-step ffmpeg
command to do this, but I always approach it like this:
- Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.
- Perform another extract operation, starting at 1:07:00 thru the end of the film (I think you just leave the duration off to get thru the end).
- Merge the 2 pieces together like the following:
Merge example:
echo 1.mp4 > merge.txt
echo 2.mp4 >> merge.txt
ffmpeg -f concat -safe 0 -i merge.txt -c copy merged.mp4
If you have more than one audio track in the file(s), you might need a more complicated merge like:
ffmpeg -f concat -i merge.txt -map 0:0 -map 0:1 -map 0:2 -c copy merged.mp4
There probably is a 1-step ffmpeg
command to do this, but I always approach it like this:
- Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.
- Perform another extract operation, starting at 1:07:00 thru the end of the film (I think you just leave the duration off to get thru the end).
- Merge the 2 pieces together like the following:
Merge example:
echo 1.mp4 > merge.txt
echo 2.mp4 >> merge.txt
ffmpeg -f concat -safe 0 -i merge.txt -c copy merged.mp4
If you have more than one audio track in the file(s), you might need a more complicated merge like:
ffmpeg -f concat -i merge.txt -map 0:0 -map 0:1 -map 0:2 -c copy merged.mp4
answered Dec 20 '18 at 16:09
jimtutjimtut
658513
658513
@crmpicco, did this help?
– jimtut
Jan 3 at 16:56
add a comment |
@crmpicco, did this help?
– jimtut
Jan 3 at 16:56
@crmpicco, did this help?
– jimtut
Jan 3 at 16:56
@crmpicco, did this help?
– jimtut
Jan 3 at 16:56
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%2f1385882%2fhow-to-discard-a-part-of-a-mp4-with-ffmpeg%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
What's your tolerance for keeping a part of the 5 minute portion at both ends or removing a bit extra?
– Gyan
Dec 19 '18 at 12:51