How to discard a part of a MP4 with ffmpeg












0















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?










share|improve this question























  • 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
















0















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?










share|improve this question























  • 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














0












0








0








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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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



















  • 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










1 Answer
1






active

oldest

votes


















0














There probably is a 1-step ffmpeg command to do this, but I always approach it like this:




  1. Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.

  2. 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).

  3. 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





share|improve this answer
























  • @crmpicco, did this help?

    – jimtut
    Jan 3 at 16:56











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
});


}
});














draft saved

draft discarded


















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









0














There probably is a 1-step ffmpeg command to do this, but I always approach it like this:




  1. Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.

  2. 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).

  3. 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





share|improve this answer
























  • @crmpicco, did this help?

    – jimtut
    Jan 3 at 16:56
















0














There probably is a 1-step ffmpeg command to do this, but I always approach it like this:




  1. Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.

  2. 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).

  3. 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





share|improve this answer
























  • @crmpicco, did this help?

    – jimtut
    Jan 3 at 16:56














0












0








0







There probably is a 1-step ffmpeg command to do this, but I always approach it like this:




  1. Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.

  2. 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).

  3. 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





share|improve this answer













There probably is a 1-step ffmpeg command to do this, but I always approach it like this:




  1. Perform an extract operation like you're doing, but extract from the original, starting at time 0:00 and up to 1:02:00.

  2. 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).

  3. 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






share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 20 '18 at 16:09









jimtutjimtut

658513




658513













  • @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





@crmpicco, did this help?

– jimtut
Jan 3 at 16:56


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Plaza Victoria

In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...