Author Topic: Cutting short clips from MP4's  (Read 641 times)

canalrun

  • Newbie
  • *
  • Posts: 1
Cutting short clips from MP4's
« on: December 14, 2017, 08:42:53 PM »
Warning – Newbie Here.

I'm using a Avidemux  2.7.0 64bit on Windows 10.

I have a 5 minute or so MP4. I would like to cut small clips of about 15 seconds each from this and save as MP4s.

I'm finding when I set the A and B, then output my clip it seems to output a greater region of the original video than I had requested.

Although I am no expert, it is likely aligning itself to nearest I-FRMs rather than the P-FRMs I have selected with the A and B markers.

For Video Output I am using Copy. For Audio Output I am also using Copy – although I really don't care about audio. For Output I am using MP4 Muxer.

Is it required to align itself to I-FRMs or is am I just not using it correctly? Is there something I can do that will allow me to choose more precisely where I cut – maybe by selecting a Video Output format or maybe by changing the input video to a different format (like AVI… ?)?

Barry.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 2058
Re: Cutting short clips from MP4's
« Reply #1 on: December 14, 2017, 08:55:13 PM »
In copy mode (no reencoding, the original quality is preserved), the start marker must be set to an I-frame, the end marker may be at a P-frame, but it is safer to set it also to an I-frame. If you reencode, you can put the markers anywhere you want.

This is a fundamental limitation due to the nature of video compression.

Edit: don't use AVI as output container for any modern codecs (h264, HEVC).
« Last Edit: December 14, 2017, 08:56:55 PM by eumagga0x2a »

hiro

  • Newbie
  • *
  • Posts: 35
Re: Cutting short clips from MP4's
« Reply #2 on: December 16, 2017, 01:02:11 AM »
[edit] Or may be: Hey! a GREAT new "Avidemux" option? :) Such as: recode the needed GOP only — & I suppose that would involve some kind of autosetting, in order to recode the GOP: matching precisely enough the rest of the stream...


OK, OK (sigh)... back-to-bare-trivial-reality...:

______________________

Hi,

I used to struggle with this — when I still hoped :) to cut with no recoding BETWEEN (key) I-frames, "somehow"...

SOMETIMES (only), old versions of "Avidemux" and few other tools would accept. Then, the result was always several garbled frames that, moreover, messed up viewing by most players, when they wouldn't crash!


      "OK", since it's just impossible, I then found "SolveigMM Video Splitter (Business ed. or else) 6.1.1611.1" — commercial software, though! —, that's "able to cut between key/I-frames"

knowing that, in such case, it WILL RECODE a FEW frames or may be the whole "GOP (group of pictures)", but not the whole video.

Works OK on "AVC H.264 + .aac audio in MP4 contained" vids.


Now: was the result going to be compatible with another video — technically identical of course —, waiting on "Avidemux" window, to be joined with the modified one, and (still) without any recoding?

Though I expected the worst (...), it seems to works OK. But you  may always find counter-examples, I guess.


[ Had also tried "Smart Cutter 1.9x", but quite disappointing in many cases, + weirdo interface... ]


Sure hope to find an equivalent FREE tool, some day...


.
« Last Edit: December 16, 2017, 01:26:26 AM by hiro »

AQUAR

  • Hero Member
  • *****
  • Posts: 1068
Re: Cutting short clips from MP4's
« Reply #3 on: December 16, 2017, 08:40:11 AM »
Quote
OK, OK (sigh)... back-to-bare-trivial-reality...:

I gather from this, that you are aware of the not so trivial reality that avidemux is a simple video editor.

Avidemux with a smart copy function that works with AVC video would be like "icing with the cherry on top of the cake".
The want for lossless editing won't stop there though, we have HEVC with additional complications, and who knows what is next.
Smart copy is not just about recoding a GOP either, as you may have Closed and Open GOP structures in these codecs.

The reality is that modern codecs like AVC and HEVC are about minimizing bandwidth/size whilst preserving the viewing experience.
That objective is opposite to creating editing friendly codecs (although you could use not long GOP though).

Codec choice and their setup parameters depends on the end game: eg the type of content being captured, editing computer power, work flow, distribution and transmission, retail or private product etc.
« Last Edit: December 16, 2017, 08:55:21 AM by AQUAR »

hiro

  • Newbie
  • *
  • Posts: 35
Re: Cutting short clips from MP4's
« Reply #4 on: December 28, 2017, 07:36:07 AM »
Could "ADM smart copy/rendering" be procrastinated, say... to 22nd century, then ?..  :)


    Hi & thanks for the answer

that "forced" me to re-document myself on "GOPs" & "closed / open + short / long".

BTW, I assume that "not long GOP" means "short GOP", although in this matter, I wouldn't bet! I'm advancing at "counter-lightspeed" (& sometimes wondering if it's any better than nothing).



      Anyway, as "far" as my tech. knowledge allows — i.e. not far AT ALL  :D —, I at least suspected smart rendering to be a tough one.

Therefore, please note it wasn't exactly a request, rather some "dreamy suggestion", which came from my heavy use, during the 2000's, of

——  "VirtualDub" — = at least one freeware exists, with that option; but limited: won't render to ".mp4" container (unless complex & rather uncertain preparation), except its "FilterMod" new version or tweak; & in all cases + for now, it will only "smart render" vids it has previously encoded;

——  "Sony Vegas", as old as "5.0x" (~2004), that "smart renders", at least "Huffyuv .avis (+ Lagarith .avis": recent test OK);

but / just tested / won't work on "x264 .avis" vids, though! (not a recommended container to "H.264", I know);

——  and recent test: "Solveig Splitter" is the only one that will "smart render" on/from ".mp4 H.264" files; priced ~$50 though, which may be affordable, but not in terms of complexity! i.e. one more of those tools beginners soon abandon...

... while "Vegas smart render" integrates / works seamlessly — EXCEPT... for its overall price!



About ADM being a simple software, yes, I'm aware of that, and sure appreciate such an EASY tool, as it means both quicker results + straightforward / efficient help to beginners (contrary to an often discouraging bunch of softwares I test once in a while / incl. on their demand).


In a word, "I'm-the-general-public" (all by myself, yep!). And I try to report friend's requests / expectations on ADM features.

Being stuck at my BASIC USER point of view, I am "for instance" 100% unable to contribute to coding — as eumagga0x2a suggested in another post;

it also means that I'm more or less unable to evaluate requests etc. as "naive", or "half realistic" or what... Plus: setting the limit at which creating a new option or filter is relevant or not must sometimes be difficult anyway.   


However, although not comparable to a "smart render" option (I know), if this works:

This prepares future work on fade-in/out feature for logos.

it will be a treat to quite a few people I'm trying to help + to me of course: one good chunk of cake icing.





fish

  • Jr. Member
  • **
  • Posts: 77
Re: Cutting short clips from MP4's
« Reply #5 on: December 28, 2017, 08:21:01 AM »
.
« Last Edit: December 28, 2017, 01:23:13 PM by fish »

fish

  • Jr. Member
  • **
  • Posts: 77
Re: Cutting short clips from MP4's
« Reply #6 on: December 28, 2017, 01:22:26 PM »
Sorry, no offence intended, Avidemux only it is then.

AQUAR

  • Hero Member
  • *****
  • Posts: 1068
Re: Cutting short clips from MP4's
« Reply #7 on: December 29, 2017, 12:19:47 AM »
@ fish

Amusing reply - just what this forum needs occasionally.

IIRC - "long GOP" coded video coded includes inter frames.
If not "long GOP" then all frames are intra frames and some call this "no GOP" or "short GOP".
Its all fuzzy logic to me!