FFMPEG to trim off last 3 seconds of videosCut video with ffmpeg.Rotating videos with FFmpegFFmpeg converted mp4 file fails to load in QuicktimeCutting the videos based on start and end time using ffmpegBest approach to real time http streaming to HTML5 video clientFFmpeg - How to trim with high precision?ffmpeg is cutting video length incorrectlyHow to trim the video with start & end time in android programmatically?How to cut off 5 seconds after every 28 seconds and loop with ffmpeg?FFmpeg Concatenate multiple videos with crossfadeFFMPEG zoompan filter cut short my video and slowed it down
Why do all the teams that I have worked with always finish a sprint without completion of all the stories?
Sci fi short story, robot city that nags people about health
Impossible darts scores
Fedora boot screen shows both Fedora logo and Lenovo logo. Why and How?
STM Microcontroller burns every time
What's currently blocking the construction of the wall between Mexico and the US?
Trainee keeps missing deadlines for independent learning
What does "play with your toy’s toys" mean?
Does Marvel have an equivalent of the Green Lantern?
How long would it take to cross the Channel in 1890's?
Why did pressing the joystick button spit out keypresses?
Is it possible writing coservation of relativistic energy in this naive way?
How does a blind passenger not die, if driver becomes unconscious
What reason would an alien civilization have for building a Dyson Sphere (or Swarm) if cheap Nuclear fusion is available?
What is the mechanical difference between the Spectator's Create Food and Water action and the Banshee's Undead Nature Trait?
Suggested order for Amazon Prime Doctor Who series
Employer wants to use my work email account after I quit
Can Ogre clerics use Purify Food and Drink on humanoid characters?
How dangerous are set-size assumptions?
If I wouldn't want to read the story, is writing it still a good idea?
How risky is real estate?
Did Karl Marx ever use any example that involved cotton and dollars to illustrate the way capital and surplus value were generated?
If the world have massive single giant world tree can it stop earthquake?
Is a single radon-daughter atom in air a solid?
FFMPEG to trim off last 3 seconds of videos
Cut video with ffmpeg.Rotating videos with FFmpegFFmpeg converted mp4 file fails to load in QuicktimeCutting the videos based on start and end time using ffmpegBest approach to real time http streaming to HTML5 video clientFFmpeg - How to trim with high precision?ffmpeg is cutting video length incorrectlyHow to trim the video with start & end time in android programmatically?How to cut off 5 seconds after every 28 seconds and loop with ffmpeg?FFmpeg Concatenate multiple videos with crossfadeFFMPEG zoompan filter cut short my video and slowed it down
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to trim/cut off the last 3 secs of my videos with FFMPEG but this has really been an headache.
The following code trims but only retains the last 3 seconds.
I don't want to retain the 3 secs, i don't need that, i want to retain the deleted part.
ffmpeg -sseof -3 -i input.mp4 output.mp4
Can someone please help me with the right code?.
I will also like to request a batch code that will auto trim all last 3 secs of videos in my folder.
Thanks for the help.
video ffmpeg
add a comment |
I am trying to trim/cut off the last 3 secs of my videos with FFMPEG but this has really been an headache.
The following code trims but only retains the last 3 seconds.
I don't want to retain the 3 secs, i don't need that, i want to retain the deleted part.
ffmpeg -sseof -3 -i input.mp4 output.mp4
Can someone please help me with the right code?.
I will also like to request a batch code that will auto trim all last 3 secs of videos in my folder.
Thanks for the help.
video ffmpeg
add a comment |
I am trying to trim/cut off the last 3 secs of my videos with FFMPEG but this has really been an headache.
The following code trims but only retains the last 3 seconds.
I don't want to retain the 3 secs, i don't need that, i want to retain the deleted part.
ffmpeg -sseof -3 -i input.mp4 output.mp4
Can someone please help me with the right code?.
I will also like to request a batch code that will auto trim all last 3 secs of videos in my folder.
Thanks for the help.
video ffmpeg
I am trying to trim/cut off the last 3 secs of my videos with FFMPEG but this has really been an headache.
The following code trims but only retains the last 3 seconds.
I don't want to retain the 3 secs, i don't need that, i want to retain the deleted part.
ffmpeg -sseof -3 -i input.mp4 output.mp4
Can someone please help me with the right code?.
I will also like to request a batch code that will auto trim all last 3 secs of videos in my folder.
Thanks for the help.
video ffmpeg
video ffmpeg
asked Mar 25 at 9:40
humble5050humble5050
6
6
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I don't think ffmpeg allows a "from end" spec for duration. You'll have to detect the video's duration yourself and subtract 3 seconds.
ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0"
You can do this in a script. For example in bash:
dur=$(ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0")
trim=$((dur - 3))
ffmpeg -t $trim -i input.mp4 output.mp4
Thank you for your response, but unfortunately, i am on a windows PC, can u tell me how to run that on windows PC?
– humble5050
Mar 25 at 12:15
I'd think Windows batch also allows you to store the output of a command and perform arithmetic. Just replace the $(...) stuff with the appropriate syntax.
– L. Scott Johnson
Mar 25 at 12:17
(In general, StackOverflow is a question-answering platform, not a code-writing service.)
– L. Scott Johnson
Mar 25 at 12:19
add a comment |
Cut video with ffmpeg.
use
ffmpeg -i input.mp4 -ss 3 -i input.mp4 -c copy -map 1:0 -map 0 -shortest -f nut - | ffmpeg -f nut -i - -map 0 -map -0:0 -c copy out.mp4
This is the same as doingffmpeg -i input.mp4 -ss 3 -c copy output.mp4
. However, this removes the tail of the video, but humble5050 wants to keep that part only.
– llogan
Mar 26 at 17:07
Thanks nico_lab,,,this is exactly what i am looking for...u r awesome
– humble5050
Mar 27 at 18:59
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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%2fstackoverflow.com%2fquestions%2f55334909%2fffmpeg-to-trim-off-last-3-seconds-of-videos%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
I don't think ffmpeg allows a "from end" spec for duration. You'll have to detect the video's duration yourself and subtract 3 seconds.
ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0"
You can do this in a script. For example in bash:
dur=$(ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0")
trim=$((dur - 3))
ffmpeg -t $trim -i input.mp4 output.mp4
Thank you for your response, but unfortunately, i am on a windows PC, can u tell me how to run that on windows PC?
– humble5050
Mar 25 at 12:15
I'd think Windows batch also allows you to store the output of a command and perform arithmetic. Just replace the $(...) stuff with the appropriate syntax.
– L. Scott Johnson
Mar 25 at 12:17
(In general, StackOverflow is a question-answering platform, not a code-writing service.)
– L. Scott Johnson
Mar 25 at 12:19
add a comment |
I don't think ffmpeg allows a "from end" spec for duration. You'll have to detect the video's duration yourself and subtract 3 seconds.
ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0"
You can do this in a script. For example in bash:
dur=$(ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0")
trim=$((dur - 3))
ffmpeg -t $trim -i input.mp4 output.mp4
Thank you for your response, but unfortunately, i am on a windows PC, can u tell me how to run that on windows PC?
– humble5050
Mar 25 at 12:15
I'd think Windows batch also allows you to store the output of a command and perform arithmetic. Just replace the $(...) stuff with the appropriate syntax.
– L. Scott Johnson
Mar 25 at 12:17
(In general, StackOverflow is a question-answering platform, not a code-writing service.)
– L. Scott Johnson
Mar 25 at 12:19
add a comment |
I don't think ffmpeg allows a "from end" spec for duration. You'll have to detect the video's duration yourself and subtract 3 seconds.
ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0"
You can do this in a script. For example in bash:
dur=$(ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0")
trim=$((dur - 3))
ffmpeg -t $trim -i input.mp4 output.mp4
I don't think ffmpeg allows a "from end" spec for duration. You'll have to detect the video's duration yourself and subtract 3 seconds.
ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0"
You can do this in a script. For example in bash:
dur=$(ffprobe -i input.mp4 -show_entries format=duration -v quiet -of csv="p=0")
trim=$((dur - 3))
ffmpeg -t $trim -i input.mp4 output.mp4
answered Mar 25 at 11:56
L. Scott JohnsonL. Scott Johnson
2,0478 silver badges14 bronze badges
2,0478 silver badges14 bronze badges
Thank you for your response, but unfortunately, i am on a windows PC, can u tell me how to run that on windows PC?
– humble5050
Mar 25 at 12:15
I'd think Windows batch also allows you to store the output of a command and perform arithmetic. Just replace the $(...) stuff with the appropriate syntax.
– L. Scott Johnson
Mar 25 at 12:17
(In general, StackOverflow is a question-answering platform, not a code-writing service.)
– L. Scott Johnson
Mar 25 at 12:19
add a comment |
Thank you for your response, but unfortunately, i am on a windows PC, can u tell me how to run that on windows PC?
– humble5050
Mar 25 at 12:15
I'd think Windows batch also allows you to store the output of a command and perform arithmetic. Just replace the $(...) stuff with the appropriate syntax.
– L. Scott Johnson
Mar 25 at 12:17
(In general, StackOverflow is a question-answering platform, not a code-writing service.)
– L. Scott Johnson
Mar 25 at 12:19
Thank you for your response, but unfortunately, i am on a windows PC, can u tell me how to run that on windows PC?
– humble5050
Mar 25 at 12:15
Thank you for your response, but unfortunately, i am on a windows PC, can u tell me how to run that on windows PC?
– humble5050
Mar 25 at 12:15
I'd think Windows batch also allows you to store the output of a command and perform arithmetic. Just replace the $(...) stuff with the appropriate syntax.
– L. Scott Johnson
Mar 25 at 12:17
I'd think Windows batch also allows you to store the output of a command and perform arithmetic. Just replace the $(...) stuff with the appropriate syntax.
– L. Scott Johnson
Mar 25 at 12:17
(In general, StackOverflow is a question-answering platform, not a code-writing service.)
– L. Scott Johnson
Mar 25 at 12:19
(In general, StackOverflow is a question-answering platform, not a code-writing service.)
– L. Scott Johnson
Mar 25 at 12:19
add a comment |
Cut video with ffmpeg.
use
ffmpeg -i input.mp4 -ss 3 -i input.mp4 -c copy -map 1:0 -map 0 -shortest -f nut - | ffmpeg -f nut -i - -map 0 -map -0:0 -c copy out.mp4
This is the same as doingffmpeg -i input.mp4 -ss 3 -c copy output.mp4
. However, this removes the tail of the video, but humble5050 wants to keep that part only.
– llogan
Mar 26 at 17:07
Thanks nico_lab,,,this is exactly what i am looking for...u r awesome
– humble5050
Mar 27 at 18:59
add a comment |
Cut video with ffmpeg.
use
ffmpeg -i input.mp4 -ss 3 -i input.mp4 -c copy -map 1:0 -map 0 -shortest -f nut - | ffmpeg -f nut -i - -map 0 -map -0:0 -c copy out.mp4
This is the same as doingffmpeg -i input.mp4 -ss 3 -c copy output.mp4
. However, this removes the tail of the video, but humble5050 wants to keep that part only.
– llogan
Mar 26 at 17:07
Thanks nico_lab,,,this is exactly what i am looking for...u r awesome
– humble5050
Mar 27 at 18:59
add a comment |
Cut video with ffmpeg.
use
ffmpeg -i input.mp4 -ss 3 -i input.mp4 -c copy -map 1:0 -map 0 -shortest -f nut - | ffmpeg -f nut -i - -map 0 -map -0:0 -c copy out.mp4
Cut video with ffmpeg.
use
ffmpeg -i input.mp4 -ss 3 -i input.mp4 -c copy -map 1:0 -map 0 -shortest -f nut - | ffmpeg -f nut -i - -map 0 -map -0:0 -c copy out.mp4
answered Mar 26 at 14:06
nico_labnico_lab
5044 silver badges7 bronze badges
5044 silver badges7 bronze badges
This is the same as doingffmpeg -i input.mp4 -ss 3 -c copy output.mp4
. However, this removes the tail of the video, but humble5050 wants to keep that part only.
– llogan
Mar 26 at 17:07
Thanks nico_lab,,,this is exactly what i am looking for...u r awesome
– humble5050
Mar 27 at 18:59
add a comment |
This is the same as doingffmpeg -i input.mp4 -ss 3 -c copy output.mp4
. However, this removes the tail of the video, but humble5050 wants to keep that part only.
– llogan
Mar 26 at 17:07
Thanks nico_lab,,,this is exactly what i am looking for...u r awesome
– humble5050
Mar 27 at 18:59
This is the same as doing
ffmpeg -i input.mp4 -ss 3 -c copy output.mp4
. However, this removes the tail of the video, but humble5050 wants to keep that part only.– llogan
Mar 26 at 17:07
This is the same as doing
ffmpeg -i input.mp4 -ss 3 -c copy output.mp4
. However, this removes the tail of the video, but humble5050 wants to keep that part only.– llogan
Mar 26 at 17:07
Thanks nico_lab,,,this is exactly what i am looking for...u r awesome
– humble5050
Mar 27 at 18:59
Thanks nico_lab,,,this is exactly what i am looking for...u r awesome
– humble5050
Mar 27 at 18:59
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f55334909%2fffmpeg-to-trim-off-last-3-seconds-of-videos%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