Removing X seconds of video at beginning and end... in bulk

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
cwl77
Posts: 2
Joined: Sat Jul 22, 2017 9:53 pm

Removing X seconds of video at beginning and end... in bulk

Post by cwl77 »

Please detail your question or problem in as much detail as possible:
Need to remove X seconds from beginning and end of video, in bulk (many videos). I know I can do this via the GUI, one-by-one and add them to the queue, but is there an easier way, perhaps via commandline?

Tell us about your environment. What version of HandBrake? What version of Windows are you running. etc.
HandBrake 1.07, 640bit, W10.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Removing X seconds of video at beginning and end... in bulk

Post by Woodstock »

If the videos are all the same overall length, it is simple; you specify the offset to start with --start-at and how long to encode with --stop-at on the command line.

It's calculating those numbers that is a pain for random-length videos.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Removing X seconds of video at beginning and end... in bulk

Post by BradleyS »

Unless I'm mistaken, I think --stop-at is not required when using --start-at.
cwl77
Posts: 2
Joined: Sat Jul 22, 2017 9:53 pm

Re: Removing X seconds of video at beginning and end... in bulk

Post by cwl77 »

They aren't the same overall length........ but that gives me a good enough start methinks.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Removing X seconds of video at beginning and end... in bulk

Post by Woodstock »

Of course --stop-at isn't required if you're not cutting off the end. But to trim both ends, you do need the duration.

Personally, I wish the way it worked was the way people THINK it works, though; --stop-at is "how long to encode", not "where to stop" in the original.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Removing X seconds of video at beginning and end... in bulk

Post by BradleyS »

Ah, I missed beginning and end. Another way to do it would be to parse the duration in the script and act on it. Yet another would be to use an intermediate lossless file, do the beginning cut first and and cut on the intermediate.
Post Reply