Skip to main content
Inspiring
March 28, 2018
Answered

anyway to trim mp4 clips without encoding again?

  • March 28, 2018
  • 3 replies
  • 31671 views

Is there a program I can use that can take an existing .mp4 file and trim start and end times and overwrite the file without re encoding it to maintain the quality? I was given some .mp4 footage to edit and the customer wants me to trim the clips up for him but not lose quality and he wants to retain similar file size and does not want it to be in another format.

thanks

This topic has been closed for replies.
Correct answer R Neil Haugen

Yea, if you need a precise trim, you can only do that with re-encoding. I would suggest doing so by cutting in PrPro, then exporting directly to the file type needed for the deliverable, that extra transcode step would only add a (slight) degradation and raise the time required.

Neil

3 replies

Participating Frequently
December 29, 2020

To trim an MP4 clip without re-encoding, I think you might as well try Joyoshare Video Cutter. Such a tool features a high-speed mode to cut any part from any video with 100% original quality and with millisecond precision on both Windows and Mac.

Participant
September 14, 2019

I wrote this ruby script recently to do that.  I was tired of trying to find other solutions.

https://gist.github.com/hwgusn/104148a135044c1c3e442d7445285374

Participant
October 20, 2019

I absolutely love that Ruby script.  Thank you!

I just installed Homebrew and Ruby and ffmpeg and the script worked perfectly.  It suits my needs 100%.

 

Thanks for the help!  Now... to figure out the best way to manage my photos and videos in Lightroom while using Premier Pro to edit.

 

 

 

Participant
October 20, 2019

I'm glad it worked for you.

 

Great Success!

R Neil Haugen
Legend
March 28, 2018

There are some apps out there, some free, some paid, that can do trimming & re-wrapping. Search with something like "cutting and re-wrapping video files without re-encoding", and you'll get results for a number of different apps, YouTube vids on doing it, that sort of thing.

Now ... H.264 files are tricky to do this as only between every 9-30 frames can you actually 'cut' with only a re-wrap. H.264 is encoded as complete or I-frames that are complete but compressed, and in-between those ... used to be 9-15 apart, then 9-30, and now, with partial I-frames on some drones, up to 120 frames in between actual complete frames. For those in-between 'frames', called p & b frames, there's only a dataset stored of a) the pixels that have changed after the last I-frame or b) the pixels that will change before the next I-frame ... or ... both! The computer has to decompress & store an I-frame in RAM, then call up the next "frame" dataset, and compute it from the stored I-frame it's already decompressed.

Which means, you can only 'cut' on complete I-frames. Which can be a second or more away from where you'd rather cut. But ... if say, you have a 30 minute file and you just want to eliminate the last 12 minutes or so ... this works great. If you want to cut precisely here to precisely there ... no, you can't do that with a simple trim/rewrap.

Neil

Everyone's mileage always varies ...
Inspiring
March 28, 2018

hmm, customer wants to trim here to there so looks like this won't work. As a work around could I use media encoder and select in and out points from the mp4 file and transcode to cineform then re encode that to a new mp4 file? I know that seems tedious but wondering if that would be a work around for the customer wanting it to be in mp4 without quality loss.

Inspiring
March 28, 2018

Yea, if you need a precise trim, you can only do that with re-encoding. I would suggest doing so by cutting in PrPro, then exporting directly to the file type needed for the deliverable, that extra transcode step would only add a (slight) degradation and raise the time required.

Neil


but if I had an mp4 and export again to mp4 wouldn't the quality decrease? At some point the customer wants me to edit the clips into a video for him with crossfades color correct etc but he wants to preview them in shorter clips on his ipad as he's traveling soon and he can't seem to get cineform etc to work on the ipad as we already tried it